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 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