pub fn from_bytes(bytes: &[u8]) -> Option<Self> {
        if bytes.len() != 64 {
            return None;
        }

        let precompressed_pubkey = CompressedRistretto::from_slice(&bytes[..32]);
        let mut dk = [0u8; 32];
        dk.copy_from_slice(&bytes[32..]);

        let point = match precompressed_pubkey.decompress() {
            Some(p) => p,
            None => return None,
        };

        Some(Xpub {
            point,
            dk,
            precompressed_pubkey,
        })
    }
/// Decodes an Xpub from a 64-byte array, and fails if the provided array is not
/// exactly 64 bytes, or if the compressed point fails to decompress.
Decodes an Xpub from a 64-byte array, and fails if the provided array is not
exactly 64 bytes, or if the compressed point fails to decompress.
Decodes an Xpub from a 64 - byte array and fails if the provided array is not exactly 64 bytes or if the compressed point fails to decompress .
pub fn from_bytes(bytes: &[u8]) -> Option<Self> {
        if bytes.len() != 64 {
            return None;
        }
        let precompressed_pubkey = CompressedRistretto::from_slice(&bytes[..32]);
        let mut dk = [0u8; 32];
        dk.copy_from_slice(&bytes[32..]);
        let point = match precompressed_pubkey.decompress() {
            Some(p) => p,
            None => return None,
        };
        Some(Xpub {
            point,
            dk,
            precompressed_pubkey,
        })
    }
pub fn from_bytes ( bytes : & [ u8 ] ) -> Option < Self > { if bytes . len ( ) != 64 { return None ; } let precompressed_pubkey = CompressedRistretto :: from_slice ( & bytes [ .. 32 ] ) ; let mut dk = [ 0u8 ; 32 ] ; dk . copy_from_slice ( & bytes [ 32 .. ] ) ; let point = match precompressed_pubkey . decompress ( ) { Some ( p ) => p , None => return None , } ; Some ( Xpub { point , dk , precompressed_pubkey , } ) }
Decodes an Xpub from a 64-byte array, and fails if the provided array is not
exactly 64 bytes, or if the compressed point fails to decompress.
Decodes an Xpub from a 64 - byte array and fails if the provided array is not exactly 64 bytes or if the compressed point fails to decompress .
bytes
&[u8]
bytes
&[u8]