diff options
| author | markus <> | 2005-05-23 23:08:24 +0000 |
|---|---|---|
| committer | markus <> | 2005-05-23 23:08:24 +0000 |
| commit | 11614e58638e2a3775eabeb1a5021c5bd2ba40d2 (patch) | |
| tree | c3cefc1efe5ac8d90e1b1d243fb0897d1ae75cbe /src/lib/libcrypto/engine/hw_cryptodev.c | |
| parent | 6ce3f0a104c8122e9c64fc28f445a618787e673f (diff) | |
| download | openbsd-11614e58638e2a3775eabeb1a5021c5bd2ba40d2.tar.gz openbsd-11614e58638e2a3775eabeb1a5021c5bd2ba40d2.tar.bz2 openbsd-11614e58638e2a3775eabeb1a5021c5bd2ba40d2.zip | |
no need to byteswap for AES_ASM, from tom@
Diffstat (limited to 'src/lib/libcrypto/engine/hw_cryptodev.c')
| -rw-r--r-- | src/lib/libcrypto/engine/hw_cryptodev.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/libcrypto/engine/hw_cryptodev.c b/src/lib/libcrypto/engine/hw_cryptodev.c index 41184b6786..924e379ab5 100644 --- a/src/lib/libcrypto/engine/hw_cryptodev.c +++ b/src/lib/libcrypto/engine/hw_cryptodev.c | |||
| @@ -714,7 +714,9 @@ xcrypt_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | |||
| 714 | const unsigned char *iv, int enc) | 714 | const unsigned char *iv, int enc) |
| 715 | { | 715 | { |
| 716 | AES_KEY *k = ctx->cipher_data; | 716 | AES_KEY *k = ctx->cipher_data; |
| 717 | #ifndef AES_ASM | ||
| 717 | int i; | 718 | int i; |
| 719 | #endif | ||
| 718 | 720 | ||
| 719 | bzero(k, sizeof *k); | 721 | bzero(k, sizeof *k); |
| 720 | if (enc) | 722 | if (enc) |
| @@ -722,9 +724,15 @@ xcrypt_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | |||
| 722 | else | 724 | else |
| 723 | AES_set_decrypt_key(key, ctx->key_len * 8, k); | 725 | AES_set_decrypt_key(key, ctx->key_len * 8, k); |
| 724 | 726 | ||
| 725 | /* Damn OpenSSL byte swaps the expanded key!! */ | 727 | #ifndef AES_ASM |
| 728 | /* | ||
| 729 | * XXX Damn OpenSSL byte swaps the expanded key!! | ||
| 730 | * | ||
| 731 | * XXX But only if we're using the C implementation of AES | ||
| 732 | */ | ||
| 726 | for (i = 0; i < 4 * (AES_MAXNR + 1); i++) | 733 | for (i = 0; i < 4 * (AES_MAXNR + 1); i++) |
| 727 | k->rd_key[i] = htonl(k->rd_key[i]); | 734 | k->rd_key[i] = htonl(k->rd_key[i]); |
| 735 | #endif | ||
| 728 | 736 | ||
| 729 | return (1); | 737 | return (1); |
| 730 | } | 738 | } |
