INNER CODE UNIT · Rust

from

pluto/ronkathon · src/algebra/field/extension/mod.rs:179

  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.
impl<const N: usize, const P: usize> From<usize> for GaloisField<N, P> {
  fn from(val: usize) -> Self { Self::from(PrimeField::<P>::from(val)) }
}

impl<const N: usize, const P: usize> From<GaloisField<N, P>> for usize {
  fn from(value: GaloisField<N, P>) -> Self { value.coeffs[0].value }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…