Skip to content

Commit

Permalink
Merge pull request #495 from LedgerHQ/xch/cxng-misc
Browse files Browse the repository at this point in the history
Lib CX: small fix
  • Loading branch information
xchapron-ledger authored Dec 19, 2023
2 parents a01a99c + 7f498c2 commit 9fe355d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib_cxng/src/cx_cmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cx_err_t cx_cmac_start(cx_cipher_context_t *ctx, const uint8_t *key, size_t key_
CX_CHECK(cx_cipher_setkey(ctx, key, key_bitlen, CX_ENCRYPT));

ctx->cmac_ctx = &G_cx.cmac;
memset(ctx->cmac_ctx->state, 0, sizeof(ctx->cmac_ctx->state));
memset(ctx->cmac_ctx, 0, sizeof(cx_cmac_context_t));

end:
return error;
Expand Down
3 changes: 2 additions & 1 deletion lib_cxng/src/cx_hmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ cx_err_t cx_hmac_init(cx_hmac_t *ctx, cx_md_t hash_id, const uint8_t *key, size_
return CX_INVALID_PARAMETER;
}

hash_ctx = &ctx->hash_ctx, memset(ctx, 0, sizeof(cx_hmac_t));
hash_ctx = &ctx->hash_ctx;
memset(ctx, 0, sizeof(cx_hmac_t));
size_t block_size = cx_get_block_size(hash_id);

if (key) {
Expand Down

0 comments on commit 9fe355d

Please sign in to comment.