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§
- Pqdsa
KeyPair - A PQDSA (Post-Quantum Digital Signature Algorithm) key pair, used for signing and verification.
- Pqdsa
Private Key - A PQDSA private key.
- Pqdsa
Public Key - A PQDSA public key.
- Pqdsa
Signing Algorithm - An PQDSA signing algorithm.
- Pqdsa
Verification Algorithm - An PQDSA verification algorithm.
Statics§
- MLDSA_
44 Deprecated - Verification of MLDSA-44 signatures
- MLDSA_
65 Deprecated - Verification of MLDSA-65 signatures
- MLDSA_
87 Deprecated - Verification of MLDSA-87 signatures
- MLDSA_
44_ SIGNING Deprecated - Sign using MLDSA-44
- MLDSA_
65_ SIGNING Deprecated - Sign using MLDSA-65
- MLDSA_
87_ SIGNING Deprecated - 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