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:
parent
08219ea77a
commit
489f09a843
4
hmac.c
4
hmac.c
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user