if (!type)
return -EINVAL;
+ /* Some hash functions need initialized gcrypt library */
+ if (init_crypto()) {
+ log_err(cd, _("Cannot initialize crypto backend.\n"));
+ return -ENOSYS;
+ }
+
if (volume_key)
cd->volume_key = LUKS_alloc_masterkey(volume_key_size,
volume_key);
{
if (!*PBKDF2_per_sec) {
if (PBKDF2_performance_check(hashSpec, PBKDF2_per_sec) < 0) {
- log_err(ctx, _("Not compatible PBKDF2 options (using hash algorithm %s)."), hashSpec);
+ log_err(ctx, _("Not compatible PBKDF2 options (using hash algorithm %s).\n"), hashSpec);
return -EINVAL;
}
log_dbg("PBKDF2: %" PRIu64 " iterations per second using hash %s.", *PBKDF2_per_sec, hashSpec);