Skip to content

Commit

Permalink
frost-client: check if number of randomizers match number of messages
Browse files Browse the repository at this point in the history
  • Loading branch information
conradoplg committed Feb 20, 2025
1 parent df39100 commit b8da551
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions coordinator/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ pub async fn cli_for_processed_args<C: RandomizedCiphersuite + 'static>(
Box::new(SocketComms::new(&pargs))
};

if !pargs.randomizers.is_empty() && pargs.randomizers.len() != pargs.messages.len() {
return Err("Number of randomizers must match number of messages".into());
}

let participants_config = step_1(&pargs, &mut *comms, reader, logger).await?;

let signing_package = step_2(&pargs, logger, participants_config.commitments.clone())?;
Expand Down
8 changes: 4 additions & 4 deletions frost-client/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ pub(crate) enum Command {
#[arg(short = 'm', long)]
message: Vec<String>,
/// The randomizers to use. Each instance can be a file with the raw
/// randomizer, "" or "-". If "" or "-" is specified, then it will be read
/// from standard input as a hex string. If none are passed, random ones
/// will be generated. If one or more are passed, the number should match
/// the `message` parameter.
/// randomizer, "" or "-". If "" or "-" is specified, then it will be
/// read from standard input as a hex string. If none are passed, random
/// ones will be generated if the ciphersuite is redpallas. If one or
/// more are passed, the number should match the `message` parameter.
#[arg(short = 'r', long)]
randomizer: Vec<String>,
/// Where to write the generated raw bytes signature. If "-", the
Expand Down

0 comments on commit b8da551

Please sign in to comment.