From 5608a73c003bbc4547d8e09b24acf94c5af5cb24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Tue, 7 Mar 2023 11:15:24 +0100 Subject: [PATCH] -simplify zero-check for age-commitment hash --- src/include/taler_crypto_lib.h | 9 ++------- src/util/crypto.c | 5 ----- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index db50efa10..c285a38ee 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -1309,13 +1309,8 @@ struct TALER_AgeAttestation #endif }; - -extern const struct TALER_AgeCommitmentHash TALER_ZeroAgeCommitmentHash; -#define TALER_AgeCommitmentHash_isNullOrZero(ph) \ - ((NULL == ph) || \ - (0 == memcmp (ph, \ - &TALER_ZeroAgeCommitmentHash, \ - sizeof(struct TALER_AgeCommitmentHash)))) +#define TALER_AgeCommitmentHash_isNullOrZero(ph) ((NULL == ph) || \ + GNUNET_is_zero (ph)) /** * @brief Type of public signing keys for verifying blindly signed coins. diff --git a/src/util/crypto.c b/src/util/crypto.c index 5cbba8135..d164b8a50 100644 --- a/src/util/crypto.c +++ b/src/util/crypto.c @@ -26,11 +26,6 @@ #include "taler_util.h" #include -/** - * Used in TALER_AgeCommitmentHash_isNullOrZero for comparison - */ -const struct TALER_AgeCommitmentHash TALER_ZeroAgeCommitmentHash = {0}; - /** * Function called by libgcrypt on serious errors. * Prints an error message and aborts the process.