diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-02-07 13:14:25 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-02-07 13:14:25 +0100 |
commit | b2e6fcae1a9b96f086c61f13f4c2c98338c4e414 (patch) | |
tree | 6c5c8c264ca674dd8c0e303daf3207bbaff65315 /src/include | |
parent | b9ea075d61dcd47951b2f7f962025476c045aa57 (diff) | |
download | exchange-b2e6fcae1a9b96f086c61f13f4c2c98338c4e414.tar.xz |
fix DB API for generic blinded planchet storage
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_crypto_lib.h | 58 | ||||
-rw-r--r-- | src/include/taler_exchangedb_plugin.h | 9 | ||||
-rw-r--r-- | src/include/taler_pq_lib.h | 26 |
3 files changed, 62 insertions, 31 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index b3e4ba264..189d4b063 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -461,7 +461,6 @@ struct TALER_RsaPubHashP struct GNUNET_HashCode hash; }; -GNUNET_NETWORK_STRUCT_BEGIN /** * Master key material for the deriviation of @@ -478,29 +477,6 @@ struct TALER_PlanchetSecretsP }; -GNUNET_NETWORK_STRUCT_END - - -/** - * Hash @a rsa. - * - * @param rsa key to hash - * @param[out] h_rsa where to write the result - */ -void -TALER_rsa_pub_hash (const struct GNUNET_CRYPTO_RsaPublicKey *rsa, - struct TALER_RsaPubHashP *h_rsa); - -/** - * Hash @a cs. - * - * @param cs key to hash - * @param[out] h_cs where to write the result - */ -void -TALER_cs_pub_hash (const struct GNUNET_CRYPTO_CsPublicKey *cs, - struct TALER_CsPubHashP *h_cs); - /** * Hash used to represent a denomination public key * and associated age restrictions (if any). @@ -633,6 +609,27 @@ GNUNET_NETWORK_STRUCT_END /** + * Hash @a rsa. + * + * @param rsa key to hash + * @param[out] h_rsa where to write the result + */ +void +TALER_rsa_pub_hash (const struct GNUNET_CRYPTO_RsaPublicKey *rsa, + struct TALER_RsaPubHashP *h_rsa); + +/** + * Hash @a cs. + * + * @param cs key to hash + * @param[out] h_cs where to write the result + */ +void +TALER_cs_pub_hash (const struct GNUNET_CRYPTO_CsPublicKey *cs, + struct TALER_CsPubHashP *h_cs); + + +/** * Types of public keys used for denominations in Taler. */ enum TALER_DenominationCipher @@ -1259,6 +1256,19 @@ TALER_blinded_denom_sig_cmp ( /** + * Compare two blinded planchets. + * + * @param sig1 first blinded planchet + * @param sig2 second blinded planchet + * @return 0 if the keys are equal, otherwise -1 or 1 + */ +int +TALER_blinded_planchet_cmp ( + const struct TALER_BlindedPlanchet *bp1, + const struct TALER_BlindedPlanchet *bp2); + + +/** * Obtain denomination public key from a denomination private key. * * @param denom_priv private key to convert diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 633cf2064..8269672fe 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -1646,14 +1646,9 @@ struct TALER_EXCHANGEDB_RefreshRevealedCoin struct TALER_BlindedDenominationSignature coin_sig; /** - * Blinded message to be signed (in envelope), with @e coin_env_size bytes. + * Blinded message to be signed (in envelope). */ - void *coin_ev; - - /** - * Number of bytes in @e coin_ev. - */ - size_t coin_ev_size; + struct TALER_BlindedPlanchet blinded_planchet; }; diff --git a/src/include/taler_pq_lib.h b/src/include/taler_pq_lib.h index 2189a4f61..fa3128462 100644 --- a/src/include/taler_pq_lib.h +++ b/src/include/taler_pq_lib.h @@ -78,6 +78,19 @@ TALER_PQ_query_param_denom_sig ( /** + * Generate query parameter for a blinded planchet. + * Internally, various attributes of the blinded + * planchet will be serialized into on + * variable-size BLOB. + * + * @param x pointer to the query parameter to pass + */ +struct GNUNET_PQ_QueryParam +TALER_PQ_query_param_blinded_planchet ( + const struct TALER_BlindedPlanchet *bp); + + +/** * Generate query parameter for a blinded denomination signature. Internally, * the various attributes of the signature will be serialized into on * variable-size BLOB. @@ -167,6 +180,19 @@ TALER_PQ_result_spec_blinded_denom_sig ( /** + * Blinded planchet expected. + * + * @param name name of the field in the table + * @param[out] bp where to store the blinded planchet + * @return array entry for the result specification to use + */ +struct GNUNET_PQ_ResultSpec +TALER_PQ_result_spec_blinded_planchet ( + const char *name, + struct TALER_BlindedPlanchet *bp); + + +/** * json_t expected. * * @param name name of the field in the table |