"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/utils_benchmark.c" between
cryptsetup-2.3.6.tar.xz and cryptsetup-2.4.0.tar.xz

About: cryptsetup is a utility used to conveniently setup disk encryption based on the dm-crypt kernel module. These include plain dm-crypt volumes, LUKS volumes, loop-AES and TrueCrypt compatible format.

utils_benchmark.c  (cryptsetup-2.3.6.tar.xz):utils_benchmark.c  (cryptsetup-2.4.0.tar.xz)
skipping to change at line 199 skipping to change at line 199
pbkdf->time_ms = ms_tmp; pbkdf->time_ms = ms_tmp;
if (r < 0) { if (r < 0) {
log_err(cd, _("Not compatible PBKDF2 options (using hash algorithm %s)."), log_err(cd, _("Not compatible PBKDF2 options (using hash algorithm %s)."),
pbkdf->hash); pbkdf->hash);
return r; return r;
} }
PBKDF2_tmp = ((double)pbkdf->iterations * pbkdf->time_ms / 1000.) ; PBKDF2_tmp = ((double)pbkdf->iterations * pbkdf->time_ms / 1000.) ;
if (PBKDF2_tmp > (double)UINT32_MAX) if (PBKDF2_tmp > (double)UINT32_MAX)
return -EINVAL; return -EINVAL;
pbkdf->iterations = at_least((uint32_t)PBKDF2_tmp, pbkdf_limits.m in_iterations); pbkdf->iterations = AT_LEAST((uint32_t)PBKDF2_tmp, pbkdf_limits.m in_iterations);
} else { } else {
/* Already benchmarked */ /* Already benchmarked */
if (pbkdf->iterations) { if (pbkdf->iterations) {
log_dbg(cd, "Reusing PBKDF values."); log_dbg(cd, "Reusing PBKDF values.");
return 0; return 0;
} }
r = crypt_benchmark_pbkdf(cd, pbkdf, "foo", 3, r = crypt_benchmark_pbkdf(cd, pbkdf, "foo", 3,
"0123456789abcdef0123456789abcdef", 32, "0123456789abcdef0123456789abcdef", 32,
volume_key_size, &benchmark_callback, &u); volume_key_size, &benchmark_callback, &u);
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)