-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating separate module for bn128-operations
- Loading branch information
1 parent
e11a532
commit 30cbad9
Showing
3 changed files
with
27 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
BN128 curve operations. These functions are part of the operations introduced in EIP-197, aimed at representing operations performed by precompiled contracts that operate on the elliptic curve alt_bn128. | ||
|
||
```k | ||
module BN128-OPERATIONS | ||
imports EVM | ||
syntax Bool ::= isValidPointSymbolic(G1Point) [function, total, no-evaluators, smtlib(isValidG1Point)] | ||
rule isValidPoint(G) => isValidPointSymbolic(G) [priority(30)] | ||
syntax G1Point ::= BN128MulOp(G1Point, Int) [function, total, smtlib(BN128Mul)] | ||
rule BN128Mul(G, I) => BN128MulOp(G:G1Point, I:Int) [priority(30)] | ||
rule BN128MulOp((PA:Int, PB:Int):G1Point, I:Int) => (PA *Int I , PB *Int I):G1Point | ||
syntax G1Point ::= BN128AddOp(G1Point, G1Point) [function, total, smtlib(BN128Add)] | ||
rule BN128Add(PA, PB) => BN128AddOp(PA, PB) [priority(30)] | ||
rule BN128AddOp((PAA:Int, PAB:Int):G1Point, (PBA:Int, PBB:Int):G1Point) => (PAA +Int PBA , PAB +Int PBB):G1Point | ||
``` | ||
|
||
```k | ||
endmodule | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters