File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -156,8 +156,9 @@ impl G1Projective {
156156
157157impl G1Projective {
158158 // http://koclab.cs.ucsb.edu/teaching/ccs130h/2018/09projective.pdf
159+ /// Caution: Use this function only if P != +- Q
159160 #[ component]
160- pub fn add_montgomery < C : CircuitContext > (
161+ pub ( crate ) fn add_montgomery < C : CircuitContext > (
161162 circuit : & mut C ,
162163 p : & G1Projective ,
163164 q : & G1Projective ,
@@ -391,6 +392,9 @@ impl G1Projective {
391392 ) ) ;
392393 }
393394
395+ // given two bases M and N which were both known in compile time,
396+ // user can not find non-zero scalars 'a' and 'b' that should give [a]M = [b]N
397+ // The problem would be DLOG hard
394398 let mut acc = to_be_added[ 0 ] . clone ( ) ;
395399 for add in to_be_added. iter ( ) . skip ( 1 ) {
396400 let new_acc = Self :: add_montgomery ( circuit, & acc, add) ;
Original file line number Diff line number Diff line change @@ -207,6 +207,7 @@ impl G2Projective {
207207
208208impl G2Projective {
209209 // http://koclab.cs.ucsb.edu/teaching/ccs130h/2018/09projective.pdf
210+ /// Caution: Use this function only if P != +- Q
210211 #[ component]
211212 pub fn add_montgomery < C : CircuitContext > (
212213 circuit : & mut C ,
Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ pub fn groth16_verify<C: CircuitContext>(
8080
8181 // Add the constant term gamma_abc_g1[0] in Montgomery form
8282 let gamma0_m = G1Projective :: as_montgomery ( vk. gamma_abc_g1 [ 0 ] . into_group ( ) ) ;
83+ // gamma0_m is known in compile time, user can not find a value of `msm_temp` that's equal to `gamma0_m`
84+ // The problem would be DLOG hard
8385 let msm =
8486 G1Projective :: add_montgomery ( circuit, & msm_temp, & G1Projective :: new_constant ( & gamma0_m) ) ;
8587
You can’t perform that action at this time.
0 commit comments