From 18aba0abbb427a2e0e76ae88f95fef493e74032d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 13 Nov 2022 19:03:52 +0100 Subject: add batch logic to taler-exchange-secmod-cs --- src/include/taler_crypto_lib.h | 52 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 4 deletions(-) (limited to 'src/include') diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 2f12a47ba..8027181fd 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -2484,8 +2484,7 @@ struct TALER_CRYPTO_CsSignRequest /** - * Request helper @a dh to sign @a msg using the public key corresponding to - * @a h_denom_pub. + * Request helper @a dh to sign @a req. * * This operation will block until the signature has been obtained. Should * this process receive a signal (that is not ignored) while the operation is @@ -2506,8 +2505,30 @@ TALER_CRYPTO_helper_cs_sign_melt ( /** - * Request helper @a dh to sign @a msg using the public key corresponding to - * @a h_denom_pub. + * Request helper @a dh to batch sign batch @a reqs. + * + * This operation will block until the signature has been obtained. Should + * this process receive a signal (that is not ignored) while the operation is + * pending, the operation will fail. Note that the helper may still believe + * that it created the signature. Thus, signals may result in a small + * differences in the signature counters. Retrying in this case may work. + * + * @param dh helper process connection + * @param reqs array with information about the keys to sign with and the values to sign + * @param reqs_length length of the @a reqs array + * @param[out] bss array set to the blind signatures, must be of length @a reqs_length! + * @return #TALER_EC_NONE on success + */ +enum TALER_ErrorCode +TALER_CRYPTO_helper_cs_batch_sign_melt ( + struct TALER_CRYPTO_CsDenominationHelper *dh, + const struct TALER_CRYPTO_CsSignRequest *reqs, + unsigned int reqs_length, + struct TALER_BlindedDenominationSignature *bss); + + +/** + * Request helper @a dh to sign @a req. * * This operation will block until the signature has been obtained. Should * this process receive a signal (that is not ignored) while the operation is @@ -2527,6 +2548,29 @@ TALER_CRYPTO_helper_cs_sign_withdraw ( struct TALER_BlindedDenominationSignature *bs); +/** + * Request helper @a dh to sign batch of @a reqs requests. + * + * This operation will block until the signature has been obtained. Should + * this process receive a signal (that is not ignored) while the operation is + * pending, the operation will fail. Note that the helper may still believe + * that it created the signature. Thus, signals may result in a small + * differences in the signature counters. Retrying in this case may work. + * + * @param dh helper process connection + * @param reqs information about the keys to sign with and the values to sign + * @param reqs_length length of the @a reqs array + * @param[out] bs array set to the blind signatures, must be of length @a reqs_length! + * @return #TALER_EC_NONE on success + */ +enum TALER_ErrorCode +TALER_CRYPTO_helper_cs_batch_sign_withdraw ( + struct TALER_CRYPTO_CsDenominationHelper *dh, + const struct TALER_CRYPTO_CsSignRequest *reqs, + unsigned int reqs_length, + struct TALER_BlindedDenominationSignature *bss); + + /** * Ask the helper to revoke the public key associated with @a h_cs. * Will cause the helper to tell all clients that the key is now unavailable, -- cgit v1.2.3