Function keypair_opt

Source
pub fn keypair_opt(
    signature_scheme: SignatureScheme,
    encapsulation_scheme: EncapsulationScheme,
) -> (PrivateKeys, PublicKeys)
Expand description

Generates a key pair with specified signature and encapsulation schemes.

This function creates a new key pair with custom cryptographic schemes for both signing and encryption operations.

§Parameters

  • signature_scheme - The signature scheme to use (e.g., Schnorr, ECDSA, Ed25519)
  • encapsulation_scheme - The key encapsulation scheme to use (e.g., X25519, ML-KEM)

§Returns

A tuple containing:

  • PrivateKeys: The private keys for signing and encapsulation
  • PublicKeys: The corresponding public keys

§Example

use bc_components::{keypair_opt, SignatureScheme, EncapsulationScheme};

// Generate a key pair with Ed25519 for signing and ML-KEM768 for encryption
let (private_keys, public_keys) = keypair_opt(
    SignatureScheme::Ed25519,
    EncapsulationScheme::MLKEM768
);