mirror of
https://github.com/arnaucube/Nova.git
synced 2026-01-19 04:11:31 +01:00
chore: update to ff/group 0.13 (#166)
* chore: update to ff/group 0.13 and associated dependencies Updates: - zkcrypto/ff, zkcrypto/group to 0.13, - bellperson to 0.25, - pasta_curves to 0.5.1, and removes the fil_pasta_curves fork - pasta-msm should no longer need a fork (WIP) Adapts source in function, mostly for const usage and API updates. * expose the portable feature of pasta-MSM * update pointer to pasta-msm * Clippy --------- Co-authored-by: François Garillot <francois@garillot.net>
This commit is contained in:
@@ -20,7 +20,7 @@ mod tests {
|
||||
cs: &mut CS,
|
||||
) -> Result<(), SynthesisError> {
|
||||
// get two bits as input and check that they are indeed bits
|
||||
let a = AllocatedNum::alloc(cs.namespace(|| "a"), || Ok(Fr::one()))?;
|
||||
let a = AllocatedNum::alloc(cs.namespace(|| "a"), || Ok(Fr::ONE))?;
|
||||
let _ = a.inputize(cs.namespace(|| "a is input"));
|
||||
cs.enforce(
|
||||
|| "check a is 0 or 1",
|
||||
@@ -28,7 +28,7 @@ mod tests {
|
||||
|lc| lc + a.get_variable(),
|
||||
|lc| lc,
|
||||
);
|
||||
let b = AllocatedNum::alloc(cs.namespace(|| "b"), || Ok(Fr::one()))?;
|
||||
let b = AllocatedNum::alloc(cs.namespace(|| "b"), || Ok(Fr::ONE))?;
|
||||
let _ = b.inputize(cs.namespace(|| "b is input"));
|
||||
cs.enforce(
|
||||
|| "check b is 0 or 1",
|
||||
|
||||
@@ -102,7 +102,7 @@ fn add_constraint<S: PrimeField>(
|
||||
) {
|
||||
let (A, B, C, nn) = X;
|
||||
let n = **nn;
|
||||
let one = S::one();
|
||||
let one = S::ONE;
|
||||
|
||||
let add_constraint_component = |index: Index, coeff, V: &mut Vec<_>| {
|
||||
match index {
|
||||
|
||||
@@ -73,7 +73,7 @@ fn proc_lc<Scalar: PrimeField>(
|
||||
for (var, &coeff) in terms.iter() {
|
||||
map
|
||||
.entry(OrderedVariable(var))
|
||||
.or_insert_with(Scalar::zero)
|
||||
.or_insert_with(|| Scalar::ZERO)
|
||||
.add_assign(&coeff);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ where
|
||||
writeln!(s, "INPUT {}", &input).unwrap()
|
||||
}
|
||||
|
||||
let negone = -<G::Scalar>::one();
|
||||
let negone = -<G::Scalar>::ONE;
|
||||
|
||||
let powers_of_two = (0..G::Scalar::NUM_BITS)
|
||||
.map(|i| G::Scalar::from(2u64).pow_vartime([u64::from(i)]))
|
||||
@@ -161,7 +161,7 @@ where
|
||||
}
|
||||
is_first = false;
|
||||
|
||||
if coeff != <G::Scalar>::one() && coeff != negone {
|
||||
if coeff != <G::Scalar>::ONE && coeff != negone {
|
||||
for (i, x) in powers_of_two.iter().enumerate() {
|
||||
if x == &coeff {
|
||||
write!(s, "2^{i} . ").unwrap();
|
||||
|
||||
@@ -91,7 +91,7 @@ where
|
||||
type Root = Self;
|
||||
|
||||
fn new() -> Self {
|
||||
let input_assignment = vec![G::Scalar::one()];
|
||||
let input_assignment = vec![G::Scalar::ONE];
|
||||
let mut d = DensityTracker::new();
|
||||
d.add_element();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user