aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_crypto.c
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/util/test_crypto.c
parent385eb51e93e39842c0ccb2a6b12b87c66c7fbe26 (diff)
downloadexchange-a02ab8f81b68b59ef5228ce30583d9388f9bab4a.tar.xz
added CS get R functionality and planchet setup
Diffstat (limited to 'src/util/test_crypto.c')
-rw-r--r--src/util/test_crypto.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/util/test_crypto.c b/src/util/test_crypto.c
index a91536bf7..2fe70cda1 100644
--- a/src/util/test_crypto.c
+++ b/src/util/test_crypto.c
@@ -147,6 +147,8 @@ test_planchets_cs (void)
struct TALER_PlanchetDetail pd;
struct TALER_CoinPubHash c_hash;
struct TALER_WithdrawNonce nonce;
+ struct TALER_DenominationCsPublicR r_pub;
+ // struct TALER_DenominationCsPrivateR priv_r;
// struct TALER_BlindedDenominationSignature blind_sig;
// struct TALER_FreshCoin coin;
// struct TALER_PlanchetDeriveCsBlindingSecrets seed;
@@ -156,14 +158,18 @@ test_planchets_cs (void)
&dk_pub,
TALER_DENOMINATION_CS));
- // seed.secret = "test secret";
- // seed.secret_len = strlen ("test secret");
-
TALER_planchet_setup_random (&ps, TALER_DENOMINATION_CS);
TALER_cs_withdraw_nonce_derive (&ps.coin_priv, &nonce);
-
- // NEXT: Implement to create withdraw nonce
- // Implement to get R_0 and R_1
+ GNUNET_assert (GNUNET_OK ==
+ TALER_denom_cs_derive_r_public (&nonce,
+ &dk_priv,
+ &r_pub));
+ TALER_blinding_secret_create (&ps.blinding_key,
+ TALER_DENOMINATION_CS,
+ &ps.coin_priv,
+ &r_pub);
+
+ // NEXT:
// Implement to genrate b-seed from it and calculate c thenĀ§
// GNUNET_assert (GNUNET_OK ==