diff options
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); |