diff options
author | Florian Dold <florian@dold.me> | 2020-12-04 12:09:27 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2020-12-04 12:10:09 +0100 |
commit | d3b714922f2fecfeda09a9331a48ba58ab42857a (patch) | |
tree | 1db8e901a5e34b3b3dde12655b3dd023f2cb5e65 /src/include/taler_crypto_lib.h | |
parent | 86dd5d46dd0afc50e16515f968997865c62b0482 (diff) | |
download | exchange-d3b714922f2fecfeda09a9331a48ba58ab42857a.tar.xz |
conditionally use (un)blinding implementation from libgnunetutil
Diffstat (limited to 'src/include/taler_crypto_lib.h')
-rw-r--r-- | src/include/taler_crypto_lib.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index ae7385058..5e50ddd3f 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -1142,4 +1142,37 @@ TALER_merchant_wire_signature_make ( struct TALER_MerchantSignatureP *merch_sig); +/** + * Blinds the given message with the given blinding key + * + * @param hash hash of the message to sign + * @param bkey the blinding key + * @param pkey the public key of the signer + * @param[out] buf set to a buffer with the blinded message to be signed + * @param[out] buf_size number of bytes stored in @a buf + * @return #GNUNET_YES if successful, #GNUNET_NO if RSA key is malicious + */ +int +TALER_rsa_blind (const struct GNUNET_HashCode *hash, + const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks, + struct GNUNET_CRYPTO_RsaPublicKey *pkey, + void **buf, + size_t *buf_size); + + +/** + * Unblind a blind-signed signature. The signature should have been generated + * with #GNUNET_CRYPTO_rsa_sign() using a hash that was blinded with + * #GNUNET_CRYPTO_rsa_blind(). + * + * @param sig the signature made on the blinded signature purpose + * @param bks the blinding key secret used to blind the signature purpose + * @param pkey the public key of the signer + * @return unblinded signature on success, NULL if RSA key is bad or malicious. + */ +struct GNUNET_CRYPTO_RsaSignature * +TALER_rsa_unblind (const struct GNUNET_CRYPTO_RsaSignature *sig, + const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks, + struct GNUNET_CRYPTO_RsaPublicKey *pkey); + #endif |