Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Commitment and GroupCommitment to use AffinePoint #106

Merged
merged 2 commits into from
May 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/frost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -92,7 +92,7 @@ pub struct ShareCommitment(Vec<Commitment>);

/// The product of all signers' individual commitments, published as part of the
/// final signature.
pub struct GroupCommitment(jubjub::ExtendedPoint);
pub struct GroupCommitment(jubjub::AffinePoint);

/// Secret and public key material generated by a dealer performing
/// [`keygen_with_dealer`].
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -501,7 +503,7 @@ fn gen_group_commitment(
accumulator += commitment.hiding + (commitment.binding * rho_i)
}

Ok(GroupCommitment(accumulator))
Ok(GroupCommitment(jubjub::AffinePoint::from(accumulator)))
}

/// Generates the challenge as is required for Schnorr signatures.
Expand Down