Trait Sign

Source
pub trait Sign {
    // Required methods
    fn ec_signing_key(&self) -> &Ed25519Signing;
    fn pq_signing_key(&self) -> &FnDsaSigning;

    // Provided methods
    fn ec_signing_context<'a, 'b>(
        &'a self,
        context: &'b [u8],
    ) -> Context<'a, 'b, Ed25519Signing> { ... }
    fn ec_sign_digest<D>(&self, context: &[u8], digest: D) -> Ed25519Signature
       where D: Digest<OutputSize = U64> { ... }
    fn pq_sign_digest(
        &self,
        context: &FnDsaDomainContext<'_>,
        digest: &[u8],
        csprng: &mut impl CryptoRngCore,
    ) -> FnDsaSignature { ... }
    fn sign_digest<D>(
        &self,
        context: &[u8],
        digest: D,
        csprng: &mut impl CryptoRngCore,
    ) -> (Ed25519Signature, FnDsaSignature)
       where D: Digest<OutputSize = U64> + Clone { ... }
    fn sign<S, V>(
        &self,
        signable: S,
        csprng: &mut impl CryptoRngCore,
    ) -> S::SignedType
       where S: Signable + Digestible,
             V: Verifies<S::SignedType> + Verifier,
             Self: VerifyingKeys<V> { ... }
}
Expand description

Signing key operations.

This trait provides access to both Ed25519 and FN-DSA signing keys and implements a dual-signature scheme.

Required Methods§

Source

fn ec_signing_key(&self) -> &Ed25519Signing

Access to the Ed25519 signing key.

Source

fn pq_signing_key(&self) -> &FnDsaSigning

Access to the FN-DSA signing key.

Provided Methods§

Source

fn ec_signing_context<'a, 'b>( &'a self, context: &'b [u8], ) -> Context<'a, 'b, Ed25519Signing>

Create an Ed25519 signing context with domain separation.

Source

fn ec_sign_digest<D>(&self, context: &[u8], digest: D) -> Ed25519Signature
where D: Digest<OutputSize = U64>,

Sign a digest using Ed25519 with the given context.

Source

fn pq_sign_digest( &self, context: &FnDsaDomainContext<'_>, digest: &[u8], csprng: &mut impl CryptoRngCore, ) -> FnDsaSignature

Sign a digest using FN-DSA with the given context.

Source

fn sign_digest<D>( &self, context: &[u8], digest: D, csprng: &mut impl CryptoRngCore, ) -> (Ed25519Signature, FnDsaSignature)
where D: Digest<OutputSize = U64> + Clone,

Generate both Ed25519 and FN-DSA signatures for a digest.

Source

fn sign<S, V>( &self, signable: S, csprng: &mut impl CryptoRngCore, ) -> S::SignedType

Sign a Signable data structure.

This is the main signing interface that combines the source type with both Ed25519 and FN-DSA signatures.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§