+static inline int set_llcrypt_crypto_engine_type(void)
+{
+ if (strcmp(client_encryption_engine, "system-default") == 0)
+ llcrypt_crypto_engine = LLCRYPT_ENGINE_SYSTEM_DEFAULT;
+ else if (strcmp(client_encryption_engine, "aes-ni") == 0)
+ llcrypt_crypto_engine = LLCRYPT_ENGINE_AES_NI;
+ else
+ llcrypt_crypto_engine = LLCRYPT_ENGINE_INVALID;
+
+ if (llcrypt_crypto_engine == LLCRYPT_ENGINE_INVALID)
+ return -EINVAL;
+
+ return 0;
+}
+