summaryrefslogtreecommitdiff
path: root/src/include/taler_crypto_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-04-20 23:07:44 +0200
committerChristian Grothoff <christian@grothoff.org>2022-04-20 23:07:44 +0200
commit4af1772f1205de93cbf04e20c6dd2d309c7fe0df (patch)
treefba6c064005b258f80515d3e12b866895126448b /src/include/taler_crypto_lib.h
parent1e0789eda3f10aeb7457e574fe7a5cea7f9a7de6 (diff)
downloadexchange-4af1772f1205de93cbf04e20c6dd2d309c7fe0df.tar.gz
exchange-4af1772f1205de93cbf04e20c6dd2d309c7fe0df.tar.bz2
exchange-4af1772f1205de93cbf04e20c6dd2d309c7fe0df.zip
-work on create purse with merge
Diffstat (limited to 'src/include/taler_crypto_lib.h')
-rw-r--r--src/include/taler_crypto_lib.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 554cb1a26..71ad07712 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -2207,7 +2207,7 @@ TALER_CRYPTO_contract_encrypt_for_merge (
/**
- * Encrypt contract for the party that will
+ * Decrypt contract for the party that will
* merge it into a reserve.
*
* @param purse_pub public key of the purse
@@ -2226,6 +2226,40 @@ TALER_CRYPTO_contract_decrypt_for_merge (
struct TALER_PurseMergePrivateKeyP *merge_priv);
+/**
+ * Encrypt contract for transmission to a party that will
+ * pay for it.
+ *
+ * @param purse_pub public key of the purse
+ * @param contract_priv private key of the contract
+ * @param contract_terms contract terms to encrypt
+ * @param[out] econtract set to encrypted contract
+ * @param[out] econtract_size set to number of bytes in @a econtract
+ */
+void
+TALER_CRYPTO_contract_encrypt_for_deposit (
+ const struct TALER_PurseContractPublicKeyP *purse_pub,
+ const struct TALER_ContractDiffiePrivateP *contract_priv,
+ const json_t *contract_terms,
+ void **econtract,
+ size_t *econtract_size);
+
+
+/**
+ * Decrypt contract for the party that will pay for it.
+ *
+ * @param contract_priv private key of the contract
+ * @param econtract encrypted contract
+ * @param econtract_size number of bytes in @a econtract
+ * @return decrypted contract terms, or NULL on failure
+ */
+json_t *
+TALER_CRYPTO_contract_decrypt_for_deposit (
+ const struct TALER_ContractDiffiePrivateP *contract_priv,
+ const void *econtract,
+ size_t econtract_size);
+
+
/* **************** Helper-based RSA operations **************** */
/**