Skip to main content

sign_batch

Function sign_batch 

Source
pub fn sign_batch(
    share_blobs: &[Vec<u8>],
    threshold: u32,
    messages: &[&[u8]],
) -> Result<Vec<Vec<u8>>>
Expand description

Sign messages.len() messages against the same joint key without re-running DKG. Reuses the same share_blobs for every message.

Returns one 64-byte signature per input message in input order. If any individual signing op fails (e.g. protocol-level fault), the function returns the error and discards prior results.

§Performance

Each message signing is a full 4-round CMP20 protocol run. This function does NOT cache nonces across messages — doing so would leak the joint secret. The win over calling sign in a loop is that the per-call Ruby/Python binding overhead disappears, which is significant for high-volume signers (10-100× speedup for small messages where binding overhead dominates).