pub struct Kdf;Implementations§
Source§impl Kdf
impl Kdf
Sourcepub fn derive(
purpose: &str,
master: U256,
nonce: Option<U256>,
) -> Result<U256, CryptoError>
pub fn derive( purpose: &str, master: U256, nonce: Option<U256>, ) -> Result<U256, CryptoError>
Derive a child key: Poseidon([master, stringToFr(purpose), nonce?]).
Nonce is only included if non-zero. purpose must be <= 32 bytes.
Sourcepub fn derive_indexed(
purpose: &str,
master: U256,
index: u64,
) -> Result<U256, CryptoError>
pub fn derive_indexed( purpose: &str, master: U256, index: u64, ) -> Result<U256, CryptoError>
Convenience wrapper: derive with a u64 index as nonce.
Auto Trait Implementations§
impl Freeze for Kdf
impl RefUnwindSafe for Kdf
impl Send for Kdf
impl Sync for Kdf
impl Unpin for Kdf
impl UnsafeUnpin for Kdf
impl UnwindSafe for Kdf
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> 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