Skip to content

Commit 5350459

Browse files
committed
update frost-rerandomized with new Randomizer generation
1 parent ed49e9c commit 5350459

File tree

4 files changed

+55
-12
lines changed

4 files changed

+55
-12
lines changed

Cargo.lock

Lines changed: 6 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ pasta_curves = { version = "0.5", default-features = false }
3131
rand_core = { version = "0.6", default-features = false }
3232
serde = { version = "1", optional = true, features = ["derive"] }
3333
thiserror = { version = "1.0", optional = true }
34-
frost-rerandomized = { version = "2.0.0-rc.0", optional = true, default-features = false, features = ["serialization", "cheater-detection"] }
34+
# frost-rerandomized = { version = "2.0.0", optional = true, default-features = false, features = ["serialization", "cheater-detection"] }
35+
frost-rerandomized = { git = "https://github.com/ZcashFoundation/frost.git", rev = "a99ec6093368b39b25de3dfe0ac772777b2c51a4", optional = true, default-features = false, features = ["serialization", "cheater-detection"] }
3536

3637
[dependencies.zeroize]
3738
version = "1"
@@ -50,7 +51,8 @@ rand_chacha = "0.3"
5051
serde_json = "1.0"
5152
num-bigint = "0.4.6"
5253
num-traits = "0.2.19"
53-
frost-rerandomized = { version = "2.0.0-rc.0", features = ["test-impl"] }
54+
# frost-rerandomized = { version = "2.0.0", features = ["test-impl"] }
55+
frost-rerandomized = { git = "https://github.com/ZcashFoundation/frost.git", rev = "a99ec6093368b39b25de3dfe0ac772777b2c51a4", features = ["test-impl"] }
5456

5557
# `alloc` is only used in test code
5658
[dev-dependencies.pasta_curves]

src/frost/redjubjub.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,36 @@ pub mod round2 {
343343
///
344344
/// Assumes the participant has already determined which nonce corresponds with
345345
/// the commitment that was assigned by the coordinator in the SigningPackage.
346+
#[deprecated(
347+
note = "switch to sign_with_randomizer_seed(), passing a seed generated with RandomizedParams::new_from_commitments()"
348+
)]
346349
pub fn sign(
347350
signing_package: &SigningPackage,
348351
signer_nonces: &round1::SigningNonces,
349352
key_package: &keys::KeyPackage,
350353
randomizer: Randomizer,
351354
) -> Result<SignatureShare, Error> {
355+
#[allow(deprecated)]
352356
frost_rerandomized::sign(signing_package, signer_nonces, key_package, randomizer)
353357
}
358+
359+
/// Re-randomized FROST signing using the given `randomizer_seed`, which should
360+
/// be sent from the Coordinator using a confidential channel.
361+
///
362+
/// See [`frost::round2::sign`] for documentation on the other parameters.
363+
pub fn sign_with_randomizer_seed<C: RandomizedCiphersuite>(
364+
signing_package: &SigningPackage,
365+
signer_nonces: &round1::SigningNonces,
366+
key_package: &keys::KeyPackage,
367+
randomizer_seed: &[u8],
368+
) -> Result<SignatureShare, Error> {
369+
frost_rerandomized::sign_with_randomizer_seed(
370+
signing_package,
371+
signer_nonces,
372+
key_package,
373+
randomizer_seed,
374+
)
375+
}
354376
}
355377

356378
/// A Schnorr signature on FROST(Jubjub, BLAKE2b-512).

src/frost/redpallas.rs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,7 @@ pub mod keys {
326326

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

@@ -502,14 +501,36 @@ pub mod round2 {
502501
///
503502
/// Assumes the participant has already determined which nonce corresponds with
504503
/// the commitment that was assigned by the coordinator in the SigningPackage.
504+
#[deprecated(
505+
note = "switch to sign_with_randomizer_seed(), passing a seed generated with RandomizedParams::new_from_commitments()"
506+
)]
505507
pub fn sign(
506508
signing_package: &SigningPackage,
507509
signer_nonces: &round1::SigningNonces,
508510
key_package: &keys::KeyPackage,
509511
randomizer: Randomizer,
510512
) -> Result<SignatureShare, Error> {
513+
#[allow(deprecated)]
511514
frost_rerandomized::sign(signing_package, signer_nonces, key_package, randomizer)
512515
}
516+
517+
/// Re-randomized FROST signing using the given `randomizer_seed`, which should
518+
/// be sent from the Coordinator using a confidential channel.
519+
///
520+
/// See [`frost::round2::sign`] for documentation on the other parameters.
521+
pub fn sign_with_randomizer_seed<C: RandomizedCiphersuite>(
522+
signing_package: &SigningPackage,
523+
signer_nonces: &round1::SigningNonces,
524+
key_package: &keys::KeyPackage,
525+
randomizer_seed: &[u8],
526+
) -> Result<SignatureShare, Error> {
527+
frost_rerandomized::sign_with_randomizer_seed(
528+
signing_package,
529+
signer_nonces,
530+
key_package,
531+
randomizer_seed,
532+
)
533+
}
513534
}
514535

515536
/// A Schnorr signature on FROST(Pallas, BLAKE2b-512).

0 commit comments

Comments
 (0)