|
int | crypt_benchmark (struct crypt_device *cd, const char *cipher, const char *cipher_mode, size_t volume_key_size, size_t iv_size, size_t buffer_size, double *encryption_mbs, double *decryption_mbs) |
|
int | crypt_benchmark_pbkdf (struct crypt_device *cd, struct crypt_pbkdf_type *pbkdf, const char *password, size_t password_size, const char *salt, size_t salt_size, size_t volume_key_size, int(*progress)(uint32_t time_ms, void *usrptr), void *usrptr) |
|
Benchmarking of algorithms
◆ crypt_benchmark()
int crypt_benchmark |
( |
struct crypt_device * |
cd, |
|
|
const char * |
cipher, |
|
|
const char * |
cipher_mode, |
|
|
size_t |
volume_key_size, |
|
|
size_t |
iv_size, |
|
|
size_t |
buffer_size, |
|
|
double * |
encryption_mbs, |
|
|
double * |
decryption_mbs |
|
) |
| |
Informational benchmark for ciphers.
- Parameters
-
cd | crypt device handle |
cipher | (e.g. "aes") |
cipher_mode | (e.g. "xts"), IV generator is ignored |
volume_key_size | size of volume key in bytes |
iv_size | size of IV in bytes |
buffer_size | size of encryption buffer in bytes used in test |
encryption_mbs | measured encryption speed in MiB/s |
decryption_mbs | measured decryption speed in MiB/s |
- Returns
- 0 on success or negative errno value otherwise.
- Note
- If encryption_buffer_size is too small and encryption time cannot be properly measured, -ERANGE is returned.
◆ crypt_benchmark_pbkdf()
int crypt_benchmark_pbkdf |
( |
struct crypt_device * |
cd, |
|
|
struct crypt_pbkdf_type * |
pbkdf, |
|
|
const char * |
password, |
|
|
size_t |
password_size, |
|
|
const char * |
salt, |
|
|
size_t |
salt_size, |
|
|
size_t |
volume_key_size, |
|
|
int(*)(uint32_t time_ms, void *usrptr) |
progress, |
|
|
void * |
usrptr |
|
) |
| |
Informational benchmark for PBKDF.
- Parameters
-
cd | crypt device handle |
pbkdf | PBKDF parameters |
password | password for benchmark |
password_size | size of password |
salt | salt for benchmark |
salt_size | size of salt |
volume_key_size | output volume key size |
progress | callback function |
usrptr | provided identification in callback |
- Returns
- 0 on success or negative errno value otherwise.