mirror of https://github.com/zcash/halo2.git
Use `From<u64>` instead of `FieldExt::from_u64`
This commit is contained in:
parent
0e6b0344f5
commit
a5a3c8ca63
|
@ -292,14 +292,14 @@ impl<F: Group + Field> Mul<F> for Value<F> {
|
|||
/// layouter.assign_region(|| "Example region", |mut region| {
|
||||
/// config.s.enable(&mut region, 0)?;
|
||||
/// region.assign_advice(|| "a", config.a, 0, || {
|
||||
/// self.a.map(|v| F::from_u64(v)).ok_or(Error::SynthesisError)
|
||||
/// self.a.map(|v| F::from(v)).ok_or(Error::SynthesisError)
|
||||
/// })?;
|
||||
/// region.assign_advice(|| "b", config.b, 0, || {
|
||||
/// self.b.map(|v| F::from_u64(v)).ok_or(Error::SynthesisError)
|
||||
/// self.b.map(|v| F::from(v)).ok_or(Error::SynthesisError)
|
||||
/// })?;
|
||||
/// region.assign_advice(|| "c", config.c, 0, || {
|
||||
/// self.a
|
||||
/// .and_then(|a| self.b.map(|b| F::from_u64(a * b)))
|
||||
/// .and_then(|a| self.b.map(|b| F::from(a * b)))
|
||||
/// .ok_or(Error::SynthesisError)
|
||||
/// })?;
|
||||
/// Ok(())
|
||||
|
|
|
@ -106,8 +106,8 @@ impl<G: Group> EvaluationDomain<G> {
|
|||
// We invert in a batch, below.
|
||||
}
|
||||
|
||||
let mut ifft_divisor = G::Scalar::from_u64(1 << k); // Inversion computed later
|
||||
let mut extended_ifft_divisor = G::Scalar::from_u64(1 << extended_k); // Inversion computed later
|
||||
let mut ifft_divisor = G::Scalar::from(1 << k); // Inversion computed later
|
||||
let mut extended_ifft_divisor = G::Scalar::from(1 << extended_k); // Inversion computed later
|
||||
|
||||
// The barycentric weight of 1 over the evaluation domain
|
||||
// 1 / \prod_{i != 0} (1 - omega^i)
|
||||
|
|
|
@ -379,7 +379,7 @@ fn plonk_api() {
|
|||
}
|
||||
}
|
||||
|
||||
let a = Fp::from_u64(2834758237) * Fp::ZETA;
|
||||
let a = Fp::from(2834758237) * Fp::ZETA;
|
||||
let instance = Fp::one() + Fp::one();
|
||||
let lookup_table = vec![instance, a, a, Fp::zero()];
|
||||
|
||||
|
|
Loading…
Reference in New Issue