Struct ed25519_bip32::XPrv
source · [−]pub struct XPrv(_);
Expand description
HDWallet extended private key
Effectively this is an ed25519 extended secret key (64 bytes) followed by a chain code (32 bytes).
Implementations
takes the given raw bytes and perform some modifications to normalize to a valid Ed25519 extended key, but it does also force the 3rd highest bit to be cleared too.
Takes the given raw bytes and perform some modifications to normalize to a valid Ed25519 extended key. It doesn’t touch the 3rd highest bit as expected in the ed25519-bip32 paper.
Check if the 3rd highest bit is clear as expected from the paper
Clear the 3rd highest bit as expected from the paper setting
Takes a non-extended Ed25519 secret key and hash through SHA512 it in the same way the standard Ed25519 signature system make extended key, but also force clear the 3rd highest bit of the key instead of returning an error
Takes a non-extended Ed25519 secret key and hash through SHA512 it in the same way the standard Ed25519 signature system make extended key. If the 3rd highest bit is set, then return an error
bip32-ed25519 paper:
“2) We admit only those ~k such that the third highest bit of the last byte of kL is zero.”
create a XPrv
by its components (a 64 bytes extended secret key, and a 32 bytes chain code)
No verification is done on the extended secret key
Create a XPrv
by taking ownership of the given array
This function may returns an error if it does not have the expected format.
This function allow the 3rd highest bit to not be clear (to handle potential derived valid xprv), but self.is_3rd_highest_bit_clear() can be called to check if the 3rd highest bit is assumed to be clear or not.
verify a given signature
pub fn extended_secret_key_slice(&self) -> &[u8]ⓘ
pub fn chain_code_slice(&self) -> &[u8]ⓘ
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for XPrv
impl UnwindSafe for XPrv
Blanket Implementations
Mutably borrows from an owned value. Read more