Skip to content

Commit d556a4b

Browse files
committed
fix test import after curves have a new version
1 parent b44242e commit d556a4b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/groups/curves/short_weierstrass/non_zero_affine.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -242,24 +242,24 @@ mod test_non_zero_affine {
242242
use ark_ec::{models::short_weierstrass::SWCurveConfig, CurveGroup};
243243
use ark_relations::r1cs::ConstraintSystem;
244244
use ark_std::{vec::Vec, One};
245-
use ark_test_curves::bls12_381::{g1::Parameters as G1Parameters, Fq};
245+
use ark_test_curves::bls12_381::{g1::Config as G1Config, Fq};
246246

247247
#[test]
248248
fn correctness_test_1() {
249249
let cs = ConstraintSystem::<Fq>::new_ref();
250250

251251
let x = FpVar::Var(
252-
AllocatedFp::<Fq>::new_witness(cs.clone(), || Ok(G1Parameters::GENERATOR.x)).unwrap(),
252+
AllocatedFp::<Fq>::new_witness(cs.clone(), || Ok(G1Config::GENERATOR.x)).unwrap(),
253253
);
254254
let y = FpVar::Var(
255-
AllocatedFp::<Fq>::new_witness(cs.clone(), || Ok(G1Parameters::GENERATOR.y)).unwrap(),
255+
AllocatedFp::<Fq>::new_witness(cs.clone(), || Ok(G1Config::GENERATOR.y)).unwrap(),
256256
);
257257

258258
// The following code uses `double` and `add` (`add_unchecked`) to compute
259259
// (1 + 2 + ... + 2^9) G
260260

261261
let sum_a = {
262-
let mut a = ProjectiveVar::<G1Parameters, FpVar<Fq>>::new(
262+
let mut a = ProjectiveVar::<G1Config, FpVar<Fq>>::new(
263263
x.clone(),
264264
y.clone(),
265265
FpVar::Constant(Fq::one()),
@@ -283,7 +283,7 @@ mod test_non_zero_affine {
283283
};
284284

285285
let sum_b = {
286-
let mut a = NonZeroAffineVar::<G1Parameters, FpVar<Fq>>::new(x, y);
286+
let mut a = NonZeroAffineVar::<G1Config, FpVar<Fq>>::new(x, y);
287287

288288
let mut double_sequence = Vec::new();
289289
double_sequence.push(a.clone());
@@ -310,15 +310,15 @@ mod test_non_zero_affine {
310310
let cs = ConstraintSystem::<Fq>::new_ref();
311311

312312
let x = FpVar::Var(
313-
AllocatedFp::<Fq>::new_witness(cs.clone(), || Ok(G1Parameters::GENERATOR.x)).unwrap(),
313+
AllocatedFp::<Fq>::new_witness(cs.clone(), || Ok(G1Config::GENERATOR.x)).unwrap(),
314314
);
315315
let y = FpVar::Var(
316-
AllocatedFp::<Fq>::new_witness(cs.clone(), || Ok(G1Parameters::GENERATOR.y)).unwrap(),
316+
AllocatedFp::<Fq>::new_witness(cs.clone(), || Ok(G1Config::GENERATOR.y)).unwrap(),
317317
);
318318

319319
// The following code tests `double_and_add`.
320320
let sum_a = {
321-
let a = ProjectiveVar::<G1Parameters, FpVar<Fq>>::new(
321+
let a = ProjectiveVar::<G1Config, FpVar<Fq>>::new(
322322
x.clone(),
323323
y.clone(),
324324
FpVar::Constant(Fq::one()),
@@ -336,7 +336,7 @@ mod test_non_zero_affine {
336336
};
337337

338338
let sum_b = {
339-
let a = NonZeroAffineVar::<G1Parameters, FpVar<Fq>>::new(x, y);
339+
let a = NonZeroAffineVar::<G1Config, FpVar<Fq>>::new(x, y);
340340

341341
let mut cur = a.double().unwrap();
342342
for _ in 1..10 {
@@ -356,22 +356,22 @@ mod test_non_zero_affine {
356356
let cs = ConstraintSystem::<Fq>::new_ref();
357357

358358
let x = FpVar::Var(
359-
AllocatedFp::<Fq>::new_witness(cs.clone(), || Ok(G1Parameters::GENERATOR.x)).unwrap(),
359+
AllocatedFp::<Fq>::new_witness(cs.clone(), || Ok(G1Config::GENERATOR.x)).unwrap(),
360360
);
361361
let y = FpVar::Var(
362-
AllocatedFp::<Fq>::new_witness(cs.clone(), || Ok(G1Parameters::GENERATOR.y)).unwrap(),
362+
AllocatedFp::<Fq>::new_witness(cs.clone(), || Ok(G1Config::GENERATOR.y)).unwrap(),
363363
);
364364

365-
let a = NonZeroAffineVar::<G1Parameters, FpVar<Fq>>::new(x, y);
365+
let a = NonZeroAffineVar::<G1Config, FpVar<Fq>>::new(x, y);
366366

367367
let n = 10;
368368

369-
let a_multiples: Vec<NonZeroAffineVar<G1Parameters, FpVar<Fq>>> =
369+
let a_multiples: Vec<NonZeroAffineVar<G1Config, FpVar<Fq>>> =
370370
std::iter::successors(Some(a.clone()), |acc| Some(acc.add_unchecked(&a).unwrap()))
371371
.take(n)
372372
.collect();
373373

374-
let all_equal: Vec<NonZeroAffineVar<G1Parameters, FpVar<Fq>>> = (0..n / 2)
374+
let all_equal: Vec<NonZeroAffineVar<G1Config, FpVar<Fq>>> = (0..n / 2)
375375
.map(|i| {
376376
a_multiples[i]
377377
.add_unchecked(&a_multiples[n - i - 1])

0 commit comments

Comments
 (0)