diff options
author | Markus Teich <markus.teich@stusta.mhn.de> | 2016-06-22 02:05:00 +0200 |
---|---|---|
committer | Markus Teich <markus.teich@stusta.mhn.de> | 2016-06-22 02:05:00 +0200 |
commit | 965b4da7794b3fd0812907559c9434f98f4819fc (patch) | |
tree | 838c4ef500976af4ba636d04a246d4034a670819 /crypto.c | |
parent | 8d717c4b3d126104929aeb5e3a2176dd534e25ea (diff) | |
download | libbrandt-965b4da7794b3fd0812907559c9434f98f4819fc.tar.gz libbrandt-965b4da7794b3fd0812907559c9434f98f4819fc.zip |
smc_zkp_dl: make v an output parameter
Diffstat (limited to 'crypto.c')
-rw-r--r-- | crypto.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -616,15 +616,15 @@ smc_compute_outcome (struct AuctionData *ad) | |||
616 | * smc_zkp_dl creates a proof of knowledge of @a x with \f$v = xg\f$ where | 616 | * smc_zkp_dl creates a proof of knowledge of @a x with \f$v = xg\f$ where |
617 | * \f$g\f$ is the base point on Ed25519. | 617 | * \f$g\f$ is the base point on Ed25519. |
618 | * | 618 | * |
619 | * @param[in] v input point. Must be known to the verifier. | 619 | * @param[out] v output point. Must be known to the verifier. |
620 | * @param[in] x private key. Knowledge of this number is certified in the proof | 620 | * @param[in] x private key. Knowledge of this number is certified in the proof |
621 | * @param[out] proof pointer where to save the output proof structure. Must be | 621 | * @param[out] proof pointer where to save the output proof structure. Must be |
622 | * shared with the verifier. | 622 | * shared with the verifier. |
623 | */ | 623 | */ |
624 | void | 624 | void |
625 | smc_zkp_dl (const gcry_mpi_point_t v, | 625 | smc_zkp_dl (gcry_mpi_point_t v, |
626 | const gcry_mpi_t x, | 626 | const gcry_mpi_t x, |
627 | struct proof_dl *proof) | 627 | struct proof_dl *proof) |
628 | { | 628 | { |
629 | struct zkp_challenge_dl challenge; | 629 | struct zkp_challenge_dl challenge; |
630 | struct brandt_hash_code challhash; | 630 | struct brandt_hash_code challhash; |
@@ -633,6 +633,9 @@ smc_zkp_dl (const gcry_mpi_point_t v, | |||
633 | gcry_mpi_t c = gcry_mpi_new (0); | 633 | gcry_mpi_t c = gcry_mpi_new (0); |
634 | gcry_mpi_t z = gcry_mpi_new (0); | 634 | gcry_mpi_t z = gcry_mpi_new (0); |
635 | 635 | ||
636 | /* v = xg */ | ||
637 | gcry_mpi_ec_mul (v, x, ec_gen, ec_ctx); | ||
638 | |||
636 | /* a = zg */ | 639 | /* a = zg */ |
637 | ec_keypair_create (a, z); | 640 | ec_keypair_create (a, z); |
638 | 641 | ||