fn from_bytes(bytes: &[u8; Self::SIZE]) -> Result<Self, Self::Error> {
        let mut tmp = Fr([0, 0, 0, 0]);

        tmp.0[0] = u64::from_le_bytes(bytes[0..8].try_into().unwrap());
        tmp.0[1] = u64::from_le_bytes(bytes[8..16].try_into().unwrap());
        tmp.0[2] = u64::from_le_bytes(bytes[16..24].try_into().unwrap());
        tmp.0[3] = u64::from_le_bytes(bytes[24..32].try_into().unwrap());

        // Try to subtract the modulus
        let (_, borrow) = sbb(tmp.0[0], MODULUS.0[0], 0);
        let (_, borrow) = sbb(tmp.0[1], MODULUS.0[1], borrow);
        let (_, borrow) = sbb(tmp.0[2], MODULUS.0[2], borrow);
        let (_, borrow) = sbb(tmp.0[3], MODULUS.0[3], borrow);

        // If the element is smaller than MODULUS then the
        // subtraction will underflow, producing a borrow value
        // of 0xffff...ffff. Otherwise, it'll be zero.
        let is_some = (borrow as u8) & 1;

        if is_some == 0 {
            return Err(BytesError::InvalidData);
        }

        // Convert to Montgomery form by computing
        // (a.R^0 * R^2) / R = a.R
        tmp *= &R2;

        Ok(tmp)
    }
/// Attempts to convert a little-endian byte representation of
/// a field element into an element of `Fr`, failing if the input
/// is not canonical (is not smaller than r).
Attempts to convert a little-endian byte representation of
a field element into an element of `Fr`, failing if the input
is not canonical (is not smaller than r).
Attempts to convert a little - endian byte representation of a field element into an element of ` Fr ` failing if the input is not canonical ( is not smaller than r ) .
fn from_bytes(bytes: &[u8; Self::SIZE]) -> Result<Self, Self::Error> {
        let mut tmp = Fr([0, 0, 0, 0]);
        tmp.0[0] = u64::from_le_bytes(bytes[0..8].try_into().unwrap());
        tmp.0[1] = u64::from_le_bytes(bytes[8..16].try_into().unwrap());
        tmp.0[2] = u64::from_le_bytes(bytes[16..24].try_into().unwrap());
        tmp.0[3] = u64::from_le_bytes(bytes[24..32].try_into().unwrap());
        // Try to subtract the modulus
        let (_, borrow) = sbb(tmp.0[0], MODULUS.0[0], 0);
        let (_, borrow) = sbb(tmp.0[1], MODULUS.0[1], borrow);
        let (_, borrow) = sbb(tmp.0[2], MODULUS.0[2], borrow);
        let (_, borrow) = sbb(tmp.0[3], MODULUS.0[3], borrow);
        // If the element is smaller than MODULUS then the
        // subtraction will underflow, producing a borrow value
        // of 0xffff...ffff. Otherwise, it'll be zero.
        let is_some = (borrow as u8) & 1;
        if is_some == 0 {
            return Err(BytesError::InvalidData);
        }
        // Convert to Montgomery form by computing
        // (a.R^0 * R^2) / R = a.R
        tmp *= &R2;
        Ok(tmp)
    }
fn from_bytes ( bytes : & [ u8 ; Self :: SIZE ] ) -> Result < Self , Self :: Error > { let mut tmp = Fr ( [ 0 , 0 , 0 , 0 ] ) ; tmp . 0 [ 0 ] = u64 :: from_le_bytes ( bytes [ 0 .. 8 ] . try_into ( ) . unwrap ( ) ) ; tmp . 0 [ 1 ] = u64 :: from_le_bytes ( bytes [ 8 .. 16 ] . try_into ( ) . unwrap ( ) ) ; tmp . 0 [ 2 ] = u64 :: from_le_bytes ( bytes [ 16 .. 24 ] . try_into ( ) . unwrap ( ) ) ; tmp . 0 [ 3 ] = u64 :: from_le_bytes ( bytes [ 24 .. 32 ] . try_into ( ) . unwrap ( ) ) ; // Try to subtract the modulus let ( _ , borrow ) = sbb ( tmp . 0 [ 0 ] , MODULUS . 0 [ 0 ] , 0 ) ; let ( _ , borrow ) = sbb ( tmp . 0 [ 1 ] , MODULUS . 0 [ 1 ] , borrow ) ; let ( _ , borrow ) = sbb ( tmp . 0 [ 2 ] , MODULUS . 0 [ 2 ] , borrow ) ; let ( _ , borrow ) = sbb ( tmp . 0 [ 3 ] , MODULUS . 0 [ 3 ] , borrow ) ; // If the element is smaller than MODULUS then the // subtraction will underflow, producing a borrow value // of 0xffff...ffff. Otherwise, it'll be zero. let is_some = ( borrow as u8 ) & 1 ; if is_some == 0 { return Err ( BytesError :: InvalidData ) ; } // Convert to Montgomery form by computing // (a.R^0 * R^2) / R = a.R tmp *= & R2 ; Ok ( tmp ) }
Attempts to convert a little-endian byte representation of
a field element into an element of `Fr`, failing if the input
is not canonical (is not smaller than r).
Attempts to convert a little - endian byte representation of a field element into an element of ` Fr ` failing if the input is not canonical ( is not smaller than r ) .
bytes
&[u8; Self::SIZE]