change Commitment to use AffinePoint

This commit is contained in:
Alfredo Garcia 2021-05-21 19:29:57 -03:00 committed by Deirdre Connolly
parent b6a27d3747
commit 2db8e5908d
1 changed files with 7 additions and 5 deletions

View File

@ -73,7 +73,7 @@ pub struct Share {
/// This is a (public) commitment to one coefficient of a secret polynomial used /// This is a (public) commitment to one coefficient of a secret polynomial used
/// for performing verifiable secret sharing for a Shamir secret share. /// for performing verifiable secret sharing for a Shamir secret share.
#[derive(Clone)] #[derive(Clone)]
struct Commitment(jubjub::ExtendedPoint); struct Commitment(jubjub::AffinePoint);
/// Contains the commitments to the coefficients for our secret polynomial _f_, /// Contains the commitments to the coefficients for our secret polynomial _f_,
/// used to generate participants' key shares. /// used to generate participants' key shares.
@ -276,12 +276,14 @@ fn generate_shares<R: RngCore + CryptoRng>(
// Verifiable secret sharing, to make sure that participants can ensure their secret is consistent // Verifiable secret sharing, to make sure that participants can ensure their secret is consistent
// with every other participant's. // with every other participant's.
commitment commitment.0.push(Commitment(jubjub::AffinePoint::from(
.0 SpendAuth::basepoint() * secret.0,
.push(Commitment(SpendAuth::basepoint() * secret.0)); )));
for c in &coefficients { for c in &coefficients {
commitment.0.push(Commitment(SpendAuth::basepoint() * c)); commitment.0.push(Commitment(jubjub::AffinePoint::from(
SpendAuth::basepoint() * c,
)));
} }
// Evaluate the polynomial with `secret` as the constant term // Evaluate the polynomial with `secret` as the constant term