summaryrefslogtreecommitdiff
path: root/Cryptlib/OpenSSL/crypto/aes
diff options
context:
space:
mode:
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/aes')
-rwxr-xr-xCryptlib/OpenSSL/crypto/aes/aes_cfb.c1
-rwxr-xr-xCryptlib/OpenSSL/crypto/aes/aes_wrap.c12
2 files changed, 6 insertions, 7 deletions
diff --git a/Cryptlib/OpenSSL/crypto/aes/aes_cfb.c b/Cryptlib/OpenSSL/crypto/aes/aes_cfb.c
index 49f04110..9384ba67 100755
--- a/Cryptlib/OpenSSL/crypto/aes/aes_cfb.c
+++ b/Cryptlib/OpenSSL/crypto/aes/aes_cfb.c
@@ -201,7 +201,6 @@ void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
assert(in && out && key && ivec && num);
assert(*num == 0);
- memset(out,0,(length+7)/8);
for(n=0 ; n < length ; ++n)
{
c[0]=(in[n/8]&(1 << (7-n%8))) ? 0x80 : 0;
diff --git a/Cryptlib/OpenSSL/crypto/aes/aes_wrap.c b/Cryptlib/OpenSSL/crypto/aes/aes_wrap.c
index 9feacd65..e2d73d37 100755
--- a/Cryptlib/OpenSSL/crypto/aes/aes_wrap.c
+++ b/Cryptlib/OpenSSL/crypto/aes/aes_wrap.c
@@ -85,9 +85,9 @@ int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
A[7] ^= (unsigned char)(t & 0xff);
if (t > 0xff)
{
- A[6] ^= (unsigned char)((t & 0xff) >> 8);
- A[5] ^= (unsigned char)((t & 0xff) >> 16);
- A[4] ^= (unsigned char)((t & 0xff) >> 24);
+ A[6] ^= (unsigned char)((t >> 8) & 0xff);
+ A[5] ^= (unsigned char)((t >> 16) & 0xff);
+ A[4] ^= (unsigned char)((t >> 24) & 0xff);
}
memcpy(R, B + 8, 8);
}
@@ -119,9 +119,9 @@ int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
A[7] ^= (unsigned char)(t & 0xff);
if (t > 0xff)
{
- A[6] ^= (unsigned char)((t & 0xff) >> 8);
- A[5] ^= (unsigned char)((t & 0xff) >> 16);
- A[4] ^= (unsigned char)((t & 0xff) >> 24);
+ A[6] ^= (unsigned char)((t >> 8) & 0xff);
+ A[5] ^= (unsigned char)((t >> 16) & 0xff);
+ A[4] ^= (unsigned char)((t >> 24) & 0xff);
}
memcpy(B + 8, R, 8);
AES_decrypt(B, B, key);