mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-22 15:43:09 +00:00
Fixed bug and add division test in the base field.
This commit is contained in:
parent
21e7e8fdad
commit
54a15c012c
@ -300,7 +300,7 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
let degree_bits = log2_strict(degree);
|
||||
let subgroup = F::two_adic_subgroup(degree_bits);
|
||||
|
||||
let constant_vecs = self.constant_polys();
|
||||
let constant_vecs = self.constant_polys(&prefixed_gates);
|
||||
let constants_commitment =
|
||||
ListPolynomialCommitment::new(constant_vecs, self.config.fri_config.rate_bits, false);
|
||||
|
||||
|
||||
@ -373,6 +373,29 @@ mod tests {
|
||||
use crate::fri::FriConfig;
|
||||
use crate::witness::PartialWitness;
|
||||
|
||||
#[test]
|
||||
fn test_div() {
|
||||
type F = CrandallField;
|
||||
type FF = QuarticCrandallField;
|
||||
const D: usize = 4;
|
||||
|
||||
let config = CircuitConfig::large_config();
|
||||
|
||||
let mut builder = CircuitBuilder::<F, D>::new(config);
|
||||
|
||||
let x = F::rand();
|
||||
let y = F::rand();
|
||||
let z = x / y;
|
||||
let xt = builder.constant(x);
|
||||
let yt = builder.constant(y);
|
||||
let zt = builder.constant(z);
|
||||
let comp_zt = builder.div_unsafe(xt, yt);
|
||||
builder.assert_equal(zt, comp_zt);
|
||||
|
||||
let data = builder.build();
|
||||
let proof = data.prove(PartialWitness::new());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_div_extension() {
|
||||
type F = CrandallField;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user