pub struct Attributes<'a, D> { /* private fields */ }Expand description
Represents a collection of attribute values and that can be hardened into
a Keyspace using memory-hard key derivation.
Implementations§
Source§impl<'a, D> Attributes<'a, D>where
D: Digest + CoreProxy + OutputSizeUser + Sync,
D::Core: Sync + HashMarker + UpdateCore + FixedOutputCore + BufferKindUser<BufferKind = Eager> + Default + Clone + BlockSizeUser,
<D::Core as BlockSizeUser>::BlockSize: IsLess<U256>,
Le<<D::Core as BlockSizeUser>::BlockSize, U256>: NonZero,
impl<'a, D> Attributes<'a, D>where
D: Digest + CoreProxy + OutputSizeUser + Sync,
D::Core: Sync + HashMarker + UpdateCore + FixedOutputCore + BufferKindUser<BufferKind = Eager> + Default + Clone + BlockSizeUser,
<D::Core as BlockSizeUser>::BlockSize: IsLess<U256>,
Le<<D::Core as BlockSizeUser>::BlockSize, U256>: NonZero,
Sourcepub fn new(arr: Vec<Vec<u8>>, params: Params) -> Result<Self, ArrkeyError>
pub fn new(arr: Vec<Vec<u8>>, params: Params) -> Result<Self, ArrkeyError>
Construct a new collection of Attributes.
Requires at least two attribute values, and a set of valid parameters. Returns an error when fewer than two attributes are provided.
Sourcepub fn harden(&self, salt: &[u8]) -> Result<Keyspace<D>, ArrkeyError>
pub fn harden(&self, salt: &[u8]) -> Result<Keyspace<D>, ArrkeyError>
Harden the attributes into a cryptographic Keyspace.
Applies a memory-hard key derivation function (Argon2id) to harden all attributes in parallel, using per-attribute salts derived from a shared base salt. All hardened attributes are used to produce a keyspace, from which attribute-based keys can be selected.
Returns a Keyspace of the hardened attributes on success, or an error when the memory-hard key derivation process fails.
Trait Implementations§
Source§impl<'a, D: Clone> Clone for Attributes<'a, D>
impl<'a, D: Clone> Clone for Attributes<'a, D>
Source§fn clone(&self) -> Attributes<'a, D>
fn clone(&self) -> Attributes<'a, D>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a, D> Freeze for Attributes<'a, D>
impl<'a, D> RefUnwindSafe for Attributes<'a, D>where
D: RefUnwindSafe,
impl<'a, D> Send for Attributes<'a, D>where
D: Send,
impl<'a, D> Sync for Attributes<'a, D>where
D: Sync,
impl<'a, D> Unpin for Attributes<'a, D>where
D: Unpin,
impl<'a, D> UnsafeUnpin for Attributes<'a, D>
impl<'a, D> UnwindSafe for Attributes<'a, D>where
D: 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
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>
Converts
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>
Converts
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