forked from wolfSSL/wolfssl
SHA256, SHA384 and SHA512 error verification on test files.
This commit is contained in:
@@ -221,19 +221,23 @@ void InitSha256(Sha256* sha256)
|
||||
reset_engine(&(sha256->desc), PIC32_ALGO_SHA256) ;
|
||||
}
|
||||
|
||||
void Sha256Update(Sha256* sha256, const byte* data, word32 len)
|
||||
int Sha256Update(Sha256* sha256, const byte* data, word32 len)
|
||||
{
|
||||
CYASSL_ENTER("Sha256Update\n") ;
|
||||
update_engine(&(sha256->desc), data, len, sha256->digest) ;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Sha256Final(Sha256* sha256, byte* hash)
|
||||
int Sha256Final(Sha256* sha256, byte* hash)
|
||||
{
|
||||
CYASSL_ENTER("Sha256Final\n") ;
|
||||
start_engine(&(sha256->desc)) ;
|
||||
wait_engine(&(sha256->desc), (char *)sha256->digest, SHA256_HASH_SIZE) ;
|
||||
XMEMCPY(hash, sha256->digest, SHA256_HASH_SIZE) ;
|
||||
InitSha256(sha256); /* reset state */
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* NO_SHA256 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user