cryptsetup API
Public cryptsetup API


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)

Detailed Description

Benchmarking of algorithms

Function Documentation

◆ 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.

cdcrypt device handle
cipher(e.g. "aes")
cipher_mode(e.g. "xts"), IV generator is ignored
volume_key_sizesize of volume key in bytes
iv_sizesize of IV in bytes
buffer_sizesize of encryption buffer in bytes used in test
encryption_mbsmeasured encryption speed in MiB/s
decryption_mbsmeasured decryption speed in MiB/s
0 on success or negative errno value otherwise.
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.

cdcrypt device handle
pbkdfPBKDF parameters
passwordpassword for benchmark
password_sizesize of password
saltsalt for benchmark
salt_sizesize of salt
volume_key_sizeoutput volume key size
progresscallback function
usrptrprovided identification in callback
0 on success or negative errno value otherwise.