#[repr(u8)]pub enum SignatureAlgorithm {
Ed25519 = 1,
HybridMlDsa44Ed25519 = 2,
HybridMlDsa65Ed25519 = 3,
}Expand description
Wire-stable numeric tag for the signature algorithm used in a DelegationCert.
Every cert carries exactly one of these tags, written as a single byte in
DelegationCert::version ≥ 2 certs. Verifiers that encounter an unknown
tag MUST reject the cert with A1Error::UnsupportedAlgorithm. The numeric
representation is frozen for the lifetime of the protocol.
§Forward compatibility
New variants are additive. A verifier compiled against an older version of this library simply cannot validate the new variant and rejects it — it does not silently fall back to a weaker scheme.
§Quantum migration path
- Today: issue all certs with
Ed25519(default). No changes required. - Transition: issue root passports with
HybridMlDsa44Ed25519. Classical sub-delegations remain valid — seeChainAlgorithmCompatibility. - Post-migration: all certs use a hybrid or pure-PQ algorithm.
The post-quantum feature flag wires in the real ML-DSA signer backend;
until then the framework validates the Ed25519 component and the binding
context in HybridSignature::pq_context, ensuring the wire format is
identical and no migration is required when PQ support is activated.
Variants§
Ed25519 = 1
Pure Ed25519 — the default for all v2.8.0 deployments.
HybridMlDsa44Ed25519 = 2
CRYSTALS-Dilithium 2 (ML-DSA-44) + Ed25519 hybrid.
Both components are required for verification. A verifier that cannot
evaluate the ML-DSA component MUST reject with UnsupportedAlgorithm.
Security category: 128-bit post-quantum, NIST ML-DSA-44.
HybridMlDsa65Ed25519 = 3
CRYSTALS-Dilithium 3 (ML-DSA-65) + Ed25519 hybrid.
Higher-assurance variant. Security category: 192-bit post-quantum, NIST ML-DSA-65. Recommended for financial and government deployments.
Implementations§
Source§impl SignatureAlgorithm
impl SignatureAlgorithm
pub fn as_u8(self) -> u8
pub fn from_u8(v: u8) -> Result<Self, A1Error>
Sourcepub fn requires_pq(self) -> bool
pub fn requires_pq(self) -> bool
Whether this algorithm requires a post-quantum signing component.
Sourcepub fn pq_public_key_len(self) -> usize
pub fn pq_public_key_len(self) -> usize
Expected byte length of the PQ public key for this algorithm.
ML-DSA-44: 1312 bytes. ML-DSA-65: 1952 bytes. Ed25519: 0.
Sourcepub fn pq_signature_len(self) -> usize
pub fn pq_signature_len(self) -> usize
Expected byte length of the PQ signature for this algorithm.
ML-DSA-44: 2420 bytes. ML-DSA-65: 3309 bytes. Ed25519: 0.
Trait Implementations§
Source§impl Clone for SignatureAlgorithm
impl Clone for SignatureAlgorithm
Source§fn clone(&self) -> SignatureAlgorithm
fn clone(&self) -> SignatureAlgorithm
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SignatureAlgorithm
impl Debug for SignatureAlgorithm
Source§impl Default for SignatureAlgorithm
impl Default for SignatureAlgorithm
Source§fn default() -> SignatureAlgorithm
fn default() -> SignatureAlgorithm
Source§impl<'de> Deserialize<'de> for SignatureAlgorithm
impl<'de> Deserialize<'de> for SignatureAlgorithm
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for SignatureAlgorithm
impl Display for SignatureAlgorithm
Source§impl Hash for SignatureAlgorithm
impl Hash for SignatureAlgorithm
Source§impl PartialEq for SignatureAlgorithm
impl PartialEq for SignatureAlgorithm
Source§fn eq(&self, other: &SignatureAlgorithm) -> bool
fn eq(&self, other: &SignatureAlgorithm) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SignatureAlgorithm
impl Serialize for SignatureAlgorithm
impl Copy for SignatureAlgorithm
impl Eq for SignatureAlgorithm
impl StructuralPartialEq for SignatureAlgorithm
Auto Trait Implementations§
impl Freeze for SignatureAlgorithm
impl RefUnwindSafe for SignatureAlgorithm
impl Send for SignatureAlgorithm
impl Sync for SignatureAlgorithm
impl Unpin for SignatureAlgorithm
impl UnsafeUnpin for SignatureAlgorithm
impl UnwindSafe for SignatureAlgorithm
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,
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.