pub fn from_reduced_big_uint(value: &BigUint) -> Result<Self, ByteConversionError>
    where
        Self: ByteConversion,
        F: IsPrimeField,
    {
        let mod_minus_one = F::modulus_minus_one().to_string();

        // We check if `mod_minus_one` is a hex string or a decimal string.
        // In case it is a hex we remove the prefix `0x`.
        let (digits, radix) = if let Some(hex) = mod_minus_one
            .strip_prefix("0x")
            .or_else(|| mod_minus_one.strip_prefix("0X"))
        {
            (hex, 16)
        } else {
            (mod_minus_one.as_str(), 10)
        };

        let modulus =
            BigUint::from_str_radix(digits, radix).expect("invalid modulus representation") + 1u32;

        if value >= &modulus {
            Err(ByteConversionError::ValueNotReduced)
        } else {
            let mut bytes = value.to_bytes_le();
            // We pad the bytes to the size of the base type to be able to apply `from_bytes_le`.
            bytes.resize(core::mem::size_of::<F::BaseType>(), 0);
            Self::from_bytes_le(&bytes)
        }
    }
Creates a field element from a BigUint that is smaller than the modulus.
Returns error if the value is bigger than the modulus.
crates/math/src/field/element.rs