[][src]Struct ed25519_bip32::XPrv

pub struct XPrv(_);

HDWallet extended private key

Effectively this is ed25519 extended secret key (64 bytes) followed by a chain code (32 bytes)

Methods

impl XPrv[src]

pub fn normalize_bytes(bytes: [u8; 96]) -> Self[src]

takes the given raw bytes and perform some modifications to normalize to a valid XPrv.

pub fn from_nonextended(bytes: [u8; 32], chain_code: [u8; 32]) -> Self[src]

Takes a non-extended ed25519 key and hash through SHA512 it in the same way the standard Ed25519 signature system make extended key, but also clean the 3rd highest bit of the key as described in the paper

pub fn from_bytes_verified(bytes: [u8; 96]) -> Result<Self, PrivateKeyError>[src]

Create a XPrv by taking ownership of the given array

This function may returns an error if it does not have the expected format.

pub fn from_slice_verified(bytes: &[u8]) -> Result<Self, PrivateKeyError>[src]

pub fn public(&self) -> XPub[src]

Get the associated XPub

pub fn sign<T>(&self, message: &[u8]) -> Signature<T>[src]

sign the given message with the XPrv.

pub fn verify<T>(&self, message: &[u8], signature: &Signature<T>) -> bool[src]

verify a given signature

pub fn derive(&self, scheme: DerivationScheme, index: DerivationIndex) -> Self[src]

pub fn get_extended(&self, out: &mut [u8; 64])[src]

Trait Implementations

impl Drop for XPrv[src]

impl Eq for XPrv[src]

impl Clone for XPrv[src]

impl AsRef<[u8]> for XPrv[src]

impl PartialEq<XPrv> for XPrv[src]

impl From<XPrv> for [u8; 96][src]

impl Debug for XPrv[src]

impl Display for XPrv[src]

Auto Trait Implementations

impl Send for XPrv

impl Unpin for XPrv

impl Sync for XPrv

impl UnwindSafe for XPrv

impl RefUnwindSafe for XPrv

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]