-simplify zero-check for age-commitment hash

This commit is contained in:
Özgür Kesim 2023-03-07 11:15:24 +01:00
parent 7521ff1cf4
commit 5608a73c00
Signed by: oec
GPG Key ID: 3D76A56D79EDD9D7
2 changed files with 2 additions and 12 deletions

View File

@ -1309,13 +1309,8 @@ struct TALER_AgeAttestation
#endif #endif
}; };
#define TALER_AgeCommitmentHash_isNullOrZero(ph) ((NULL == ph) || \
extern const struct TALER_AgeCommitmentHash TALER_ZeroAgeCommitmentHash; GNUNET_is_zero (ph))
#define TALER_AgeCommitmentHash_isNullOrZero(ph) \
((NULL == ph) || \
(0 == memcmp (ph, \
&TALER_ZeroAgeCommitmentHash, \
sizeof(struct TALER_AgeCommitmentHash))))
/** /**
* @brief Type of public signing keys for verifying blindly signed coins. * @brief Type of public signing keys for verifying blindly signed coins.

View File

@ -26,11 +26,6 @@
#include "taler_util.h" #include "taler_util.h"
#include <gcrypt.h> #include <gcrypt.h>
/**
* Used in TALER_AgeCommitmentHash_isNullOrZero for comparison
*/
const struct TALER_AgeCommitmentHash TALER_ZeroAgeCommitmentHash = {0};
/** /**
* Function called by libgcrypt on serious errors. * Function called by libgcrypt on serious errors.
* Prints an error message and aborts the process. * Prints an error message and aborts the process.