Skip to main content

AlgorithmProfile

Enum AlgorithmProfile 

Source
#[repr(u8)]
pub enum AlgorithmProfile { Unrestricted = 0, Cnsa2 = 1, Cnsa1 = 2, Migration = 3, }
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 when the module becomes Operational and cannot be changed without restarting the process (which resets the state machine). A module that fails initialisation reports the default, Unrestricted.

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 (March 2025) Annex B: AES-256, ML-KEM-1024, ML-DSA-87, SHA-384 or SHA-512, and the SP 800-208 stateful hash-based signatures for software and firmware signing, with the supporting services those need at matching strength. The suite names no Keccak-family algorithm for a software module, so none is permitted here. Everything else returns Error::AlgorithmRestricted.

§

Cnsa1 = 2

CNSA 1.0 — CNSSP-15 (October 2016) Annex B: AES-256, ECDH and ECDSA on P-384, SHA-384, and Diffie-Hellman and RSA at a minimum 3072-bit modulus, with the supporting services those need at matching strength. SHA-256 and its variants are refused: the suite admits them only under a near-term condition scoped to UNCLASSIFIED data, which a module cannot evaluate.

§

Migration = 3

Both suites at once — not a CNSA profile and not defined by any standard. This is oxicrypt’s own union of CNSA 1.0 and CNSA 2.0, for a deployment migrating between them that must run classical and post-quantum algorithms side by side.

It is narrower than Unrestricted, which refuses nothing: SHA-1, AES-128, RSA-2048 and P-256 are all refused here. It admits no Keccak-family algorithm, because neither suite does.

Trait Implementations§

Source§

impl Clone for AlgorithmProfile

Source§

fn clone(&self) -> Self

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: &Self) -> 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> 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.