pub struct Slice<'s, SZ> { /* private fields */ }Expand description
Implementations§
Source§impl<'s> Slice<'s, NonEmpty>
impl<'s> Slice<'s, NonEmpty>
Sourcepub const fn new(slice: &'s [u8]) -> Result<Self, InvalidSize>
pub const fn new(slice: &'s [u8]) -> Result<Self, InvalidSize>
Create a new SaltSlice instance.
§Arguments
slice- TheSalt, which must be non-empty.
§Errors
This requires the provided slice to be non-empty, this is the second-weakest
constraint, and only leveraged with allow-non-fips enabled. In general, for KDFs such
as PBKDF it is strongly recommended to use at least a 128 bit (16 byte) salt
generated from a valid CSPRNG.
Source§impl<'s> Slice<'s, Min16>
impl<'s> Slice<'s, Min16>
Sourcepub const fn new(slice: &'s [u8]) -> Result<Self, InvalidSize>
pub const fn new(slice: &'s [u8]) -> Result<Self, InvalidSize>
Create a new SaltSlice instance.
§Arguments
slice- TheSalt, which must be at least 128 bits (16 bytes).
§Errors
This requires that the provided slice is at least 128 bits (16 bytes), this is the
strongest constraint as it enforces this best practice (as well as FIPS requirement).
Regardless if the interface requires this constraint it is strongly recommended to
use a 128 bit salt generated from a valid CSPRNG.
Trait Implementations§
impl<'s> Salt<Empty> for Slice<'s, Empty>
impl<'s> Salt<Empty> for Slice<'s, Min16>
impl<'s> Salt<Empty> for Slice<'s, NonEmpty>
impl<'s> Salt<Min16> for Slice<'s, Min16>
impl<'s> Salt<NonEmpty> for Slice<'s, NonEmpty>
Auto Trait Implementations§
impl<'s, SZ> Freeze for Slice<'s, SZ>
impl<'s, SZ> RefUnwindSafe for Slice<'s, SZ>where
SZ: RefUnwindSafe,
impl<'s, SZ> Send for Slice<'s, SZ>where
SZ: Send,
impl<'s, SZ> Sync for Slice<'s, SZ>where
SZ: Sync,
impl<'s, SZ> Unpin for Slice<'s, SZ>where
SZ: Unpin,
impl<'s, SZ> UnwindSafe for Slice<'s, SZ>where
SZ: UnwindSafe,
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
Mutably borrows from an owned value. Read more