mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-07 08:13:11 +00:00
fix
This commit is contained in:
parent
f67e12ee64
commit
12d5239be6
@ -95,6 +95,16 @@ impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
AffinePointTarget { x: x3, y: y3 }
|
||||
}
|
||||
|
||||
pub fn curve_repeated_double<C: Curve>(&mut self, p: &AffinePointTarget<C>, n: usize) -> AffinePointTarget<C> {
|
||||
let mut result = p.clone();
|
||||
|
||||
for _ in 0..n {
|
||||
result = self.curve_double(&result);
|
||||
}
|
||||
|
||||
result
|
||||
}
|
||||
|
||||
// Add two points, which are assumed to be non-equal.
|
||||
pub fn curve_add<C: Curve>(
|
||||
&mut self,
|
||||
|
||||
@ -82,7 +82,7 @@ impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
let windows = self.split_nonnative_to_4_bit_limbs(n);
|
||||
let m = C::ScalarField::BITS / WINDOW_SIZE;
|
||||
for i in (0..m).rev() {
|
||||
result = self.curve_double(&result);
|
||||
result = self.curve_repeated_double(&result, WINDOW_SIZE);
|
||||
let window = windows[i];
|
||||
|
||||
let to_add = self.random_access_curve_points(window, precomputation.clone());
|
||||
@ -147,7 +147,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_curve_mul_windowed() -> Result<()> {
|
||||
fn test_curve_windowed_mul() -> Result<()> {
|
||||
const D: usize = 2;
|
||||
type C = PoseidonGoldilocksConfig;
|
||||
type F = <C as GenericConfig<D>>::F;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user