[][src]Trait grin_keychain::extkey_bip32::BIP32Hasher

pub trait BIP32Hasher {
    fn network_priv(&self) -> [u8; 4];
fn network_pub(&self) -> [u8; 4];
fn master_seed() -> [u8; 12];
fn init_sha512(&mut self, seed: &[u8]);
fn append_sha512(&mut self, value: &[u8]);
fn result_sha512(&mut self) -> [u8; 64];
fn sha_256(&self, input: &[u8]) -> [u8; 32];
fn ripemd_160(&self, input: &[u8]) -> [u8; 20]; }

Allow different implementations of hash functions used in BIP32 Derivations Grin uses blake2 everywhere but the spec calls for SHA512/Ripemd160, so allow this in future and allow us to unit test against published BIP32 test vectors The function names refer to the place of the hash in the reference BIP32 spec, not what the actual implementation is

Required methods

fn network_priv(&self) -> [u8; 4]

fn network_pub(&self) -> [u8; 4]

fn master_seed() -> [u8; 12]

fn init_sha512(&mut self, seed: &[u8])

fn append_sha512(&mut self, value: &[u8])

fn result_sha512(&mut self) -> [u8; 64]

fn sha_256(&self, input: &[u8]) -> [u8; 32]

fn ripemd_160(&self, input: &[u8]) -> [u8; 20]

Loading content...

Implementors

impl BIP32Hasher for BIP32GrinHasher[src]

Loading content...