aboutsummaryrefslogtreecommitdiff
path: root/src/noscrypt.c
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-03-02 22:57:36 -0500
committerLibravatar vnugent <public@vaughnnugent.com>2024-03-02 22:57:36 -0500
commit1b84e3c7c2e55b1ff9ffdd09b66873e11c131441 (patch)
tree6cc9fc8a9398d9374c38ff8d2d6dc6605cbd5005 /src/noscrypt.c
parent9de5a214c66adea0ef2d0bac63c59449de202a88 (diff)
fix: #2 constent usage of sizeof() operator on struct types
Diffstat (limited to 'src/noscrypt.c')
-rw-r--r--src/noscrypt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/noscrypt.c b/src/noscrypt.c
index 358da27..7cb9b69 100644
--- a/src/noscrypt.c
+++ b/src/noscrypt.c
@@ -491,8 +491,8 @@ NC_EXPORT NCResult NC_CC NCGetPublicKey(
DEBUG_ASSERT2(result == 1, "Expected x-only pubkey serialize to return 1")
//Clean out keypair
- ZERO_FILL(&keyPair, sizeof(secp256k1_keypair));
- ZERO_FILL(&xonly, sizeof(secp256k1_xonly_pubkey));
+ ZERO_FILL(&keyPair, sizeof(keyPair));
+ ZERO_FILL(&xonly, sizeof(xonly));
return NC_SUCCESS;
}
@@ -550,8 +550,8 @@ NC_EXPORT NCResult NC_CC NCSignDigest(
result = secp256k1_schnorrsig_verify(ctx->secpCtx, sig64, digest32, 32, &xonly);
//cleanup any sensitive data
- ZERO_FILL(&keyPair, sizeof(secp256k1_keypair));
- ZERO_FILL(&xonly, sizeof(secp256k1_xonly_pubkey));
+ ZERO_FILL(&keyPair, sizeof(keyPair));
+ ZERO_FILL(&xonly, sizeof(xonly));
return result == 1 ? NC_SUCCESS : E_INVALID_ARG;
}
@@ -611,7 +611,7 @@ NC_EXPORT NCResult NC_CC NCVerifyDigest(
result = secp256k1_schnorrsig_verify(ctx->secpCtx, sig64, digest32, 32, &xonly);
//cleanup any sensitive data
- ZERO_FILL(&xonly, sizeof(secp256k1_xonly_pubkey));
+ ZERO_FILL(&xonly, sizeof(xonly));
return result == 1 ? NC_SUCCESS : E_INVALID_ARG;
}
@@ -908,8 +908,8 @@ NC_EXPORT NCResult NC_CC NCVerifyMacEx(
{
NCResult result;
const mbedtls_md_info_t* sha256Info;
- struct message_key messageKey;
const struct nc_expand_keys* keys;
+ struct message_key messageKey;
uint8_t hmacOut[NC_ENCRYPTION_MAC_SIZE];
CHECK_NULL_ARG(ctx, 0)