pub fn from_bytes(bytes: &[u8]) -> Result<Self, AtmsError> {
        let mut u64_bytes = [0u8; 4];
        u64_bytes.copy_from_slice(&bytes[..4]);
        let non_signers = usize::try_from(u32::from_be_bytes(u64_bytes))
            .expect("Library should be built in 32 bit targets or higher");

        let aggregate = Signature::from_bytes(&bytes[4..])?;
        let mut keys: Vec<PublicKey> = Vec::with_capacity(non_signers);

        for i in 0..non_signers {
            let pk_offset = 100 + i * 48;
            let pk = PublicKey::from_bytes(&bytes[pk_offset..])?;

            keys.push(pk);
        }

        let batch_proof = if non_signers > 0 {
            let proof_offset = 100 + non_signers * 48;
            Some(BatchPath::from_bytes(&bytes[proof_offset..])?)
        } else {
            None
        };

        Ok(Self {
            aggregate,
            keys,
            batch_proof,
        })
    }
/// Deserialise a byte string to an `AggregateSig`.
Deserialise a byte string to an `AggregateSig`.
Deserialise a byte string to an ` AggregateSig ` .
pub fn from_bytes(bytes: &[u8]) -> Result<Self, AtmsError> {
        let mut u64_bytes = [0u8; 4];
        u64_bytes.copy_from_slice(&bytes[..4]);
        let non_signers = usize::try_from(u32::from_be_bytes(u64_bytes))
            .expect("Library should be built in 32 bit targets or higher");
        let aggregate = Signature::from_bytes(&bytes[4..])?;
        let mut keys: Vec<PublicKey> = Vec::with_capacity(non_signers);
        for i in 0..non_signers {
            let pk_offset = 100 + i * 48;
            let pk = PublicKey::from_bytes(&bytes[pk_offset..])?;
            keys.push(pk);
        }
        let batch_proof = if non_signers > 0 {
            let proof_offset = 100 + non_signers * 48;
            Some(BatchPath::from_bytes(&bytes[proof_offset..])?)
        } else {
            None
        };
        Ok(Self {
            aggregate,
            keys,
            batch_proof,
        })
    }
pub fn from_bytes ( bytes : & [ u8 ] ) -> Result < Self , AtmsError > { let mut u64_bytes = [ 0u8 ; 4 ] ; u64_bytes . copy_from_slice ( & bytes [ .. 4 ] ) ; let non_signers = usize :: try_from ( u32 :: from_be_bytes ( u64_bytes ) ) . expect ( " " ) ; let aggregate = Signature :: from_bytes ( & bytes [ 4 .. ] ) ? ; let mut keys : Vec < PublicKey > = Vec :: with_capacity ( non_signers ) ; for i in 0 .. non_signers { let pk_offset = 100 + i * 48 ; let pk = PublicKey :: from_bytes ( & bytes [ pk_offset .. ] ) ? ; keys . push ( pk ) ; } let batch_proof = if non_signers > 0 { let proof_offset = 100 + non_signers * 48 ; Some ( BatchPath :: from_bytes ( & bytes [ proof_offset .. ] ) ? ) } else { None } ; Ok ( Self { aggregate , keys , batch_proof , } ) }
Deserialise a byte string to an `AggregateSig`.
Deserialise a byte string to an ` AggregateSig ` .
bytes
&[u8]