1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-18 11:21:11 +00:00

fix sizeof usage

This commit is contained in:
Pavol Rusnak 2016-04-26 19:51:49 +02:00
parent 08219ea77a
commit 489f09a843
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

4
hmac.c
View File

@ -58,7 +58,7 @@ void hmac_sha256_Final(HMAC_SHA256_CTX *hctx, uint8_t *hmac)
sha256_Update(&(hctx->ctx), hash, SHA256_DIGEST_LENGTH); sha256_Update(&(hctx->ctx), hash, SHA256_DIGEST_LENGTH);
sha256_Final(&(hctx->ctx), hmac); sha256_Final(&(hctx->ctx), hmac);
MEMSET_BZERO(hash, sizeof(hash)); MEMSET_BZERO(hash, sizeof(hash));
MEMSET_BZERO(hctx, sizeof(hctx)); MEMSET_BZERO(hctx, sizeof(HMAC_SHA256_CTX));
} }
void hmac_sha256(const uint8_t *key, const uint32_t keylen, const uint8_t *msg, const uint32_t msglen, uint8_t *hmac) void hmac_sha256(const uint8_t *key, const uint32_t keylen, const uint8_t *msg, const uint32_t msglen, uint8_t *hmac)
@ -101,7 +101,7 @@ void hmac_sha512_Final(HMAC_SHA512_CTX *hctx, uint8_t *hmac)
sha512_Update(&(hctx->ctx), hash, SHA512_DIGEST_LENGTH); sha512_Update(&(hctx->ctx), hash, SHA512_DIGEST_LENGTH);
sha512_Final(&(hctx->ctx), hmac); sha512_Final(&(hctx->ctx), hmac);
MEMSET_BZERO(hash, sizeof(hash)); MEMSET_BZERO(hash, sizeof(hash));
MEMSET_BZERO(hctx, sizeof(hctx)); MEMSET_BZERO(hctx, sizeof(HMAC_SHA512_CTX));
} }
void hmac_sha512(const uint8_t *key, const uint32_t keylen, const uint8_t *msg, const uint32_t msglen, uint8_t *hmac) void hmac_sha512(const uint8_t *key, const uint32_t keylen, const uint8_t *msg, const uint32_t msglen, uint8_t *hmac)