File tree Expand file tree Collapse file tree 1 file changed +18
-30
lines changed
extensions/ecc/tests/programs/examples Expand file tree Collapse file tree 1 file changed +18
-30
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,7 @@ use openvm_ecc_guest::{
1111 CyclicGroup , Group ,
1212} ;
1313
14- moduli_init ! {
15- "57896044618658097711785492504343953926634992332820282019728792003956564819949" ,
16- }
17-
18- te_init ! {
19- Ed25519Point ,
20- }
14+ openvm:: init!( "openvm_init_edwards_ec_ed25519.rs" ) ;
2115
2216openvm:: entry!( main) ;
2317
@@ -48,29 +42,23 @@ pub fn main() {
4842 "1BCA918096D89C83A15105DF343DC9F7510494407750226DAC0A7620ACE77BEB"
4943 ) ) ;
5044
51- // TODO: delete debugging code
52- let p3 = Ed25519Point :: from_xy ( x3, y3) . unwrap ( ) ;
53- let p4 = Ed25519Point :: from_xy ( x4, y4) . unwrap ( ) ;
54- let _a = & p1 + & p2;
55- let _b = & p3 + & p4;
56-
5745 // Generic add can handle equal or unequal points.
58- // let p3 = &p1 + &p2;
59- // if p3.x() != &x3 || p3.y() != &y3 {
60- // panic!();
61- // }
62- // let p4 = &p2 + &p2;
63- // if p4.x() != &x4 || p4.y() != &y4 {
64- // panic!();
65- // }
46+ let p3 = & p1 + & p2;
47+ if p3. x ( ) != & x3 || p3. y ( ) != & y3 {
48+ panic ! ( ) ;
49+ }
50+ let p4 = & p2 + & p2;
51+ if p4. x ( ) != & x4 || p4. y ( ) != & y4 {
52+ panic ! ( ) ;
53+ }
6654
67- // // Add assign and double assign
68- // p1 += &p2;
69- // if p1.x() != &x3 || p1.y() != &y3 {
70- // panic!();
71- // }
72- // p2.double_assign();
73- // if p2.x() != &x4 || p2.y() != &y4 {
74- // panic!();
75- // }
55+ // Add assign and double assign
56+ p1 += & p2;
57+ if p1. x ( ) != & x3 || p1. y ( ) != & y3 {
58+ panic ! ( ) ;
59+ }
60+ p2. double_assign ( ) ;
61+ if p2. x ( ) != & x4 || p2. y ( ) != & y4 {
62+ panic ! ( ) ;
63+ }
7664}
You can’t perform that action at this time.
0 commit comments