Skip to content

Commit

Permalink
[in progress] Update Presigning and Signing
Browse files Browse the repository at this point in the history
  • Loading branch information
fjarri committed Jan 11, 2025
1 parent 0f86f18 commit 59c9439
Show file tree
Hide file tree
Showing 4 changed files with 405 additions and 793 deletions.
4 changes: 2 additions & 2 deletions synedrion/src/cggmp21.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ mod key_refresh;
mod params;
mod sigma;

#[cfg(test)]
mod signing_malicious;
//#[cfg(test)]
//mod signing_malicious;

#[cfg(test)]
mod key_init_tests;
Expand Down
37 changes: 1 addition & 36 deletions synedrion/src/cggmp21/entities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ use crate::{
cggmp21::SchemeParams,
curve::{secret_split, Point, Scalar},
paillier::{
Ciphertext, PaillierParams, PublicKeyPaillier, PublicKeyPaillierWire, RPParams, RPParamsWire, Randomizer,
SecretKeyPaillier, SecretKeyPaillierWire,
PublicKeyPaillier, PublicKeyPaillierWire, RPParams, RPParamsWire, SecretKeyPaillier, SecretKeyPaillierWire,
},
tools::Secret,
uint::SecretSigned,
};

/// The result of the KeyInit protocol.
Expand Down Expand Up @@ -86,39 +84,6 @@ pub struct KeyShareChange<P: SchemeParams, I: Ord> {
pub(crate) phantom: PhantomData<P>,
}

/// The result of the Presigning protocol.
#[derive(Debug, Clone)]
pub(crate) struct PresigningData<P: SchemeParams, I> {
pub(crate) nonce: Scalar, // x-coordinate of $R$
/// An additive share of the ephemeral scalar.
pub(crate) ephemeral_scalar_share: Secret<Scalar>, // $k_i$
/// An additive share of `k * x` where `x` is the secret key.
pub(crate) product_share: Secret<Scalar>,

// Values generated during presigning,
// kept in case we need to generate a proof of correctness.
pub(crate) product_share_nonreduced: SecretSigned<<P::Paillier as PaillierParams>::Uint>,

// $K_i$.
pub(crate) cap_k: Ciphertext<P::Paillier>,

// The values for $j$, $j != i$.
pub(crate) values: BTreeMap<I, PresigningValues<P>>,
}

#[derive(Debug, Clone)]
pub(crate) struct PresigningValues<P: SchemeParams> {
pub(crate) hat_beta: SecretSigned<<P::Paillier as PaillierParams>::Uint>,
pub(crate) hat_r: Randomizer<P::Paillier>,
pub(crate) hat_s: Randomizer<P::Paillier>,
pub(crate) cap_k: Ciphertext<P::Paillier>,
/// Received $\hat{D}_{i,j}$.
pub(crate) hat_cap_d_received: Ciphertext<P::Paillier>,
/// Sent $\hat{D}_{j,i}$.
pub(crate) hat_cap_d: Ciphertext<P::Paillier>,
pub(crate) hat_cap_f: Ciphertext<P::Paillier>,
}

impl<P: SchemeParams, I: Clone + Ord + Debug> KeyShare<P, I> {
pub(crate) fn new(
owner: I,
Expand Down
Loading

0 comments on commit 59c9439

Please sign in to comment.