mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 10:50:01 +01:00
Change PBKDF interface API.
Prepare API for PBKDF that can set three costs - time (similar to iterations in PBKDF2) - memory (required memory for memory-hard function) - threads (required number of threads/CPUs). This patch also removes wrongly designed API call crypt_benchmark_kdf and replaces it with the new call crypt_benchmark_pbkdf. Two functions for PBKDF per context setting are introduced: crypt_set_pbkdf_type and crypt_get_pbkdf_type. The patch should be backward compatible when using crypt_set_iteration_time function (works only for PBKDF2). Signed-off-by: Milan Broz <gmazyland@gmail.com>
This commit is contained in:
@@ -60,7 +60,7 @@ int crypt_backend_rng(char *buffer, size_t length, int quality, int fips);
|
||||
int crypt_pbkdf_check(const char *kdf, const char *hash,
|
||||
const char *password, size_t password_length,
|
||||
const char *salt, size_t salt_length,
|
||||
size_t key_length, uint64_t *iter_secs);
|
||||
size_t key_length, uint32_t *iter_secs);
|
||||
int crypt_pbkdf(const char *kdf, const char *hash,
|
||||
const char *password, size_t password_length,
|
||||
const char *salt, size_t salt_length,
|
||||
|
||||
@@ -55,7 +55,7 @@ static long time_ms(struct rusage *start, struct rusage *end)
|
||||
int crypt_pbkdf_check(const char *kdf, const char *hash,
|
||||
const char *password, size_t password_length,
|
||||
const char *salt, size_t salt_length,
|
||||
size_t key_length, uint64_t *iter_secs)
|
||||
size_t key_length, uint32_t *iter_secs)
|
||||
{
|
||||
struct rusage rstart, rend;
|
||||
int r = 0, step = 0;
|
||||
|
||||
Reference in New Issue
Block a user