summaryrefslogtreecommitdiff
path: root/src/json/json_pack.c
diff options
context:
space:
mode:
authorLucien Heuzeveldt <lucienclaude.heuzeveldt@students.bfh.ch>2022-01-16 17:02:15 +0100
committerGian Demarmels <gian@demarmels.org>2022-02-04 15:37:30 +0100
commit8d85c8b5b6c514ce093d856a2e4b931b4108ece5 (patch)
tree6ab878e42ad4a99337b7d42e7d89f358429165dd /src/json/json_pack.c
parentea97729ba891dc94ed2323aba01b15ca8e6a52d4 (diff)
downloadexchange-8d85c8b5b6c514ce093d856a2e4b931b4108ece5.tar.gz
exchange-8d85c8b5b6c514ce093d856a2e4b931b4108ece5.tar.bz2
exchange-8d85c8b5b6c514ce093d856a2e4b931b4108ece5.zip
implement feedback
Diffstat (limited to 'src/json/json_pack.c')
-rw-r--r--src/json/json_pack.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/json/json_pack.c b/src/json/json_pack.c
index 8b056f34..cf6504c0 100644
--- a/src/json/json_pack.c
+++ b/src/json/json_pack.c
@@ -155,6 +155,47 @@ TALER_JSON_pack_blinded_denom_sig (
struct GNUNET_JSON_PackSpec
+TALER_JSON_pack_blinded_planchet (
+ const char *name,
+ const struct TALER_BlindedPlanchet *blinded_planchet)
+{
+ struct GNUNET_JSON_PackSpec ps = {
+ .field_name = name,
+ };
+
+ switch (blinded_planchet->cipher)
+ {
+ case TALER_DENOMINATION_RSA:
+ ps.object = GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_uint64 ("cipher",
+ TALER_DENOMINATION_RSA),
+ GNUNET_JSON_pack_data_varsize (
+ "rsa_blinded_planchet",
+ blinded_planchet->details.rsa_blinded_planchet.blinded_msg,
+ blinded_planchet->details.rsa_blinded_planchet.blinded_msg_size));
+ break;
+ case TALER_DENOMINATION_CS:
+ ps.object = GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_uint64 ("cipher",
+ TALER_DENOMINATION_CS),
+ GNUNET_JSON_pack_data_auto (
+ "cs_nonce",
+ &blinded_planchet->details.cs_blinded_planchet.nonce),
+ GNUNET_JSON_pack_data_auto (
+ "cs_blinded_c0",
+ &blinded_planchet->details.cs_blinded_planchet.c[0]),
+ GNUNET_JSON_pack_data_auto (
+ "cs_blinded_c1",
+ &blinded_planchet->details.cs_blinded_planchet.c[1]));
+ break;
+ default:
+ GNUNET_assert (0);
+ }
+ return ps;
+}
+
+
+struct GNUNET_JSON_PackSpec
TALER_JSON_pack_amount (const char *name,
const struct TALER_Amount *amount)
{