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

update frost-rerandomized with new Randomizer generation #189

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
14 changes: 6 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ pasta_curves = { version = "0.5", default-features = false }
rand_core = { version = "0.6", default-features = false }
serde = { version = "1", optional = true, features = ["derive"] }
thiserror = { version = "1.0", optional = true }
frost-rerandomized = { version = "2.0.0-rc.0", optional = true, default-features = false, features = ["serialization", "cheater-detection"] }
# frost-rerandomized = { version = "2.0.0", optional = true, default-features = false, features = ["serialization", "cheater-detection"] }
frost-rerandomized = { git = "https://github.com/ZcashFoundation/frost.git", rev = "ab8e2ef2f986480f079393729fb631ad44151aea", optional = true, default-features = false, features = ["serialization", "cheater-detection"] }

[dependencies.zeroize]
version = "1"
Expand All @@ -50,7 +51,8 @@ rand_chacha = "0.3"
serde_json = "1.0"
num-bigint = "0.4.6"
num-traits = "0.2.19"
frost-rerandomized = { version = "2.0.0-rc.0", features = ["test-impl"] }
# frost-rerandomized = { version = "2.0.0", features = ["test-impl"] }
frost-rerandomized = { git = "https://github.com/ZcashFoundation/frost.git", rev = "ab8e2ef2f986480f079393729fb631ad44151aea", features = ["test-impl"] }

# `alloc` is only used in test code
[dev-dependencies.pasta_curves]
Expand Down
22 changes: 22 additions & 0 deletions src/frost/redjubjub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,36 @@ pub mod round2 {
///
/// Assumes the participant has already determined which nonce corresponds with
/// the commitment that was assigned by the coordinator in the SigningPackage.
#[deprecated(
note = "switch to sign_with_randomizer_seed(), passing a seed generated with RandomizedParams::new_from_commitments()"
)]
pub fn sign(
signing_package: &SigningPackage,
signer_nonces: &round1::SigningNonces,
key_package: &keys::KeyPackage,
randomizer: Randomizer,
) -> Result<SignatureShare, Error> {
#[allow(deprecated)]
frost_rerandomized::sign(signing_package, signer_nonces, key_package, randomizer)
}

/// Re-randomized FROST signing using the given `randomizer_seed`, which should
/// be sent from the Coordinator using a confidential channel.
///
/// See [`frost::round2::sign`] for documentation on the other parameters.
pub fn sign_with_randomizer_seed<C: RandomizedCiphersuite>(
signing_package: &SigningPackage,
signer_nonces: &round1::SigningNonces,
key_package: &keys::KeyPackage,
randomizer_seed: &[u8],
) -> Result<SignatureShare, Error> {
frost_rerandomized::sign_with_randomizer_seed(
signing_package,
signer_nonces,
key_package,
randomizer_seed,
)
}
}

/// A Schnorr signature on FROST(Jubjub, BLAKE2b-512).
Expand Down
25 changes: 23 additions & 2 deletions src/frost/redpallas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,7 @@ pub mod keys {

/// Convert the given type to make sure the group public key has an even
/// Y coordinate. `is_even` can be specified if evenness was already
/// determined beforehand. Returns a boolean indicating if the original
/// type had an even Y, and a (possibly converted) value with even Y.
/// determined beforehand.
fn into_even_y(self, is_even: Option<bool>) -> Self;
}

Expand Down Expand Up @@ -502,14 +501,36 @@ pub mod round2 {
///
/// Assumes the participant has already determined which nonce corresponds with
/// the commitment that was assigned by the coordinator in the SigningPackage.
#[deprecated(
note = "switch to sign_with_randomizer_seed(), passing a seed generated with RandomizedParams::new_from_commitments()"
)]
pub fn sign(
signing_package: &SigningPackage,
signer_nonces: &round1::SigningNonces,
key_package: &keys::KeyPackage,
randomizer: Randomizer,
) -> Result<SignatureShare, Error> {
#[allow(deprecated)]
frost_rerandomized::sign(signing_package, signer_nonces, key_package, randomizer)
}

/// Re-randomized FROST signing using the given `randomizer_seed`, which should
/// be sent from the Coordinator using a confidential channel.
///
/// See [`frost::round2::sign`] for documentation on the other parameters.
pub fn sign_with_randomizer_seed<C: RandomizedCiphersuite>(
signing_package: &SigningPackage,
signer_nonces: &round1::SigningNonces,
key_package: &keys::KeyPackage,
randomizer_seed: &[u8],
) -> Result<SignatureShare, Error> {
frost_rerandomized::sign_with_randomizer_seed(
signing_package,
signer_nonces,
key_package,
randomizer_seed,
)
}
}

/// A Schnorr signature on FROST(Pallas, BLAKE2b-512).
Expand Down
Loading