#[repr(u8)]pub enum SecurityStrength {
None = 0,
_112bit = 1,
_128bit = 2,
_192bit = 3,
_256bit = 4,
}Expand description
A general indicator used across the library for marking the security level of a cryptographic primitive, and for tracking the security level of the algorithms that interacted with a given piece of data. For example, if a KDF at the 128-bit security strength is used to produce a 512-bit key, that key will also be tagged as having a 128-bit security strength.
Some functions across the library may reject or behave differently based on the security strength
of the inputs they are given. For example a keygen_from_seed() may reject a seed taged at a lower
security strength than the one required by the algorithm, or it may proceed, but lower its own
advertised security strength accordingly – each cryptographic primitive may have additional detail.
Variants§
Implementations§
Source§impl SecurityStrength
impl SecurityStrength
Sourcepub fn from_bits(bits: usize) -> Self
pub fn from_bits(bits: usize) -> Self
Rounds down to the closest supported security strength. For example, 120-bits is rounded down to 112-bit.
Sourcepub fn from_bytes(bytes: usize) -> Self
pub fn from_bytes(bytes: usize) -> Self
Rounds down to the closest supported security strength. For example, 15 bytes (120-bits) is rounded down to 112-bit.
Trait Implementations§
Source§impl Clone for SecurityStrength
impl Clone for SecurityStrength
Source§fn clone(&self) -> SecurityStrength
fn clone(&self) -> SecurityStrength
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 SecurityStrength
impl Debug for SecurityStrength
Source§impl PartialEq for SecurityStrength
impl PartialEq for SecurityStrength
Source§fn eq(&self, other: &SecurityStrength) -> bool
fn eq(&self, other: &SecurityStrength) -> bool
self and other values to be equal, and is used by ==.