pub enum AlgorithmClass {
Broken,
ClassicalQuantumVulnerable,
Symmetric,
Sha2,
Sha3,
OtherHash,
PostQuantum(PqcKind),
Unknown,
}Expand description
Coarse security class produced by classify_algorithm.
Variants§
Broken
Classically broken or disallowed per SP 800-131A (MD5, SHA-1, DES, 3DES, RC2, RC4, Blowfish, IDEA, CAST5, …).
ClassicalQuantumVulnerable
Classical public-key algorithm broken by Shor’s algorithm (RSA, DSA, DH/DHE, ECDH/ECDHE, ECDSA, EdDSA/Ed25519/Ed448, X25519/X448, ElGamal, ECIES, ECMQV, generic EC/ECC).
Symmetric
Modern symmetric cipher (AES, ChaCha20, Camellia, ARIA, …); strength judgments (e.g., CNSA 2.0’s AES-256-only rule) are up to the caller.
Sha2
SHA-2 family hash; the digest size, when known, is in parameter.
Sha3
SHA-3 family hash/XOF (SHA3-*, SHAKE, Keccak).
OtherHash
Recognized modern hash outside the SHA-2/SHA-3 families (SM3, GOST R 34.11 “Streebog”, …) — not broken, but not on approval lists such as CNSA 2.0.
PostQuantum(PqcKind)
Post-quantum algorithm; the parameter set, when known, is in
parameter (e.g., “1024” for ML-KEM-1024, “87” for ML-DSA-87).
Unknown
Not recognized — callers should treat as “cannot verify”, never as implicitly compliant.
Implementations§
Source§impl AlgorithmClass
impl AlgorithmClass
Sourcepub const fn severity_rank(self) -> u8
pub const fn severity_rank(self) -> u8
Rank for “report the most severe mention” selection (higher is worse): Broken > ClassicalQuantumVulnerable > recognized symmetric/hash (not necessarily approved) > post-quantum > Unknown. Used to pick the worst algorithm out of multi-algorithm identities like “sha384-rsa-cert-chain”, where reporting the first token (SHA-384, CNSA-approved) would hide the quantum-vulnerable RSA.
Trait Implementations§
Source§impl Clone for AlgorithmClass
impl Clone for AlgorithmClass
Source§fn clone(&self) -> AlgorithmClass
fn clone(&self) -> AlgorithmClass
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 AlgorithmClass
Source§impl Debug for AlgorithmClass
impl Debug for AlgorithmClass
impl Eq for AlgorithmClass
Source§impl Hash for AlgorithmClass
impl Hash for AlgorithmClass
Source§impl PartialEq for AlgorithmClass
impl PartialEq for AlgorithmClass
impl StructuralPartialEq for AlgorithmClass
Auto Trait Implementations§
impl Freeze for AlgorithmClass
impl RefUnwindSafe for AlgorithmClass
impl Send for AlgorithmClass
impl Sync for AlgorithmClass
impl Unpin for AlgorithmClass
impl UnsafeUnpin for AlgorithmClass
impl UnwindSafe for AlgorithmClass
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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