pub fn from_bytes(slice: &[u8]) -> Result<RangeProof, RangeProofError> {
        if slice.len() % 32 != 0 {
            return Err(RangeProofError::Format);
        }
        if slice.len() < 7 * 32 {
            return Err(RangeProofError::Format);
        }

        let A = CompressedRistretto(util::read32(&slice[0..]));
        let S = CompressedRistretto(util::read32(&slice[32..]));
        let T_1 = CompressedRistretto(util::read32(&slice[2 * 32..]));
        let T_2 = CompressedRistretto(util::read32(&slice[3 * 32..]));

        let t_x = Scalar::from_canonical_bytes(util::read32(&slice[4 * 32..]))
            .ok_or(RangeProofError::Format)?;
        let t_x_blinding = Scalar::from_canonical_bytes(util::read32(&slice[5 * 32..]))
            .ok_or(RangeProofError::Format)?;
        let e_blinding = Scalar::from_canonical_bytes(util::read32(&slice[6 * 32..]))
            .ok_or(RangeProofError::Format)?;

        let ipp_proof = InnerProductProof::from_bytes(&slice[7 * 32..])?;

        Ok(RangeProof {
            A,
            S,
            T_1,
            T_2,
            t_x,
            t_x_blinding,
            e_blinding,
            ipp_proof,
        })
    }
// Following the dalek rangeproof library signature for now. The exact method signature can be
// changed.
Following the dalek rangeproof library signature for now. The exact method signature can be
changed.
Following the dalek rangeproof library signature for now . The exact method signature can be changed .
pub fn from_bytes(slice: &[u8]) -> Result<RangeProof, RangeProofError> {
        if slice.len() % 32 != 0 {
            return Err(RangeProofError::Format);
        }
        if slice.len() < 7 * 32 {
            return Err(RangeProofError::Format);
        }
        let A = CompressedRistretto(util::read32(&slice[0..]));
        let S = CompressedRistretto(util::read32(&slice[32..]));
        let T_1 = CompressedRistretto(util::read32(&slice[2 * 32..]));
        let T_2 = CompressedRistretto(util::read32(&slice[3 * 32..]));
        let t_x = Scalar::from_canonical_bytes(util::read32(&slice[4 * 32..]))
            .ok_or(RangeProofError::Format)?;
        let t_x_blinding = Scalar::from_canonical_bytes(util::read32(&slice[5 * 32..]))
            .ok_or(RangeProofError::Format)?;
        let e_blinding = Scalar::from_canonical_bytes(util::read32(&slice[6 * 32..]))
            .ok_or(RangeProofError::Format)?;
        let ipp_proof = InnerProductProof::from_bytes(&slice[7 * 32..])?;
        Ok(RangeProof {
            A,
            S,
            T_1,
            T_2,
            t_x,
            t_x_blinding,
            e_blinding,
            ipp_proof,
        })
    }
pub fn from_bytes ( slice : & [ u8 ] ) -> Result < RangeProof , RangeProofError > { if slice . len ( ) % 32 != 0 { return Err ( RangeProofError :: Format ) ; } if slice . len ( ) < 7 * 32 { return Err ( RangeProofError :: Format ) ; } let A = CompressedRistretto ( util :: read32 ( & slice [ 0 .. ] ) ) ; let S = CompressedRistretto ( util :: read32 ( & slice [ 32 .. ] ) ) ; let T_1 = CompressedRistretto ( util :: read32 ( & slice [ 2 * 32 .. ] ) ) ; let T_2 = CompressedRistretto ( util :: read32 ( & slice [ 3 * 32 .. ] ) ) ; let t_x = Scalar :: from_canonical_bytes ( util :: read32 ( & slice [ 4 * 32 .. ] ) ) . ok_or ( RangeProofError :: Format ) ? ; let t_x_blinding = Scalar :: from_canonical_bytes ( util :: read32 ( & slice [ 5 * 32 .. ] ) ) . ok_or ( RangeProofError :: Format ) ? ; let e_blinding = Scalar :: from_canonical_bytes ( util :: read32 ( & slice [ 6 * 32 .. ] ) ) . ok_or ( RangeProofError :: Format ) ? ; let ipp_proof = InnerProductProof :: from_bytes ( & slice [ 7 * 32 .. ] ) ? ; Ok ( RangeProof { A , S , T_1 , T_2 , t_x , t_x_blinding , e_blinding , ipp_proof , } ) }
Following the dalek rangeproof library signature for now.
Following the dalek rangeproof library signature for now .
slice
&[u8]