mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-07-30 20:11:23 +00:00
Move from Field::negate to Neg operator
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
use ff::Field;
|
||||
use pairing::Engine;
|
||||
use std::ops::{AddAssign, MulAssign, SubAssign};
|
||||
use std::ops::{AddAssign, MulAssign, Neg, SubAssign};
|
||||
|
||||
use bellman::{ConstraintSystem, SynthesisError};
|
||||
|
||||
@@ -367,7 +367,7 @@ impl<E: JubjubEngine> EdwardsPoint<E> {
|
||||
let y3 = AllocatedNum::alloc(cs.namespace(|| "y3"), || {
|
||||
let mut t0 = *a.get_value().get()?;
|
||||
t0.double();
|
||||
t0.negate();
|
||||
t0 = t0.neg();
|
||||
t0.add_assign(t.get_value().get()?);
|
||||
|
||||
let mut t1 = E::Fr::one();
|
||||
@@ -642,7 +642,7 @@ impl<E: JubjubEngine> MontgomeryPoint<E> {
|
||||
t0.sub_assign(self.x.get_value().get()?);
|
||||
t0.mul_assign(lambda.get_value().get()?);
|
||||
t0.add_assign(self.y.get_value().get()?);
|
||||
t0.negate();
|
||||
t0 = t0.neg();
|
||||
|
||||
Ok(t0)
|
||||
})?;
|
||||
|
@@ -5,7 +5,7 @@ use bellman::{
|
||||
use ff::Field;
|
||||
use pairing::bls12_381::{Bls12, Fr};
|
||||
use rand_core::OsRng;
|
||||
use std::ops::AddAssign;
|
||||
use std::ops::{AddAssign, Neg};
|
||||
use zcash_primitives::{
|
||||
jubjub::{edwards, fs::Fs, FixedGenerators, JubjubBls12, Unknown},
|
||||
primitives::{Diversifier, Note, PaymentAddress, ProofGenerationKey, ValueCommitment},
|
||||
@@ -202,8 +202,7 @@ impl SaplingProvingContext {
|
||||
|
||||
// Accumulate the value commitment randomness in the context
|
||||
{
|
||||
let mut tmp = rcv;
|
||||
tmp.negate(); // Outputs subtract from the total.
|
||||
let mut tmp = rcv.neg(); // Outputs subtract from the total.
|
||||
tmp.add_assign(&self.bsk);
|
||||
|
||||
// Update the context
|
||||
|
Reference in New Issue
Block a user