[crypto] update SHA256 to new mbedtls APIs (#2756)

This commit is contained in:
Jonathan Hui
2018-06-07 11:08:37 -07:00
parent 5e94a2d485
commit 951e305f31
+3 -3
View File
@@ -48,17 +48,17 @@ Sha256::~Sha256()
void Sha256::Start(void)
{
mbedtls_sha256_starts(&mContext, 0);
mbedtls_sha256_starts_ret(&mContext, 0);
}
void Sha256::Update(const uint8_t *aBuf, uint16_t aBufLength)
{
mbedtls_sha256_update(&mContext, aBuf, aBufLength);
mbedtls_sha256_update_ret(&mContext, aBuf, aBufLength);
}
void Sha256::Finish(uint8_t aHash[kHashSize])
{
mbedtls_sha256_finish(&mContext, aHash);
mbedtls_sha256_finish_ret(&mContext, aHash);
}
} // namespace Crypto