keep-starknet-strange / garaga

State-of-the-art Elliptic Curve operations and SNARKS verification for Cairo & Starknet 🐺.
https://felt.gitbook.io/garaga
MIT License
181 stars 39 forks source link

Feat-bn254-precompiles-contract #57

Closed tekkac closed 1 year ago

tekkac commented 1 year ago

Closes #56

feltroidprime commented 1 year ago

please add array support similarly to the precompile https://www.evm.codes/precompiled#0x08?fork=merge Notice that the imaginary part is presented first for E2 elements, ie e = i*a1 + a0, unlike garaga. Parse then the array indexes in the correct order to fill the BigInt3 values and pointers.

Also, after research, the best way to construct pointers of structs of pointers can be seen here in this example : https://github.com/keep-starknet-strange/garaga/blob/ff01c02173f5cf74e5d7a8915593065b4f543a22/src/bn254/towers/e2.cairo#L178-L206

tempvar x: Struct* = new Struct (new S(a), new S(b)), produces more overhead and should be avoided. Better to use local x:Struct = Struct(&a, &b); return &x.

github-actions[bot] commented 1 year ago

There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale. This PR will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!