|
| 1 | +#[cfg(all(feature = "__aws-lc-rs-unstable", not(feature = "aws-lc-rs-fips")))] |
| 2 | +use aws_lc_rs::unstable; |
1 | 3 | use aws_lc_rs::{signature, try_fips_mode};
|
2 | 4 | use pki_types::{AlgorithmIdentifier, InvalidSignature, SignatureVerificationAlgorithm, alg_id};
|
3 | 5 |
|
@@ -54,6 +56,27 @@ impl SignatureVerificationAlgorithm for AwsLcRsAlgorithm {
|
54 | 56 | }
|
55 | 57 | }
|
56 | 58 |
|
| 59 | +#[cfg(all(feature = "__aws-lc-rs-unstable", not(feature = "aws-lc-rs-fips")))] |
| 60 | +pub static ML_DSA_44: &dyn SignatureVerificationAlgorithm = &AwsLcRsAlgorithm { |
| 61 | + public_key_alg_id: alg_id::ML_DSA_44, |
| 62 | + signature_alg_id: alg_id::ML_DSA_44, |
| 63 | + verification_alg: &unstable::signature::MLDSA_44, |
| 64 | +}; |
| 65 | + |
| 66 | +#[cfg(all(feature = "__aws-lc-rs-unstable", not(feature = "aws-lc-rs-fips")))] |
| 67 | +pub static ML_DSA_65: &dyn SignatureVerificationAlgorithm = &AwsLcRsAlgorithm { |
| 68 | + public_key_alg_id: alg_id::ML_DSA_65, |
| 69 | + signature_alg_id: alg_id::ML_DSA_65, |
| 70 | + verification_alg: &unstable::signature::MLDSA_65, |
| 71 | +}; |
| 72 | + |
| 73 | +#[cfg(all(feature = "__aws-lc-rs-unstable", not(feature = "aws-lc-rs-fips")))] |
| 74 | +pub static ML_DSA_87: &dyn SignatureVerificationAlgorithm = &AwsLcRsAlgorithm { |
| 75 | + public_key_alg_id: alg_id::ML_DSA_87, |
| 76 | + signature_alg_id: alg_id::ML_DSA_87, |
| 77 | + verification_alg: &unstable::signature::MLDSA_87, |
| 78 | +}; |
| 79 | + |
57 | 80 | /// ECDSA signatures using the P-256 curve and SHA-256.
|
58 | 81 | pub static ECDSA_P256_SHA256: &dyn SignatureVerificationAlgorithm = &AwsLcRsAlgorithm {
|
59 | 82 | public_key_alg_id: alg_id::ECDSA_P256,
|
@@ -194,6 +217,12 @@ mod tests {
|
194 | 217 | // Algorithms deprecated because they are nonsensical combinations.
|
195 | 218 | super::ECDSA_P256_SHA384, // Truncates digest.
|
196 | 219 | super::ECDSA_P384_SHA256, // Digest is unnecessarily short.
|
| 220 | + #[cfg(all(feature = "__aws-lc-rs-unstable", not(feature = "aws-lc-rs-fips")))] |
| 221 | + super::ML_DSA_44, |
| 222 | + #[cfg(all(feature = "__aws-lc-rs-unstable", not(feature = "aws-lc-rs-fips")))] |
| 223 | + super::ML_DSA_65, |
| 224 | + #[cfg(all(feature = "__aws-lc-rs-unstable", not(feature = "aws-lc-rs-fips")))] |
| 225 | + super::ML_DSA_87, |
197 | 226 | ];
|
198 | 227 |
|
199 | 228 | const UNSUPPORTED_SIGNATURE_ALGORITHM_FOR_RSA_KEY: Error =
|
|
0 commit comments