diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_crypto_lib.h | 75 |
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 |