On 09/12/2016 09:13 AM, Daniel P. Berrange wrote: > Currently when timing the pbkdf algorithm a fixed key > size of 32 bytes is used. This results in inaccurate > timings for certain hashes depending on their digest > size. For example when using sha1 with aes-256, this > causes us to measure time for the master key digest > doing 2 sha1 operations per iteration, instead of 1. > > Instead we should pass in the desired key size to the > timing routine that matches the key size that will be > used for real later. > > Signed-off-by: Daniel P. Berrange <[email protected]> > --- > crypto/block-luks.c | 2 ++ > crypto/pbkdf.c | 10 +++++++--- > include/crypto/pbkdf.h | 6 +++++- > tests/test-crypto-pbkdf.c | 1 + > 4 files changed, 15 insertions(+), 4 deletions(-) >
Reviewed-by: Eric Blake <[email protected]> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
