pub enum SigAlgorithm {
Show 17 variants
MlDsa44,
MlDsa65,
MlDsa87,
SlhDsaSha2_128s,
SlhDsaSha2_128f,
SlhDsaSha2_192s,
SlhDsaSha2_192f,
SlhDsaSha2_256s,
SlhDsaSha2_256f,
SlhDsaShake128s,
SlhDsaShake128f,
SlhDsaShake192s,
SlhDsaShake192f,
SlhDsaShake256s,
SlhDsaShake256f,
FnDsa512,
FnDsa1024,
}Expand description
Canonical algorithm-labelled signature transport types supplied by
pqc-sig. They are representations and encoders only; this SDK continues
to perform signing and verification through its embedded aethel-core
component.
Identifies the post-quantum signature algorithm used.
Variants§
MlDsa44
ML-DSA-44 (NIST FIPS 204, Security Level 2)
MlDsa65
ML-DSA-65 (NIST FIPS 204, Security Level 3) — recommended default
MlDsa87
ML-DSA-87 (NIST FIPS 204, Security Level 5)
SlhDsaSha2_128s
SLH-DSA-SHA2-128s (NIST FIPS 205, Security Level 1, small signatures)
SlhDsaSha2_128f
SLH-DSA-SHA2-128f (NIST FIPS 205, Security Level 1, fast signing)
SlhDsaSha2_192s
SLH-DSA-SHA2-192s (NIST FIPS 205, Security Level 3, small signatures)
SlhDsaSha2_192f
SLH-DSA-SHA2-192f (NIST FIPS 205, Security Level 3, fast signing)
SlhDsaSha2_256s
SLH-DSA-SHA2-256s (NIST FIPS 205, Security Level 5, small signatures)
SlhDsaSha2_256f
SLH-DSA-SHA2-256f (NIST FIPS 205, Security Level 5, fast signing)
SlhDsaShake128s
SLH-DSA-SHAKE-128s (NIST FIPS 205, Security Level 1, small signatures)
SlhDsaShake128f
SLH-DSA-SHAKE-128f (NIST FIPS 205, Security Level 1, fast signing)
SlhDsaShake192s
SLH-DSA-SHAKE-192s (NIST FIPS 205, Security Level 3, small signatures)
SlhDsaShake192f
SLH-DSA-SHAKE-192f (NIST FIPS 205, Security Level 3, fast signing)
SlhDsaShake256s
SLH-DSA-SHAKE-256s (NIST FIPS 205, Security Level 5, small signatures)
SlhDsaShake256f
SLH-DSA-SHAKE-256f (NIST FIPS 205, Security Level 5, fast signing)
FnDsa512
FN-DSA-512 (NIST FIPS 206, Security Level 1) — requires fndsa feature
FnDsa1024
FN-DSA-1024 (NIST FIPS 206, Security Level 5) — requires fndsa feature
Implementations§
Source§impl SigAlgorithm
impl SigAlgorithm
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Returns the canonical string identifier for this algorithm.
Sourcepub fn public_key_size(&self) -> usize
pub fn public_key_size(&self) -> usize
Returns the public key size in bytes for this algorithm.
Sourcepub fn secret_key_size(&self) -> usize
pub fn secret_key_size(&self) -> usize
Returns the secret key size in bytes for this algorithm.
For ML-DSA variants, this returns 32 (the seed size), which is the preferred
serialization per the ml-dsa crate. The full expanded key form (2560/4032/4896 bytes)
is deprecated in favor of the compact 32-byte seed.
For FN-DSA variants, this is the fn-dsa crate’s own encoded signing-key format
(1345/2369 bytes), not the raw 1281/2305-byte NIST secret-key size — implementation-defined,
like the ML-DSA seed above.
Sourcepub fn signature_size(&self) -> usize
pub fn signature_size(&self) -> usize
Returns the maximum signature size in bytes for this algorithm.
Sourcepub fn fips_standard(&self) -> &'static str
pub fn fips_standard(&self) -> &'static str
Returns the FIPS standard number for this algorithm.
Sourcepub fn multicodec_code(&self) -> Result<u32, SigError>
pub fn multicodec_code(&self) -> Result<u32, SigError>
Returns the multicodec code for this algorithm’s public key.
ML-DSA and SLH-DSA codes (0x1210–0x122b) are registered (draft status) in the
upstream multicodec table. FN-DSA (FIPS 206 / Falcon) has no upstream-registered
multicodec code as of this writing — see FN_DSA_PRIVATE_USE_BASE for the
provisional, 0x307-namespaced private-use codes this crate assigns instead, and its
doc comment for the full rationale, scope, and revisit trigger.
Sourcepub fn is_private_use_multicodec(&self) -> bool
pub fn is_private_use_multicodec(&self) -> bool
Returns true if this algorithm’s multicodec_code is one of
this crate’s own provisional private-use reservations (currently just FN-DSA), rather
than an upstream-registered multiformats/multicodec table entry.
Useful for callers who want to warn, log, or otherwise flag when a DID Document / Multikey they’re producing embeds a non-standard code that other multicodec implementations will not recognize.
Trait Implementations§
Source§impl Clone for SigAlgorithm
impl Clone for SigAlgorithm
Source§fn clone(&self) -> SigAlgorithm
fn clone(&self) -> SigAlgorithm
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SigAlgorithm
Source§impl Debug for SigAlgorithm
impl Debug for SigAlgorithm
Source§impl<'de> Deserialize<'de> for SigAlgorithm
impl<'de> Deserialize<'de> for SigAlgorithm
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SigAlgorithm, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SigAlgorithm, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for SigAlgorithm
impl Display for SigAlgorithm
impl Eq for SigAlgorithm
Source§impl Hash for SigAlgorithm
impl Hash for SigAlgorithm
Source§impl PartialEq for SigAlgorithm
impl PartialEq for SigAlgorithm
Source§impl Serialize for SigAlgorithm
impl Serialize for SigAlgorithm
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for SigAlgorithm
Auto Trait Implementations§
impl Freeze for SigAlgorithm
impl RefUnwindSafe for SigAlgorithm
impl Send for SigAlgorithm
impl Sync for SigAlgorithm
impl Unpin for SigAlgorithm
impl UnsafeUnpin for SigAlgorithm
impl UnwindSafe for SigAlgorithm
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
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> 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> ⓘ
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> ⓘ
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