Skip to content

Commit 6cae8af

Browse files
committed
Fixes
1 parent dbd6f51 commit 6cae8af

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/backends/plonky2/primitives/ec/curve.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ impl PointTarget {
287287
.cloned()
288288
.collect(),
289289
);
290-
ValueTarget::from_slice(&hash)
290+
ValueTarget::from_slice(&hash.elements)
291291
}
292292
}
293293

@@ -412,16 +412,16 @@ impl CircuitBuilderElliptic for CircuitBuilder<GoldilocksField, 2> {
412412
inputs.extend_from_slice(&p1.u.components);
413413
inputs.extend_from_slice(&p2.x.components);
414414
inputs.extend_from_slice(&p2.u.components);
415-
let mut outputs = ECAddHomog::apply(self, &inputs);
415+
let outputs = ECAddHomog::apply(self, &inputs);
416416
// plonky2 expects all gate constraints to be satisfied by the zero vector.
417417
// So our elliptic curve addition gate computes [x,z-b,u,t-b], and we have to add the b here.
418418
let x = FieldTarget::new(outputs[0..5].try_into().unwrap());
419419
let z = FieldTarget::new(outputs[5..10].try_into().unwrap());
420420
let u = FieldTarget::new(outputs[10..15].try_into().unwrap());
421421
let t = FieldTarget::new(outputs[15..20].try_into().unwrap());
422422
let b1 = self.constant(Point::B1);
423-
let z = self.nnf_add_scalar_times_generator_power(b1, 0, z);
424-
let t = self.nnf_add_scalar_times_generator_power(b1, 0, t);
423+
let z = self.nnf_add_scalar_times_generator_power(b1, 0, &z);
424+
let t = self.nnf_add_scalar_times_generator_power(b1, 0, &t);
425425
let xq = self.nnf_div(&x, &z);
426426
let uq = self.nnf_div(&u, &t);
427427
PointTarget { x: xq, u: uq }

src/backends/plonky2/primitives/ec/field.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl<const DEG: usize, NNF: OEF<DEG> + FieldExtension<DEG, BaseField = F>>
220220
// Add constraints and generate quotient.
221221
let maybe_one = self.nnf_mul(&y_inv, y);
222222
self.nnf_connect(&one, &maybe_one);
223-
self.nnf_mul(&x, &y_inv)
223+
self.nnf_mul(x, &y_inv)
224224
}
225225
fn nnf_mul_generator(&mut self, x: &OEFTarget<DEG, NNF>) -> OEFTarget<DEG, NNF> {
226226
OEFTarget::new(std::array::from_fn(|i| {

0 commit comments

Comments
 (0)