#[repr(u8)]pub enum CipherSuite {
Standard2025 = 1,
PostQuantum2030 = 2,
Hybrid2028 = 3,
GovHighAssurance = 4,
LegacyRSA = 255,
}Expand description
Supported cipher suites for cryptographic agility.
Allows rotation from classical to post-quantum algorithms without breaking existing files.
§Design Rationale (Poka-yoke)
Hardcoding Ed25519 creates long-term risk. Post-quantum computers could break classical signatures by 2030-2040. This enum allows graceful migration without breaking existing files.
§Security Recommendations
- Standard2025: Use for current deployments (fast, small keys)
- Hybrid2028: Use for long-term sensitive data (transition period)
PostQuantum2030: Use when NIST PQC is fully standardizedGovHighAssurance: Use for government/defense applicationsLegacyRSA: DEPRECATED - load-only for migration
Variants§
Standard2025 = 1
Current standard (2025): Fast, small keys
- Sign: Ed25519 (ed25519-dalek)
- Encrypt: XChaCha20-Poly1305
- Hash: BLAKE3
- KDF: Argon2id
PostQuantum2030 = 2
NIST PQC Standard (2030+): Post-Quantum resistant
- Sign: ML-DSA-65 (Dilithium3)
- KEM: ML-KEM-768 (Kyber768)
- Hash: SHA3-256
- KDF: HKDF-SHA3
Hybrid2028 = 3
Hybrid mode: Classical + Post-Quantum (transition period)
- Sign: Ed25519 + ML-DSA-65 (both required)
- KEM: X25519 + ML-KEM-768
Provides security against both classical and quantum adversaries
GovHighAssurance = 4
Government/High-Assurance (NSA Suite B compatible)
- Sign: ECDSA P-384
- Encrypt: AES-256-GCM
- Hash: SHA-384
Required for some government/defense applications
LegacyRSA = 255
Legacy support (deprecated, load-only)
- Sign: RSA-2048
- Encrypt: AES-128-CBC
WARNING: Do not create new files with this suite
Implementations§
Source§impl CipherSuite
impl CipherSuite
Sourcepub const fn is_secure(&self) -> bool
pub const fn is_secure(&self) -> bool
Check if this suite is considered secure (not deprecated)
Sourcepub const fn is_post_quantum(&self) -> bool
pub const fn is_post_quantum(&self) -> bool
Check if this suite provides post-quantum resistance
Sourcepub const fn is_government_approved(&self) -> bool
pub const fn is_government_approved(&self) -> bool
Check if this suite is government-approved
Sourcepub const fn is_deprecated(&self) -> bool
pub const fn is_deprecated(&self) -> bool
Check if this suite is deprecated
Sourcepub const fn signature_size(&self) -> usize
pub const fn signature_size(&self) -> usize
Get signature size in bytes
Sourcepub const fn public_key_size(&self) -> usize
pub const fn public_key_size(&self) -> usize
Get public key size in bytes
Sourcepub const fn encryption_key_size(&self) -> usize
pub const fn encryption_key_size(&self) -> usize
Get encryption key size in bytes
Sourcepub const fn signature_algorithm(&self) -> &'static str
pub const fn signature_algorithm(&self) -> &'static str
Get signature algorithm name
Sourcepub const fn encryption_algorithm(&self) -> &'static str
pub const fn encryption_algorithm(&self) -> &'static str
Get encryption algorithm name
Sourcepub const fn hash_algorithm(&self) -> &'static str
pub const fn hash_algorithm(&self) -> &'static str
Get hash algorithm name
Sourcepub const fn kdf_algorithm(&self) -> &'static str
pub const fn kdf_algorithm(&self) -> &'static str
Get KDF algorithm name
Sourcepub const fn migration_target(&self) -> Option<Self>
pub const fn migration_target(&self) -> Option<Self>
Get recommended migration target
Sourcepub const fn security_level_bits(&self) -> u32
pub const fn security_level_bits(&self) -> u32
Get security level in bits (classical equivalent)
Sourcepub const fn meets_security_level(&self, min_bits: u32) -> bool
pub const fn meets_security_level(&self, min_bits: u32) -> bool
Check if suite meets minimum security level
Sourcepub const fn recommended() -> &'static [Self]
pub const fn recommended() -> &'static [Self]
Get recommended suites for new deployments
Trait Implementations§
Source§impl Clone for CipherSuite
impl Clone for CipherSuite
Source§fn clone(&self) -> CipherSuite
fn clone(&self) -> CipherSuite
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CipherSuite
impl Debug for CipherSuite
Source§impl Default for CipherSuite
impl Default for CipherSuite
Source§fn default() -> CipherSuite
fn default() -> CipherSuite
Source§impl<'de> Deserialize<'de> for CipherSuite
impl<'de> Deserialize<'de> for CipherSuite
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 PartialEq for CipherSuite
impl PartialEq for CipherSuite
Source§impl Serialize for CipherSuite
impl Serialize for CipherSuite
impl Copy for CipherSuite
impl Eq for CipherSuite
impl StructuralPartialEq for CipherSuite
Auto Trait Implementations§
impl Freeze for CipherSuite
impl RefUnwindSafe for CipherSuite
impl Send for CipherSuite
impl Sync for CipherSuite
impl Unpin for CipherSuite
impl UnwindSafe for CipherSuite
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<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