pub fn from_bytes(bytes: &[u8; 32]) -> CtOption<Fq> {
        let mut tmp = Fq([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;

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

        CtOption::new(tmp, Choice::from(is_some))
    }
/// Attempts to convert a little-endian byte representation of
/// a scalar into a `Fq`, failing if the input is not canonical.
Attempts to convert a little-endian byte representation of
a scalar into a `Fq`, failing if the input is not canonical.
Attempts to convert a little - endian byte representation of a scalar into a ` Fq ` failing if the input is not canonical .
pub fn from_bytes(bytes: &[u8; 32]) -> CtOption<Fq> {
        let mut tmp = Fq([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;
        // Convert to Montgomery form by computing
        // (a.R^0 * R^2) / R = a.R
        tmp *= &R2;
        CtOption::new(tmp, Choice::from(is_some))
    }
pub fn from_bytes ( bytes : & [ u8 ; 32 ] ) -> CtOption < Fq > { let mut tmp = Fq ( [ 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 ; // Convert to Montgomery form by computing // (a.R^0 * R^2) / R = a.R tmp *= & R2 ; CtOption :: new ( tmp , Choice :: from ( is_some ) ) }
Attempts to convert a little-endian byte representation of
a scalar into a `Fq`, failing if the input is not canonical.
Attempts to convert a little - endian byte representation of a scalar into a ` Fq ` failing if the input is not canonical .
bytes
&[u8; 32]