pedersen_hash: removes debug prints

This commit is contained in:
Kobi Gurkan 2018-09-04 16:03:52 +03:00 committed by Jack Grigg
parent 4835be05b0
commit 43496857c9
No known key found for this signature in database
GPG Key ID: 9E8255172BBF9898
2 changed files with 0 additions and 32 deletions

View File

@ -154,7 +154,6 @@ where
Ok(tmp)
})?;
let one = CS::one();
// Compute the coefficients for the lookup constraints

View File

@ -26,7 +26,6 @@ where
assert_eq!(personalization.len(), 6);
let mut edwards_result = None;
//REVIEW: bit cloning
let mut bits = personalization.iter().chain(bits.iter()).peekable();
let mut segment_generators = params.pedersen_circuit_generators().iter();
let boolean_false = Boolean::constant(false);
@ -41,7 +40,6 @@ where
let b = bits.next().unwrap_or(&boolean_false);
let c = bits.next().unwrap_or(&boolean_false);
let tmp = lookup3_xy_with_conditional_negation(
cs.namespace(|| format!("segment {}, window {}", segment_i, window_i)),
&[a.clone(), b.clone(), c.clone()],
@ -209,33 +207,4 @@ mod test {
}
}
}
#[test]
fn test_pedersen_hash_alternative() {
let params = &JubjubBls12::new();
let mut input: Vec<bool> = vec![];
for i in 0..(63*3*4-6+1) {
input.push(true);
}
let mut cs = TestConstraintSystem::<Bls12>::new();
let input_bools: Vec<Boolean> = input.iter().enumerate().map(|(i, b)| {
Boolean::from(
AllocatedBit::alloc(cs.namespace(|| format!("input {}", i)), Some(*b)).unwrap()
)
}).collect();
let res = pedersen_hash(
cs.namespace(|| "pedersen hash"),
Personalization::Empty,
&input_bools,
params
).unwrap();
assert!(cs.is_satisfied());
println!("x={},y={}", res.get_x().get_value().unwrap(), res.get_y().get_value().unwrap());
}
}