pub enum MlDsaVariant {
MlDsa44,
MlDsa65,
MlDsa87,
}Expand description
ML-DSA algorithm variants
Selects the security level and performance characteristics for ML-DSA operations. Higher security levels provide more protection but require larger keys and signatures.
§Examples
use saorsa_pqc::api::sig::MlDsaVariant;
// Choose based on security requirements
let standard = MlDsaVariant::MlDsa65; // Recommended for most uses
let lightweight = MlDsaVariant::MlDsa44; // For constrained environments
let maximum = MlDsaVariant::MlDsa87; // For highest security needs
println!("Public key size: {} bytes", standard.public_key_size());
println!("Signature size: {} bytes", standard.signature_size());
println!("Security: {}", standard.security_level());Variants§
MlDsa44
ML-DSA-44: NIST Level 2 security (~128-bit classical)
- Public key: 1312 bytes
- Secret key: 2560 bytes
- Signature: 2420 bytes
MlDsa65
ML-DSA-65: NIST Level 3 security (~192-bit classical) [RECOMMENDED]
- Public key: 1952 bytes
- Secret key: 4032 bytes
- Signature: 3309 bytes
MlDsa87
ML-DSA-87: NIST Level 5 security (~256-bit classical)
- Public key: 2592 bytes
- Secret key: 4896 bytes
- Signature: 4627 bytes
Implementations§
Source§impl MlDsaVariant
impl MlDsaVariant
Sourcepub const MAX_CONTEXT_LENGTH: usize = 255
pub const MAX_CONTEXT_LENGTH: usize = 255
Maximum context length (255 bytes for all variants)
Sourcepub const fn public_key_size(&self) -> usize
pub const fn public_key_size(&self) -> usize
Get the public key size in bytes
Sourcepub const fn secret_key_size(&self) -> usize
pub const fn secret_key_size(&self) -> usize
Get the secret key size in bytes
Sourcepub const fn signature_size(&self) -> usize
pub const fn signature_size(&self) -> usize
Get the signature size in bytes
Sourcepub const fn security_level(&self) -> &'static str
pub const fn security_level(&self) -> &'static str
Get the security level description
Trait Implementations§
Source§impl Clone for MlDsaVariant
impl Clone for MlDsaVariant
Source§fn clone(&self) -> MlDsaVariant
fn clone(&self) -> MlDsaVariant
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MlDsaVariant
impl Debug for MlDsaVariant
Source§impl PartialEq for MlDsaVariant
impl PartialEq for MlDsaVariant
Source§impl Zeroize for MlDsaVariant
impl Zeroize for MlDsaVariant
impl Copy for MlDsaVariant
impl Eq for MlDsaVariant
impl StructuralPartialEq for MlDsaVariant
Auto Trait Implementations§
impl Freeze for MlDsaVariant
impl RefUnwindSafe for MlDsaVariant
impl Send for MlDsaVariant
impl Sync for MlDsaVariant
impl Unpin for MlDsaVariant
impl UnsafeUnpin for MlDsaVariant
impl UnwindSafe for MlDsaVariant
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more