Skip to content

Commit 80c32be

Browse files
author
Hugh Cunningham
committed
return raw frost public key package from round3
avoid unnecessarily constructing ironfish public key package on the ledger device
1 parent 17b678d commit 80c32be

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/dkg/round3.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -236,19 +236,14 @@ pub fn round3_min(
236236
round1_frost_packages: Vec<&[u8]>,
237237
round2_frost_packages: Vec<&[u8]>,
238238
gsk_bytes: Vec<&[u8]>,
239-
min_signers: u16,
240-
) -> Result<(KeyPackage, PublicKeyPackage, GroupSecretKey), IronfishFrostError> {
239+
) -> Result<(KeyPackage, FrostPublicKeyPackage, GroupSecretKey), IronfishFrostError> {
241240
let round2_secret_package = import_secret_package(round2_secret_package, secret)?;
242241

243-
let mut identities: Vec<Identity> = Vec::with_capacity(participants.len() + 1);
244-
identities.push(secret.to_identity());
245-
246242
let mut round1_packages = BTreeMap::new();
247243
let mut round2_packages = BTreeMap::new();
248244

249245
for i in 0..participants.len() {
250246
let identity = Identity::deserialize_from(participants[i])?;
251-
identities.push(identity.clone());
252247

253248
let identifier = identity.to_frost_identifier();
254249

@@ -262,9 +257,6 @@ pub fn round3_min(
262257
let (key_package, public_key_package) =
263258
part3(&round2_secret_package, &round1_packages, &round2_packages)?;
264259

265-
let public_key_package =
266-
PublicKeyPackage::from_frost(public_key_package, identities, min_signers);
267-
268260
let mut gsk_shards: Vec<GroupSecretKeyShard> = Vec::with_capacity(participants.len() + 1);
269261
for g in gsk_bytes {
270262
gsk_shards.push(GroupSecretKeyShard::import(secret, g)?);
@@ -602,7 +594,6 @@ mod tests {
602594
round1_frost_packages,
603595
round2_frost_packages,
604596
gsk_bytes,
605-
2,
606597
)
607598
.expect("round 3 failed");
608599
}

0 commit comments

Comments
 (0)