summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-11-14 06:19:35 +0100
committerChristian Grothoff <christian@grothoff.org>2022-11-14 06:19:35 +0100
commit8bfc6583e799d8f7d0e55262b593183daed7f4fe (patch)
tree40226cdf86d5ceee7978c846250555d6eaa7b327 /src/include
parent053faa252c2afed8ecbb65bdd6fe8ec6f9ad9ef9 (diff)
downloadexchange-8bfc6583e799d8f7d0e55262b593183daed7f4fe.tar.gz
exchange-8bfc6583e799d8f7d0e55262b593183daed7f4fe.tar.bz2
exchange-8bfc6583e799d8f7d0e55262b593183daed7f4fe.zip
more refactoring towards #7272
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_crypto_lib.h110
1 files changed, 13 insertions, 97 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 30a652682..9b658d741 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -2494,57 +2494,15 @@ struct TALER_CRYPTO_CsSignRequest
*
* @param dh helper process connection
* @param req information about the key to sign with and the value to sign
+ * @param for_melt true if for melt operation
* @param[out] bs set to the blind signature
* @return #TALER_EC_NONE on success
*/
enum TALER_ErrorCode
-TALER_CRYPTO_helper_cs_sign_melt (
- struct TALER_CRYPTO_CsDenominationHelper *dh,
- const struct TALER_CRYPTO_CsSignRequest *req,
- struct TALER_BlindedDenominationSignature *bs);
-
-
-/**
- * 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
- * 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 req information about the key to sign with and the value to sign
- * @param[out] bs set to the blind signature
- * @return #TALER_EC_NONE on success
- */
-enum TALER_ErrorCode
-TALER_CRYPTO_helper_cs_sign_withdraw (
+TALER_CRYPTO_helper_cs_sign (
struct TALER_CRYPTO_CsDenominationHelper *dh,
const struct TALER_CRYPTO_CsSignRequest *req,
+ bool for_melt,
struct TALER_BlindedDenominationSignature *bs);
@@ -2560,14 +2518,16 @@ TALER_CRYPTO_helper_cs_sign_withdraw (
* @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 for_melt true if this is for a melt operation
* @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 (
+TALER_CRYPTO_helper_cs_batch_sign (
struct TALER_CRYPTO_CsDenominationHelper *dh,
const struct TALER_CRYPTO_CsSignRequest *reqs,
unsigned int reqs_length,
+ bool for_melt,
struct TALER_BlindedDenominationSignature *bss);
@@ -2621,20 +2581,20 @@ struct TALER_CRYPTO_CsDeriveRequest
*
* @param dh helper to process connection
* @param cdr derivation input data
- * @param nonce witdhraw nonce
+ * @param for_melt true if this is for a melt operation
* @param[out] crp set to the pair of R values
* @return set to the error code (or #TALER_EC_NONE on success)
*/
enum TALER_ErrorCode
-TALER_CRYPTO_helper_cs_r_derive_withdraw (
+TALER_CRYPTO_helper_cs_r_derive (
struct TALER_CRYPTO_CsDenominationHelper *dh,
const struct TALER_CRYPTO_CsDeriveRequest *cdr,
+ bool for_melt,
struct TALER_DenominationCSPublicRPairP *crp);
/**
- * Ask the helper to derive R using the information
- * from @a cdrs.
+ * Ask the helper to derive R using the information from @a cdrs.
*
* This operation will block until the R has been obtained. Should
* this process receive a signal (that is not ignored) while the operation is
@@ -2645,60 +2605,16 @@ TALER_CRYPTO_helper_cs_r_derive_withdraw (
* @param dh helper to process connection
* @param cdrs array with derivation input data
* @param cdrs_length length of the @a cdrs array
+ * @param for_melt true if this is for a melt operation
* @param[out] crp array set to the pair of R values, must be of length @a cdrs_length
* @return set to the error code (or #TALER_EC_NONE on success)
*/
enum TALER_ErrorCode
-TALER_CRYPTO_helper_cs_r_batch_derive_withdraw (
- struct TALER_CRYPTO_CsDenominationHelper *dh,
- const struct TALER_CRYPTO_CsDeriveRequest *cdrs,
- unsigned int cdrs_length,
- struct TALER_DenominationCSPublicRPairP *crps);
-
-
-/**
- * Ask the helper to derive R using the information
- * from @a cdr.
- *
- * This operation will block until the R 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 to process connection
- * @param cdr derivation input data
- * @param[out] crp set to the pair of R values
- * @return set to the error code (or #TALER_EC_NONE on success)
- */
-enum TALER_ErrorCode
-TALER_CRYPTO_helper_cs_r_derive_melt (
- struct TALER_CRYPTO_CsDenominationHelper *dh,
- const struct TALER_CRYPTO_CsDeriveRequest *cdr,
- struct TALER_DenominationCSPublicRPairP *crp);
-
-
-/**
- * Ask the helper to derive R using the information
- * from @a cdrs.
- *
- * This operation will block until the R 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 to process connection
- * @param cdrs array with derivation input data
- * @param cdrs_length length of the @a cdrs array
- * @param[out] crps array set to the pair of R values, must be of length @a cdrs_length
- * @return set to the error code (or #TALER_EC_NONE on success)
- */
-enum TALER_ErrorCode
-TALER_CRYPTO_helper_cs_r_batch_derive_melt (
+TALER_CRYPTO_helper_cs_r_batch_derive (
struct TALER_CRYPTO_CsDenominationHelper *dh,
const struct TALER_CRYPTO_CsDeriveRequest *cdrs,
unsigned int cdrs_length,
+ bool for_melt,
struct TALER_DenominationCSPublicRPairP *crps);