Struct crypto::keys::slip10::Seed

source ·
pub struct Seed(/* private fields */);
Available on crate feature slip10 only.
Expand description

A seed is an arbitrary bytestring used to create the root of the tree.

Several standards generate and/or restricts the size of the seed: BIP39: 512 bit seeds BIP32: between 128 and 512 bits; 256 bits is advised SLIP10: follows BIP32

But since the seed entropy is always passed through HMAC-SHA512 any bytesequence is acceptable, therefore formally the size requirement is context sensitive.

Implementations§

source§

impl Seed

source

pub fn from_bytes(bs: &[u8]) -> Self

source

pub fn to_master_key<K: IsSecretKey>(&self) -> Slip10<K>

source

pub fn derive<K, I>(&self, chain: I) -> Slip10<K>
where K: IsSecretKey + WithSegment<<I as Iterator>::Item>, I: Iterator, <I as Iterator>::Item: Segment,

Trait Implementations§

source§

impl AsRef<[u8]> for Seed

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Debug for Seed

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Seed

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<K: IsSecretKey> From<&Seed> for Slip10<K>

source§

fn from(seed: &Seed) -> Self

Converts to this type from the input type.
source§

impl From<Seed> for Seed

source§

fn from(seed: Seed) -> Self

Converts to this type from the input type.
source§

impl Zeroize for Seed

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.

Auto Trait Implementations§

§

impl RefUnwindSafe for Seed

§

impl Send for Seed

§

impl Sync for Seed

§

impl Unpin for Seed

§

impl UnwindSafe for Seed

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA)
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.