diff options
author | djm <> | 2011-11-03 02:32:23 +0000 |
---|---|---|
committer | djm <> | 2011-11-03 02:32:23 +0000 |
commit | 113f799ec7d1728f0a5d7ab5b0e3b42e3de56407 (patch) | |
tree | 26d712b25a8fa580b8f2dfc6df470ba5ffea9eb7 /src/lib/libcrypto/aes/aes_wrap.c | |
parent | 829fd51d4f8dde4a7f3bf54754f3c1d1a502f5e2 (diff) | |
download | openbsd-113f799ec7d1728f0a5d7ab5b0e3b42e3de56407.tar.gz openbsd-113f799ec7d1728f0a5d7ab5b0e3b42e3de56407.tar.bz2 openbsd-113f799ec7d1728f0a5d7ab5b0e3b42e3de56407.zip |
import OpenSSL 1.0.0e
Diffstat (limited to 'src/lib/libcrypto/aes/aes_wrap.c')
-rw-r--r-- | src/lib/libcrypto/aes/aes_wrap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/aes/aes_wrap.c b/src/lib/libcrypto/aes/aes_wrap.c index 9feacd65d8..e2d73d37ce 100644 --- a/src/lib/libcrypto/aes/aes_wrap.c +++ b/src/lib/libcrypto/aes/aes_wrap.c | |||
@@ -85,9 +85,9 @@ int AES_wrap_key(AES_KEY *key, const unsigned char *iv, | |||
85 | A[7] ^= (unsigned char)(t & 0xff); | 85 | A[7] ^= (unsigned char)(t & 0xff); |
86 | if (t > 0xff) | 86 | if (t > 0xff) |
87 | { | 87 | { |
88 | A[6] ^= (unsigned char)((t & 0xff) >> 8); | 88 | A[6] ^= (unsigned char)((t >> 8) & 0xff); |
89 | A[5] ^= (unsigned char)((t & 0xff) >> 16); | 89 | A[5] ^= (unsigned char)((t >> 16) & 0xff); |
90 | A[4] ^= (unsigned char)((t & 0xff) >> 24); | 90 | A[4] ^= (unsigned char)((t >> 24) & 0xff); |
91 | } | 91 | } |
92 | memcpy(R, B + 8, 8); | 92 | memcpy(R, B + 8, 8); |
93 | } | 93 | } |
@@ -119,9 +119,9 @@ int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, | |||
119 | A[7] ^= (unsigned char)(t & 0xff); | 119 | A[7] ^= (unsigned char)(t & 0xff); |
120 | if (t > 0xff) | 120 | if (t > 0xff) |
121 | { | 121 | { |
122 | A[6] ^= (unsigned char)((t & 0xff) >> 8); | 122 | A[6] ^= (unsigned char)((t >> 8) & 0xff); |
123 | A[5] ^= (unsigned char)((t & 0xff) >> 16); | 123 | A[5] ^= (unsigned char)((t >> 16) & 0xff); |
124 | A[4] ^= (unsigned char)((t & 0xff) >> 24); | 124 | A[4] ^= (unsigned char)((t >> 24) & 0xff); |
125 | } | 125 | } |
126 | memcpy(B + 8, R, 8); | 126 | memcpy(B + 8, R, 8); |
127 | AES_decrypt(B, B, key); | 127 | AES_decrypt(B, B, key); |