mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-15 12:13:08 +00:00
Minor
This commit is contained in:
parent
90df0d9d3a
commit
47523c086a
@ -15,10 +15,10 @@ impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
// TODO: Benchmark other window sizes.
|
||||
pub fn fixed_base_curve_mul<C: Curve>(
|
||||
&mut self,
|
||||
base: &AffinePoint<C>,
|
||||
base: AffinePoint<C>,
|
||||
scalar: &NonNativeTarget<C::ScalarField>,
|
||||
) -> AffinePointTarget<C> {
|
||||
let doubled_base = (0..scalar.value.limbs.len() * 8).scan(*base, |acc, _| {
|
||||
let doubled_base = (0..scalar.value.limbs.len() * 8).scan(base, |acc, _| {
|
||||
let tmp = *acc;
|
||||
for _ in 0..4 {
|
||||
*acc = acc.double();
|
||||
@ -91,7 +91,7 @@ mod tests {
|
||||
let n_target = builder.add_virtual_nonnative_target::<Secp256K1Scalar>();
|
||||
pw.set_biguint_target(&n_target.value, &n.to_canonical_biguint());
|
||||
|
||||
let res_target = builder.fixed_base_curve_mul(&g, &n_target);
|
||||
let res_target = builder.fixed_base_curve_mul(g, &n_target);
|
||||
builder.curve_assert_valid(&res_target);
|
||||
|
||||
builder.connect_affine_point(&res_target, &res_expected);
|
||||
|
||||
@ -37,7 +37,7 @@ impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
let u1 = self.mul_nonnative(&msg, &c);
|
||||
let u2 = self.mul_nonnative(&r, &c);
|
||||
|
||||
let point1 = self.fixed_base_curve_mul(&Secp256K1::GENERATOR_AFFINE, &u1);
|
||||
let point1 = self.fixed_base_curve_mul(Secp256K1::GENERATOR_AFFINE, &u1);
|
||||
let point2 = self.glv_mul(&pk.0, &u2);
|
||||
let point = self.curve_add(&point1, &point2);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user