mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-07-30 20:11:23 +00:00
Make Field::double take &self and return Self
This commit is contained in:
@@ -340,7 +340,7 @@ impl<E: JubjubEngine> EdwardsPoint<E> {
|
||||
// Compute x3 = (2.A) / (1 + C)
|
||||
let x3 = AllocatedNum::alloc(cs.namespace(|| "x3"), || {
|
||||
let mut t0 = *a.get_value().get()?;
|
||||
t0.double();
|
||||
t0 = t0.double();
|
||||
|
||||
let mut t1 = E::Fr::one();
|
||||
t1.add_assign(c.get_value().get()?);
|
||||
@@ -366,8 +366,7 @@ impl<E: JubjubEngine> EdwardsPoint<E> {
|
||||
// Compute y3 = (U - 2.A) / (1 - C)
|
||||
let y3 = AllocatedNum::alloc(cs.namespace(|| "y3"), || {
|
||||
let mut t0 = *a.get_value().get()?;
|
||||
t0.double();
|
||||
t0 = t0.neg();
|
||||
t0 = t0.double().neg();
|
||||
t0.add_assign(t.get_value().get()?);
|
||||
|
||||
let mut t1 = E::Fr::one();
|
||||
|
@@ -245,7 +245,7 @@ impl<'a, E: JubjubEngine> Circuit<E> for Spend<'a, E> {
|
||||
let mut coeff = E::Fr::one();
|
||||
for bit in &value_bits {
|
||||
value_num = value_num.add_bool_with_coeff(CS::one(), bit, coeff);
|
||||
coeff.double();
|
||||
coeff = coeff.double();
|
||||
}
|
||||
|
||||
// Place the value in the note
|
||||
|
@@ -268,7 +268,7 @@ impl NoteValue {
|
||||
let mut coeff = E::Fr::one();
|
||||
for b in &self.bits {
|
||||
tmp = tmp + (coeff, b.get_variable());
|
||||
coeff.double();
|
||||
coeff = coeff.double();
|
||||
}
|
||||
|
||||
tmp
|
||||
|
Reference in New Issue
Block a user