Skip to content

Commit 75ee196

Browse files
authored
Merge pull request #225 from isislovecruft/fix/update-rustc-pin
update rustc pin
2 parents 80ecce4 + 6752acf commit 75ee196

File tree

8 files changed

+51
-61
lines changed

8 files changed

+51
-61
lines changed

benches/r1cs.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ use merlin::Transcript;
1616
extern crate rand;
1717
use rand::Rng;
1818

19-
/*
19+
/*
2020
K-SHUFFLE GADGET SPECIFICATION:
2121
2222
Represents a permutation of a list of `k` scalars `{x_i}` into a list of `k` scalars `{y_i}`.
2323
24-
Algebraically it can be expressed as a statement that for a free variable `z`,
24+
Algebraically it can be expressed as a statement that for a free variable `z`,
2525
the roots of the two polynomials in terms of `z` are the same up to a permutation:
2626
2727
∏(x_i - z) == ∏(y_i - z)
2828
29-
Prover can commit to blinded scalars `x_i` and `y_i` then receive a random challenge `z`,
29+
Prover can commit to blinded scalars `x_i` and `y_i` then receive a random challenge `z`,
3030
and build a proof that the above relation holds.
3131
3232
K-shuffle requires `2*(K-1)` multipliers.
@@ -226,7 +226,7 @@ fn kshuffle_prove_17(c: &mut Criterion) {
226226
kshuffle_prove_helper(17, c);
227227
}
228228

229-
criterion_group!{
229+
criterion_group! {
230230
name = kshuffle_prove;
231231
config = Criterion::default();
232232
targets =
@@ -290,7 +290,7 @@ fn kshuffle_verify_17(c: &mut Criterion) {
290290
kshuffle_verify_helper(17, c);
291291
}
292292

293-
criterion_group!{
293+
criterion_group! {
294294
name = kshuffle_verify;
295295
config = Criterion::default();
296296
targets =

benches/range_proof.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ fn verify_aggregated_rangeproof_n_64(c: &mut Criterion) {
118118
verify_aggregated_rangeproof_helper(64, c);
119119
}
120120

121-
criterion_group!{
121+
criterion_group! {
122122
name = create_rp;
123123
config = Criterion::default().sample_size(10);
124124
targets =
@@ -128,7 +128,7 @@ criterion_group!{
128128
create_aggregated_rangeproof_n_64,
129129
}
130130

131-
criterion_group!{
131+
criterion_group! {
132132
name = verify_rp;
133133
config = Criterion::default();
134134
targets =

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2018-10-01
1+
nightly-2018-12-04

src/errors.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ pub enum MPCError {
8383
WrongNumProofShares,
8484
/// This error occurs when one or more parties submit malformed
8585
/// proof shares.
86-
#[fail(
87-
display = "Malformed proof shares from parties {:?}",
88-
bad_shares
89-
)]
86+
#[fail(display = "Malformed proof shares from parties {:?}", bad_shares)]
9087
MalformedProofShares {
9188
/// A vector with the indexes of the parties whose shares were malformed.
9289
bad_shares: Vec<usize>,

src/inner_product_proof.rs

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -444,35 +444,31 @@ mod tests {
444444
);
445445

446446
let mut verifier = Transcript::new(b"innerproducttest");
447-
assert!(
448-
proof
449-
.verify(
450-
n,
451-
&mut verifier,
452-
util::exp_iter(y_inv).take(n),
453-
&P,
454-
&Q,
455-
&G,
456-
&H
457-
)
458-
.is_ok()
459-
);
447+
assert!(proof
448+
.verify(
449+
n,
450+
&mut verifier,
451+
util::exp_iter(y_inv).take(n),
452+
&P,
453+
&Q,
454+
&G,
455+
&H
456+
)
457+
.is_ok());
460458

461459
let proof = InnerProductProof::from_bytes(proof.to_bytes().as_slice()).unwrap();
462460
let mut verifier = Transcript::new(b"innerproducttest");
463-
assert!(
464-
proof
465-
.verify(
466-
n,
467-
&mut verifier,
468-
util::exp_iter(y_inv).take(n),
469-
&P,
470-
&Q,
471-
&G,
472-
&H
473-
)
474-
.is_ok()
475-
);
461+
assert!(proof
462+
.verify(
463+
n,
464+
&mut verifier,
465+
util::exp_iter(y_inv).take(n),
466+
&P,
467+
&Q,
468+
&G,
469+
&H
470+
)
471+
.is_ok());
476472
}
477473

478474
#[test]

src/r1cs/prover.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,14 @@ impl<'a, 'b> ProverCS<'a, 'b> {
276276
lc.terms
277277
.iter()
278278
.map(|(var, coeff)| {
279-
coeff * match var {
280-
Variable::MultiplierLeft(i) => self.a_L[*i],
281-
Variable::MultiplierRight(i) => self.a_R[*i],
282-
Variable::MultiplierOutput(i) => self.a_O[*i],
283-
Variable::Committed(i) => self.v[*i],
284-
Variable::One() => Scalar::one(),
285-
}
279+
coeff
280+
* match var {
281+
Variable::MultiplierLeft(i) => self.a_L[*i],
282+
Variable::MultiplierRight(i) => self.a_R[*i],
283+
Variable::MultiplierOutput(i) => self.a_O[*i],
284+
Variable::Committed(i) => self.v[*i],
285+
Variable::One() => Scalar::one(),
286+
}
286287
})
287288
.sum()
288289
}

src/range_proof/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -567,11 +567,9 @@ mod tests {
567567
// 4. Verify with the same customization label as above
568568
let mut transcript = Transcript::new(b"AggregatedRangeProofTest");
569569

570-
assert!(
571-
proof
572-
.verify_multiple(&bp_gens, &pc_gens, &mut transcript, &value_commitments, n)
573-
.is_ok()
574-
);
570+
assert!(proof
571+
.verify_multiple(&bp_gens, &pc_gens, &mut transcript, &value_commitments, n)
572+
.is_ok());
575573
}
576574
}
577575

tests/r1cs.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,15 @@ fn kshuffle_helper(k: usize) {
158158

159159
{
160160
let mut verifier_transcript = Transcript::new(b"ShuffleProofTest");
161-
assert!(
162-
proof
163-
.verify(
164-
&pc_gens,
165-
&bp_gens,
166-
&mut verifier_transcript,
167-
&input_commitments,
168-
&output_commitments
169-
)
170-
.is_ok()
171-
);
161+
assert!(proof
162+
.verify(
163+
&pc_gens,
164+
&bp_gens,
165+
&mut verifier_transcript,
166+
&input_commitments,
167+
&output_commitments
168+
)
169+
.is_ok());
172170
}
173171
}
174172

0 commit comments

Comments
 (0)