Cache fewer pedersen hash generators.

This commit is contained in:
Sean Bowe 2018-03-06 09:03:29 -07:00
parent 7a9879eb54
commit 63c6830429
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
2 changed files with 2 additions and 2 deletions

View File

@ -149,7 +149,7 @@ mod test {
let mut rng = XorShiftRng::from_seed([0x3dbe6259, 0x8d313d76, 0x3237db17, 0xe5bc0654]);
let params = &JubjubBls12::new();
for length in 1..1000 {
for length in 0..751 {
for _ in 0..5 {
let mut input: Vec<bool> = (0..length).map(|_| rng.gen()).collect();

View File

@ -185,7 +185,7 @@ impl JubjubBls12 {
let mut cur = 0;
let mut pedersen_hash_generators = vec![];
while pedersen_hash_generators.len() < 10 {
while pedersen_hash_generators.len() < 5 {
let gh = group_hash(&[cur], ::PEDERSEN_HASH_GENERATORS_PERSONALIZATION, &tmp);
// We don't want to overflow and start reusing generators
assert!(cur != u8::max_value());