INNER CODE UNIT · Rust
from
pluto/ronkathon · src/algebra/field/extension/mod.rs:170
fn from(value: PrimeField<P>) -> Self {
let mut coeffs = [PrimeField::<P>::ZERO; N];
coeffs[0] = value;
Self { coeffs }
}
}
/// Convert from a [`u32`] into the [`GaloisField`] field element in the natural way.
impl<const N: usize, const P: usize> From<u32> for GaloisField<N, P> {
fn from(val: u32) -> Self { Self::from(PrimeField::<P>::from(val)) }
}
/// Convert from a [`u64`] into the [`GaloisField`] field element in the natural way.
impl<const N: usize, const P: usize> From<u64> for GaloisField<N, P> {
fn from(val: u64) -> Self { Self::from(PrimeField::<P>::from(val)) }
}
/// Convert from a [`usize`] into the [`GaloisField`] field element in the natural way.