Module signature

Module signature 

Source
Available on crate feature unstable and non-crate feature fips only.
Expand description

This module contains unstable/experimental APIs.

§⚠️ Warning

The APIs under this module are not stable and may change in the future. They are not covered by semver guarantees.

§Signing and verifying with MLDSA-44

    use aws_lc_rs::encoding::AsDer;
    use aws_lc_rs::signature::{KeyPair, UnparsedPublicKey};
    use aws_lc_rs::unstable::signature::{PqdsaKeyPair, MLDSA_44_SIGNING, MLDSA_44};

    let signing_alg = &MLDSA_44_SIGNING;
    let key_pair = PqdsaKeyPair::generate(signing_alg)?;

    const MESSAGE: &'static [u8] = b"hello, world";
    let mut signature = vec![0; signing_alg.signature_len()];

    let signature_len = key_pair.sign(MESSAGE, &mut signature)?;
    assert_eq!(signature_len, signature.len());

    // Verify the signature.
    let public_key_bytes = key_pair.public_key().as_der()?;
    let public_key = UnparsedPublicKey::new(&MLDSA_44, public_key_bytes.as_ref());

    assert!(public_key.verify(MESSAGE, &signature).is_ok());

Structs§

PqdsaKeyPair
A PQDSA (Post-Quantum Digital Signature Algorithm) key pair, used for signing and verification.
PqdsaPrivateKey
A PQDSA private key.
PqdsaPublicKey
A PQDSA public key.
PqdsaSigningAlgorithm
An PQDSA signing algorithm.
PqdsaVerificationAlgorithm
An PQDSA verification algorithm.

Statics§

MLDSA_44Deprecated
Verification of MLDSA-44 signatures
MLDSA_65Deprecated
Verification of MLDSA-65 signatures
MLDSA_87Deprecated
Verification of MLDSA-87 signatures
MLDSA_44_SIGNINGDeprecated
Sign using MLDSA-44
MLDSA_65_SIGNINGDeprecated
Sign using MLDSA-65
MLDSA_87_SIGNINGDeprecated
Sign using MLDSA-87
ML_DSA_44
Verification of ML-DSA-44 signatures
ML_DSA_65
Verification of ML-DSA-65 signatures
ML_DSA_87
Verification of ML-DSA-87 signatures
ML_DSA_44_SIGNING
Sign using ML-DSA-44
ML_DSA_65_SIGNING
Sign using ML-DSA-65
ML_DSA_87_SIGNING
Sign using ML-DSA-87