summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/engine/hw_cryptodev.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/libcrypto/engine/hw_cryptodev.c b/lib/libcrypto/engine/hw_cryptodev.c
index 21de0a9fdd0..d12d23d9fc2 100644
--- a/lib/libcrypto/engine/hw_cryptodev.c
+++ b/lib/libcrypto/engine/hw_cryptodev.c
@@ -744,20 +744,22 @@ check_viac3aes(void)
if (value == 0)
return (0);
- cryptodev_aes_128_cbc.init = xcrypt_init_key;
- cryptodev_aes_128_cbc.do_cipher = xcrypt_cipher;
- cryptodev_aes_128_cbc.cleanup = xcrypt_cleanup;
- cryptodev_aes_128_cbc.ctx_size = sizeof(AES_KEY);
-
- cryptodev_aes_192_cbc.init = xcrypt_init_key;
- cryptodev_aes_192_cbc.do_cipher = xcrypt_cipher;
- cryptodev_aes_192_cbc.cleanup = xcrypt_cleanup;
- cryptodev_aes_192_cbc.ctx_size = sizeof(AES_KEY);
-
- cryptodev_aes_256_cbc.init = xcrypt_init_key;
- cryptodev_aes_256_cbc.do_cipher = xcrypt_cipher;
- cryptodev_aes_256_cbc.cleanup = xcrypt_cleanup;
- cryptodev_aes_256_cbc.ctx_size = sizeof(AES_KEY);
+ if (value & C3_HAS_AES) {
+ cryptodev_aes_128_cbc.init = xcrypt_init_key;
+ cryptodev_aes_128_cbc.do_cipher = xcrypt_cipher;
+ cryptodev_aes_128_cbc.cleanup = xcrypt_cleanup;
+ cryptodev_aes_128_cbc.ctx_size = sizeof(AES_KEY);
+
+ cryptodev_aes_192_cbc.init = xcrypt_init_key;
+ cryptodev_aes_192_cbc.do_cipher = xcrypt_cipher;
+ cryptodev_aes_192_cbc.cleanup = xcrypt_cleanup;
+ cryptodev_aes_192_cbc.ctx_size = sizeof(AES_KEY);
+
+ cryptodev_aes_256_cbc.init = xcrypt_init_key;
+ cryptodev_aes_256_cbc.do_cipher = xcrypt_cipher;
+ cryptodev_aes_256_cbc.cleanup = xcrypt_cleanup;
+ cryptodev_aes_256_cbc.ctx_size = sizeof(AES_KEY);
+ }
return (value);
}
#endif /* __i386__ */