From 500a70d5569796a6adf8ae3d430f7491d4b93d4c Mon Sep 17 00:00:00 2001 From: Markus Friedl Date: Mon, 23 May 2005 23:08:25 +0000 Subject: no need to byteswap for AES_ASM, from tom@ --- lib/libcrypto/engine/hw_cryptodev.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/libcrypto/engine/hw_cryptodev.c') diff --git a/lib/libcrypto/engine/hw_cryptodev.c b/lib/libcrypto/engine/hw_cryptodev.c index 41184b67867..924e379ab54 100644 --- a/lib/libcrypto/engine/hw_cryptodev.c +++ b/lib/libcrypto/engine/hw_cryptodev.c @@ -714,7 +714,9 @@ xcrypt_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc) { AES_KEY *k = ctx->cipher_data; +#ifndef AES_ASM int i; +#endif bzero(k, sizeof *k); if (enc) @@ -722,9 +724,15 @@ xcrypt_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, else AES_set_decrypt_key(key, ctx->key_len * 8, k); - /* Damn OpenSSL byte swaps the expanded key!! */ +#ifndef AES_ASM + /* + * XXX Damn OpenSSL byte swaps the expanded key!! + * + * XXX But only if we're using the C implementation of AES + */ for (i = 0; i < 4 * (AES_MAXNR + 1); i++) k->rd_key[i] = htonl(k->rd_key[i]); +#endif return (1); } -- cgit v1.2.3