sha384 plus merge changes

This commit is contained in:
toddouska
2012-04-26 14:58:29 -07:00
parent a0d056bc5f
commit 0f5b0ff8c3
7 changed files with 737 additions and 15 deletions

View File

@@ -832,8 +832,20 @@ int AES_set_decrypt_key (const unsigned char* userKey, const int bits,
#endif /* CYASSL_AESNI */
int AesSetIV(Aes* aes, const byte* iv)
{
if (aes == NULL)
return BAD_FUNC_ARG;
if (iv)
XMEMCPY(aes->reg, iv, AES_BLOCK_SIZE);
return 0;
}
int AesSetKey(Aes* aes, const byte* userKey, word32 keylen, const byte* iv,
int dir)
int dir)
{
word32 temp, *rk = aes->key;
unsigned int i = 0;
@@ -976,10 +988,8 @@ int AesSetKey(Aes* aes, const byte* userKey, word32 keylen, const byte* iv,
Td[3][Te[4][GETBYTE(rk[3], 0)] & 0xff];
}
}
if (iv)
XMEMCPY(aes->reg, iv, AES_BLOCK_SIZE);
return 0;
return AesSetIV(aes, iv);
}