pub fn new_master(network: Network, seed: &[u8]) -> Result<ExtendedPrivKey, Error> {
        let mut hmac_engine: HmacEngine<sha512::Hash> = HmacEngine::new(b"Bitcoin seed");
        hmac_engine.input(seed);
        let hmac_result: Hmac<sha512::Hash> = Hmac::from_engine(hmac_engine);

        Ok(ExtendedPrivKey {
            network: network,
            depth: 0,
            parent_fingerprint: Default::default(),
            child_number: ChildNumber::from_normal_idx(0)?,
            private_key: PrivateKey {
                compressed: true,
                network: network,
                key: secp256k1::SecretKey::from_slice(
                    &hmac_result[..32]
                ).map_err(Error::Ecdsa)?,
            },
            chain_code: ChainCode::from(&hmac_result[32..]),
        })
    }
/// Construct a new master key from a seed value
Construct a new master key from a seed value
Construct a new master key from a seed value
pub fn new_master(network: Network, seed: &[u8]) -> Result<ExtendedPrivKey, Error> {
        let mut hmac_engine: HmacEngine<sha512::Hash> = HmacEngine::new(b"Bitcoin seed");
        hmac_engine.input(seed);
        let hmac_result: Hmac<sha512::Hash> = Hmac::from_engine(hmac_engine);
        Ok(ExtendedPrivKey {
            network: network,
            depth: 0,
            parent_fingerprint: Default::default(),
            child_number: ChildNumber::from_normal_idx(0)?,
            private_key: PrivateKey {
                compressed: true,
                network: network,
                key: secp256k1::SecretKey::from_slice(
                    &hmac_result[..32]
                ).map_err(Error::Ecdsa)?,
            },
            chain_code: ChainCode::from(&hmac_result[32..]),
        })
    }
pub fn new_master ( network : Network , seed : & [ u8 ] ) -> Result < ExtendedPrivKey , Error > { let mut hmac_engine : HmacEngine < sha512 :: Hash > = HmacEngine :: new ( b" " ) ; hmac_engine . input ( seed ) ; let hmac_result : Hmac < sha512 :: Hash > = Hmac :: from_engine ( hmac_engine ) ; Ok ( ExtendedPrivKey { network : network , depth : 0 , parent_fingerprint : Default :: default ( ) , child_number : ChildNumber :: from_normal_idx ( 0 ) ? , private_key : PrivateKey { compressed : true , network : network , key : secp256k1 :: SecretKey :: from_slice ( & hmac_result [ .. 32 ] ) . map_err ( Error :: Ecdsa ) ? , } , chain_code : ChainCode :: from ( & hmac_result [ 32 .. ] ) , } ) }
Construct a new master key from a seed value
Construct a new master key from a seed value
network
Network
seed
&[u8]
network
Network
seed
&[u8]