Skip to main content

SigAlgorithm

Enum SigAlgorithm 

Source
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

Source

pub fn as_str(&self) -> &'static str

Returns the canonical string identifier for this algorithm.

Source

pub fn public_key_size(&self) -> usize

Returns the public key size in bytes for this algorithm.

Source

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.

Source

pub fn signature_size(&self) -> usize

Returns the maximum signature size in bytes for this algorithm.

Source

pub fn fips_standard(&self) -> &'static str

Returns the FIPS standard number for this algorithm.

Source

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.

Source

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

Source§

fn clone(&self) -> SigAlgorithm

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SigAlgorithm

Source§

impl Debug for SigAlgorithm

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SigAlgorithm

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<SigAlgorithm, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for SigAlgorithm

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for SigAlgorithm

Source§

impl Hash for SigAlgorithm

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SigAlgorithm

Source§

fn eq(&self, other: &SigAlgorithm) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for SigAlgorithm

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SigAlgorithm

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.