Skip to main content

AlgorithmProfile

Enum AlgorithmProfile 

Source
#[repr(u8)]
pub enum AlgorithmProfile { Unrestricted = 0, Cnsa2 = 1, Cnsa1 = 2, }
Expand description

Algorithm restriction profile selected at module initialization.

A single binary can serve general FIPS 140-3 consumers (Unrestricted) and CNSA-restricted deployments (Cnsa2, Cnsa1) by choosing the appropriate profile at init time.

The profile is immutable once set: it is stored alongside the module State before the first KAT runs and cannot be changed without restarting the process (which resets the state machine).

Variants§

§

Unrestricted = 0

All FIPS-approved algorithms are available. This is the default and preserves backward compatibility with callers that use initialize_with_tests.

§

Cnsa2 = 1

CNSA 2.0 (CNSSP 15): quantum-resistant algorithms only. AES-256, SHA-384/512, ML-KEM-1024, ML-DSA-87, LMS, XMSS. SHA3-384/512 and 256-bit SP 800-185 variants are also allowed. All other algorithms return Error::AlgorithmRestricted.

§

Cnsa1 = 2

CNSA 1.0: classical algorithms for the transition period. AES-256, SHA-384, ECDSA/ECDH P-384, RSA >= 3072, DH >= 3072.

Trait Implementations§

Source§

impl Clone for AlgorithmProfile

Source§

fn clone(&self) -> AlgorithmProfile

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 AlgorithmProfile

Source§

impl Debug for AlgorithmProfile

Source§

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

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

impl Display for AlgorithmProfile

Source§

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

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

impl Eq for AlgorithmProfile

Source§

impl PartialEq for AlgorithmProfile

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AlgorithmProfile

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.