summaryrefslogtreecommitdiff
path: root/src/include/taler_crypto_lib.h
diff options
context:
space:
mode:
authorGian Demarmels <gian@demarmels.org>2021-12-22 12:52:54 +0100
committerGian Demarmels <gian@demarmels.org>2022-02-04 15:31:48 +0100
commita02ab8f81b68b59ef5228ce30583d9388f9bab4a (patch)
treeb292b8bb43e478d045c74b3892b1f40164f92855 /src/include/taler_crypto_lib.h
parent385eb51e93e39842c0ccb2a6b12b87c66c7fbe26 (diff)
downloadexchange-a02ab8f81b68b59ef5228ce30583d9388f9bab4a.tar.gz
exchange-a02ab8f81b68b59ef5228ce30583d9388f9bab4a.tar.bz2
exchange-a02ab8f81b68b59ef5228ce30583d9388f9bab4a.zip
added CS get R functionality and planchet setup
Diffstat (limited to 'src/include/taler_crypto_lib.h')
-rw-r--r--src/include/taler_crypto_lib.h75
1 files changed, 53 insertions, 22 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 8e5df1fca..542146cc0 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -794,6 +794,9 @@ struct TALER_BlindedPlanchet
} details;
};
+/**
+ * Withdraw nonce for CS denominations
+ */
struct TALER_WithdrawNonce
{
/**
@@ -802,6 +805,9 @@ struct TALER_WithdrawNonce
struct GNUNET_CRYPTO_CsNonce nonce;
};
+/**
+ * Withdraw nonce for CS denominations
+ */
struct TALER_RefreshNonce
{
/**
@@ -811,6 +817,23 @@ struct TALER_RefreshNonce
};
/**
+ * Public R for Cs denominations
+ */
+struct TALER_DenominationCsPublicR
+{
+ struct GNUNET_CRYPTO_CsRPublic r_pub[2];
+};
+
+/**
+ * Secret r for Cs denominations
+ */
+
+struct TALER_DenominationCsPrivateR
+{
+ struct GNUNET_CRYPTO_CsRSecret r[2];
+};
+
+/**
* @brief RSA Parameters to create blinded messages
*
*/
@@ -863,28 +886,6 @@ struct TALER_DenominationBlindMessageParams
};
/**
- * @brief CS Blinding Secret parameters to derive blinding secrets
- *
- */
-struct TALER_PlanchetDeriveCsBlindingSecrets
-{
- /**
- * Secret to derive blinding secrets from
- */
- void *secret;
-
- /**
- * size of the secret to derive blinding secrets from
- */
- size_t secret_len;
-
- /**
- * public R_0 and R_1 are hashed too
- */
- struct GNUNET_CRYPTO_CsRPublic r_pub[2];
-};
-
-/**
* @brief Public information about a coin (including the public key
* of the coin, the denomination key and the signature with
* the denomination key).
@@ -1013,6 +1014,36 @@ TALER_denom_sig_free (struct TALER_DenominationSignature *denom_sig);
/**
+ * Function for CS signatures to derive the secret r_0 and r_1
+ *
+ * @param nonce withdraw nonce from a client
+ * @param denom_priv denomination privkey as long-term secret
+ * @param r the resulting r_0 and r_1
+ * @return enum GNUNET_GenericReturnValue, returns SYSERR when denom key has wrong type
+ */
+enum GNUNET_GenericReturnValue
+TALER_denom_cs_derive_r_secret (const struct TALER_WithdrawNonce *nonce,
+ const struct
+ TALER_DenominationPrivateKey *denom_priv,
+ struct TALER_DenominationCsPrivateR *r);
+
+/**
+ * @brief Function for CS signatures to derive public R_0 and R_1
+ *
+ * @param nonce withdraw nonce from a client
+ * @param denom_priv denomination privkey as long-term secret
+ * @param r_pub the resulting R_0 and R_1
+ * @return enum GNUNET_GenericReturnValue
+ */
+
+enum GNUNET_GenericReturnValue
+TALER_denom_cs_derive_r_public (const struct TALER_WithdrawNonce *nonce,
+ const struct
+ TALER_DenominationPrivateKey *denom_priv,
+ struct TALER_DenominationCsPublicR *r_pub);
+
+
+/**
* Blind coin for blind signing with @a dk using blinding secret @a coin_bks.
*
* @param dk denomination public key to blind for