pub struct Secret { /* private fields */ }
Expand description
Encapsulates a PRF algorithm and secret bytes to be used to derive output.
Implementations§
Source§impl Secret
impl Secret
Sourcepub fn new(
algorithm: &'static Algorithm,
secret: &[u8],
) -> Result<Self, Unspecified>
pub fn new( algorithm: &'static Algorithm, secret: &[u8], ) -> Result<Self, Unspecified>
Constructs a new Secret
for use with the associated P_hash
Algorithm
.
§Errors
Unspecified
: Ifsecret.is_empty() == true
.
Sourcepub fn derive(
self,
label: &[u8],
seed: &[u8],
output: usize,
) -> Result<Secret, Unspecified>
pub fn derive( self, label: &[u8], seed: &[u8], output: usize, ) -> Result<Secret, Unspecified>
Sourcepub fn derive_with_seed_concatination(
self,
label: &[u8],
seed1: &[u8],
seed2: &[u8],
len: usize,
) -> Result<Secret, Unspecified>
pub fn derive_with_seed_concatination( self, label: &[u8], seed1: &[u8], seed2: &[u8], len: usize, ) -> Result<Secret, Unspecified>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Secret
impl RefUnwindSafe for Secret
impl Send for Secret
impl Sync for Secret
impl Unpin for Secret
impl UnwindSafe for Secret
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