File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ impl InnerProductProof {
2828 /// The `verifier` is passed in as a parameter so that the
2929 /// challenges depend on the *entire* transcript (including parent
3030 /// protocols).
31+ ///
32+ /// The lengths of the vectors must all be the same, and must all be
33+ /// either 0 or a power of 2.
3134 pub fn create < I > (
3235 verifier : & mut ProofTranscript ,
3336 Q : & RistrettoPoint ,
@@ -57,6 +60,9 @@ impl InnerProductProof {
5760 assert_eq ! ( a. len( ) , n) ;
5861 assert_eq ! ( b. len( ) , n) ;
5962
63+ // All of the input vectors must have a length that is a power of two.
64+ assert ! ( n. is_power_of_two( ) ) ;
65+
6066 // XXX save these scalar mults by unrolling them into the
6167 // first iteration of the loop below
6268 for ( H_i , h_i) in H . iter_mut ( ) . zip ( Hprime_factors . into_iter ( ) ) {
You can’t perform that action at this time.
0 commit comments