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
/// for performing verifiable secret sharing for a Shamir secret share.
#[derive(Clone)]
struct Commitment(jubjub::ExtendedPoint);
struct Commitment(jubjub::AffinePoint);
/// Contains the commitments to the coefficients for our secret polynomial _f_,
/// 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
// with every other participant's.
commitment
.0
.push(Commitment(SpendAuth::basepoint() * secret.0));
commitment.0.push(Commitment(jubjub::AffinePoint::from(
SpendAuth::basepoint() * secret.0,
)));
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