1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
//! 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
//!
//! ```rust
//! # use std::error::Error;
//! # fn main() -> Result<(), Box<dyn Error>> {
//! 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());
//! # Ok(())
//! # }
//! ```
//!
pub use crate;
pub use crate;
use crateAlgorithmID;
/// Verification of MLDSA-44 signatures
pub static MLDSA_44: PqdsaVerificationAlgorithm = PqdsaVerificationAlgorithm ;
/// Verification of MLDSA-65 signatures
pub static MLDSA_65: PqdsaVerificationAlgorithm = PqdsaVerificationAlgorithm ;
/// Verification of MLDSA-87 signatures
pub static MLDSA_87: PqdsaVerificationAlgorithm = PqdsaVerificationAlgorithm ;
/// Sign using MLDSA-44
pub static MLDSA_44_SIGNING: PqdsaSigningAlgorithm = PqdsaSigningAlgorithm;
/// Sign using MLDSA-65
pub static MLDSA_65_SIGNING: PqdsaSigningAlgorithm = PqdsaSigningAlgorithm;
/// Sign using MLDSA-87
pub static MLDSA_87_SIGNING: PqdsaSigningAlgorithm = PqdsaSigningAlgorithm;