diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/denom.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/util/denom.c b/src/util/denom.c index 407ade384..a7f5f5641 100644 --- a/src/util/denom.c +++ b/src/util/denom.c @@ -242,4 +242,23 @@ TALER_denom_pub_cmp (const struct TALER_DenominationPublicKey *denom1, } +int +TALER_denom_sig_cmp (const struct TALER_DenominationSignature *sig1, + const struct TALER_DenominationSignature *sig2) +{ + if (sig1->cipher != sig2->cipher) + return (sig1->cipher > sig2->cipher) ? 1 : -1; + switch (sig1->cipher) + { + case TALER_SIGINATION_RSA: + return GNUNET_CRYPTO_rsa_signature_cmp (sig1->details.rsa_signature, + sig2->details.rsa_signature); + // TODO: add case for Clause-Schnorr + default: + GNUNET_assert (0); + } + return -2; +} + + /* end of denom.c */ |