Skip to content

Commit 916db28

Browse files
committed
converted round 3 to use more errors
1 parent af3ac2e commit 916db28

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/dkg/round3.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,11 @@ where
210210
}
211211

212212
// Sanity check
213-
assert_eq!(round1_public_packages.len(), round1_frost_packages.len());
213+
if round1_public_packages.len() != round1_frost_packages.len() {
214+
return Err(IronfishFrostError::InvalidInput(
215+
"incorrect number of round 1 packages provided".to_string(),
216+
));
217+
}
214218

215219
// The public package for `identity` must be excluded from `frost::keys::dkg::part3`
216220
// inputs
@@ -264,7 +268,11 @@ where
264268
}
265269
}
266270

267-
assert_eq!(round2_public_packages.len(), round2_frost_packages.len());
271+
if round2_public_packages.len() != round2_frost_packages.len() {
272+
return Err(IronfishFrostError::InvalidInput(
273+
"incorrect number of round 2 packages provided".to_string(),
274+
));
275+
}
268276

269277
let (key_package, public_key_package) = part3(
270278
&round2_secret_package,

0 commit comments

Comments
 (0)