diff --git a/src/circuit/mod.rs b/src/circuit/mod.rs index c40fefefa..1141d6644 100644 --- a/src/circuit/mod.rs +++ b/src/circuit/mod.rs @@ -5,7 +5,7 @@ pub mod boolean; pub mod uint32; pub mod blake2s; pub mod num; -pub mod mont; // TODO: rename +pub mod mont; pub mod pedersen_hash; use bellman::SynthesisError; diff --git a/src/circuit/mont.rs b/src/circuit/mont.rs index 9ff32fe04..f8b5c6142 100644 --- a/src/circuit/mont.rs +++ b/src/circuit/mont.rs @@ -27,7 +27,6 @@ use ::jubjub::{ }; pub struct EdwardsPoint { - // TODO: make these not pub pub x: AllocatedNum, pub y: AllocatedNum } @@ -107,7 +106,6 @@ impl EdwardsPoint { Ok(t0) }, None => { - // TODO: add more descriptive error Err(SynthesisError::AssignmentMissing) } } @@ -138,7 +136,6 @@ impl EdwardsPoint { Ok(t0) }, None => { - // TODO: add more descriptive error Err(SynthesisError::AssignmentMissing) } } @@ -188,7 +185,6 @@ impl MontgomeryPoint { Ok(t0) }, None => { - // TODO: add more descriptive error Err(SynthesisError::AssignmentMissing) } } @@ -215,7 +211,6 @@ impl MontgomeryPoint { Ok(t0) }, None => { - // TODO: add more descriptive error Err(SynthesisError::AssignmentMissing) } } @@ -375,7 +370,6 @@ impl MontgomeryPoint { Ok(n) }, None => { - // TODO: add more descriptive error Err(SynthesisError::AssignmentMissing) } } diff --git a/src/circuit/pedersen_hash.rs b/src/circuit/pedersen_hash.rs index c05d61724..3b0dc4578 100644 --- a/src/circuit/pedersen_hash.rs +++ b/src/circuit/pedersen_hash.rs @@ -42,6 +42,9 @@ pub fn pedersen_hash( ) -> Result, SynthesisError> where CS: ConstraintSystem { + // Unnecessary if forced personalization is introduced + assert!(bits.len() > 0); + let mut edwards_result = None; let mut bits = bits.iter(); let mut segment_generators = params.pedersen_circuit_generators().iter(); @@ -118,7 +121,6 @@ pub fn pedersen_hash( segment_i += 1; } - // TODO: maybe assert bits.len() > 0 Ok(edwards_result.unwrap()) } @@ -131,10 +133,6 @@ fn lookup3_xy_with_conditional_negation( ) -> Result<(AllocatedNum, AllocatedNum), SynthesisError> where CS: ConstraintSystem { - // TODO: This can be made into a 2-constraint lookup - // if it can return linear combinations rather than - // allocated numbers. - assert_eq!(bits.len(), 3); assert_eq!(coords.len(), 4); diff --git a/src/jubjub/mod.rs b/src/jubjub/mod.rs index 40cfd3ca7..34859ce6d 100644 --- a/src/jubjub/mod.rs +++ b/src/jubjub/mod.rs @@ -108,7 +108,6 @@ impl JubjubBls12 { let mut cur = 0; let mut pedersen_hash_generators = vec![]; - // TODO: pre-generate the right amount while pedersen_hash_generators.len() < 10 { let gh = group_hash(&[cur], &tmp); cur += 1; diff --git a/src/pedersen_hash.rs b/src/pedersen_hash.rs index 9885b25d4..0bbf7a9ff 100644 --- a/src/pedersen_hash.rs +++ b/src/pedersen_hash.rs @@ -58,7 +58,6 @@ pub fn pedersen_hash( break; } - // TODO: use wNAF or something let mut tmp = generators.next().expect("we don't have enough generators").clone(); tmp = tmp.mul(acc, params); result = result.add(&tmp, params);