openagent-crypto-wasm · frost
Declared module signatures, types, configuration, and source documentation.
Source: openagent-sdk/crates/openagent-crypto-wasm/src/frost.rs. SHA-256: 9167fd0ac7d830b71fc393a2a12a7cd68ca017d28ed5c0be720f47ebb172e745.
This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.
frost::KeyShareBundle
A complete bundle of FROST key shares produced by [trusted_keygen].
Contains every participant's serialized KeyPackage
and the shared PublicKeyPackage. In
production deployments, the dealer SHOULD distribute exactly one
key_packages[i] entry to participant i and then destroy the bundle.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct KeyShareBundle {
/// Threshold `t` — minimum number of signers required.
pub min_signers: u16,
/// Total participants `n`.
pub max_signers: u16,
/// One serialized `KeyPackage` per participant, in identifier order.
pub key_packages: Vec<Vec<u8>>,
/// Serialized `PublicKeyPackage` shared by every participant.
pub public_key_package: Vec<u8>,
/// Group verifying (public) key, raw 32 bytes.
pub group_public_key: Vec<u8>
}Source line: 47.
frost::Round1Output
Output of [sign_round1] for a single participant.
Contains the participant's nonces (kept secret, used in round 2) and
commitments (sent to the coordinator and broadcast to other signers).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Round1Output {
/// Serialized `SigningNonces` — KEEP SECRET on the participant's machine.
pub nonces: Vec<u8>,
/// Serialized `SigningCommitments` — broadcast to all signers + coordinator.
pub commitments: Vec<u8>
}Source line: 65.
frost::ParticipantCommitments
A pairing of (participant identifier, that participant's serialized commitments).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ParticipantCommitments {
/// 1-based participant identifier (matches the position in `key_packages`).
pub identifier: u16,
/// Serialized `SigningCommitments` from `sign_round1`.
pub commitments: Vec<u8>
}Source line: 74.
frost::ParticipantShare
A pairing of (participant identifier, that participant's signature share).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ParticipantShare {
/// 1-based participant identifier (matches the position in `key_packages`).
pub identifier: u16,
/// Serialized `SignatureShare` from `sign_round2`.
pub share: Vec<u8>
}Source line: 83.
frost::trusted_keygen
Generates a t-of-n FROST key share bundle via the trusted-dealer protocol.
Arguments
min_signers— thresholdt. Must be >= 2.max_signers— total participantsn. Must be >=min_signers.
Errors
- [
CryptoError::FrostKeygenFailed] if the parameters are invalid or the underlying FROST keygen fails. - [
CryptoError::SerializationFailed] if any serialized output cannot be produced (should never happen with valid keygen output).
pub fn trusted_keygen(min_signers: u16, max_signers: u16) -> Result<KeyShareBundle, CryptoError>;Source line: 103.
frost::sign_round1
Round-1 of the FROST protocol for a single participant.
Generates that participant's signing nonces and commitments. The nonces
MUST be kept secret and passed verbatim into [sign_round2]. The
commitments are broadcast to all other selected signers and to the
coordinator.
Errors
- [
CryptoError::SerializationFailed] if the input key package cannot be parsed or the outputs cannot be serialized.
pub fn sign_round1(serialized_key_package: &[u8]) -> Result<Round1Output, CryptoError>;Source line: 191.
frost::sign_round2
Round-2 of the FROST protocol for a single participant.
Given the participant's serialized key package, their secret nonces from round 1, the message to sign, and the aggregated commitments from all signers, produces this participant's signature share.
Arguments
serialized_key_package— this participant's key package bytes.serialized_nonces— thenoncesfield from this participant's [Round1Output].message— the message bytes being signed.commitments— every selected signer's commitments (including this one), tagged with their 1-based identifier.
Errors
- [
CryptoError::SerializationFailed] for any deserialization failure. - [
CryptoError::FrostStageFailed] (stage ="round2") if the round-2 signing operation rejects the inputs.
pub fn sign_round2(
serialized_key_package: &[u8],
serialized_nonces: &[u8],
message: &[u8],
commitments: &[ParticipantCommitments],
) -> Result<Vec<u8>, CryptoError>;Source line: 242.
frost::aggregate
Aggregates per-participant signature shares into a single Ed25519 signature.
Arguments
message— the same message bytes that were signed in round 2.commitments— every selected signer's commitments (must match the set used in round 2).shares— every selected signer'sSignatureSharefrom round 2.serialized_public_key_package— the bundle'spublic_key_packagefield.
Returns a 64-byte Ed25519 signature.
Errors
- [
CryptoError::SerializationFailed] for any deserialization failure. - [
CryptoError::FrostStageFailed] (stage ="aggregate") if FROST aggregation fails.
pub fn aggregate(
message: &[u8],
commitments: &[ParticipantCommitments],
shares: &[ParticipantShare],
serialized_public_key_package: &[u8],
) -> Result<Vec<u8>, CryptoError>;Source line: 292.
frost::verify
Verifies a FROST-Ed25519 threshold signature against the group public key.
FROST produces standard Ed25519 signatures, so this is a straight delegate
to [crate::ed25519::verify]. Provided here for API symmetry with the rest
of the FROST module.
Errors
- [
CryptoError::FrostStageFailed] (stage ="verify") on any verification failure (we wrap the underlying Ed25519 error so callers can branch on the FROST-specific stage if needed).
pub fn verify(
message: &[u8],
signature: &[u8],
group_public_key: &[u8],
) -> Result<(), CryptoError>;Source line: 351.