|
2 | 2 | #![allow(non_snake_case)]
|
3 | 3 | #![deny(missing_docs)]
|
4 | 4 |
|
| 5 | +use std::collections::HashMap; |
| 6 | + |
5 | 7 | use group::GroupEncoding;
|
6 | 8 | #[cfg(feature = "alloc")]
|
7 | 9 | use group::{ff::Field as FFField, ff::PrimeField, Group as FFGroup};
|
@@ -117,6 +119,8 @@ impl Group for PallasGroup {
|
117 | 119 | pub struct PallasBlake2b512;
|
118 | 120 |
|
119 | 121 | impl Ciphersuite for PallasBlake2b512 {
|
| 122 | + const ID: &'static str = "FROST(Pallas, BLAKE2b-512)"; |
| 123 | + |
120 | 124 | type Group = PallasGroup;
|
121 | 125 |
|
122 | 126 | type HashOutput = [u8; 64];
|
@@ -182,14 +186,18 @@ pub mod keys {
|
182 | 186 |
|
183 | 187 | use super::*;
|
184 | 188 |
|
| 189 | + /// The identifier list to use when generating key shares. |
| 190 | + pub type IdentifierList<'a> = frost::keys::IdentifierList<'a, P>; |
| 191 | + |
185 | 192 | /// Allows all participants' keys to be generated using a central, trusted
|
186 | 193 | /// dealer.
|
187 |
| - pub fn keygen_with_dealer<RNG: RngCore + CryptoRng>( |
| 194 | + pub fn generate_with_dealer<RNG: RngCore + CryptoRng>( |
188 | 195 | max_signers: u16,
|
189 | 196 | min_signers: u16,
|
| 197 | + identifiers: IdentifierList, |
190 | 198 | mut rng: RNG,
|
191 | 199 | ) -> Result<(HashMap<Identifier, SecretShare>, PublicKeyPackage), Error> {
|
192 |
| - frost::keys::keygen_with_dealer(max_signers, min_signers, &mut rng) |
| 200 | + frost::keys::generate_with_dealer(max_signers, min_signers, identifiers, &mut rng) |
193 | 201 | }
|
194 | 202 |
|
195 | 203 | /// Secret and public key material generated by a dealer performing
|
@@ -239,14 +247,13 @@ pub mod round1 {
|
239 | 247 | /// Generates the signing nonces and commitments to be used in the signing
|
240 | 248 | /// operation.
|
241 | 249 | pub fn commit<RNG>(
|
242 |
| - participant_identifier: frost::Identifier<P>, |
243 | 250 | secret: &SigningShare<P>,
|
244 | 251 | rng: &mut RNG,
|
245 | 252 | ) -> (SigningNonces, SigningCommitments)
|
246 | 253 | where
|
247 | 254 | RNG: CryptoRng + RngCore,
|
248 | 255 | {
|
249 |
| - frost::round1::commit::<P, RNG>(participant_identifier, secret, rng) |
| 256 | + frost::round1::commit::<P, RNG>(secret, rng) |
250 | 257 | }
|
251 | 258 | }
|
252 | 259 |
|
@@ -309,7 +316,7 @@ pub type Signature = frost_rerandomized::frost_core::Signature<P>;
|
309 | 316 | /// service attack due to publishing an invalid signature.
|
310 | 317 | pub fn aggregate(
|
311 | 318 | signing_package: &round2::SigningPackage,
|
312 |
| - signature_shares: &[round2::SignatureShare], |
| 319 | + signature_shares: &HashMap<Identifier, round2::SignatureShare>, |
313 | 320 | pubkeys: &keys::PublicKeyPackage,
|
314 | 321 | randomized_params: &RandomizedParams<P>,
|
315 | 322 | ) -> Result<Signature, Error> {
|
|
0 commit comments