-
Notifications
You must be signed in to change notification settings - Fork 1k
Add Ethereum-compatible aliases for BLS12-381 #4186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from 3 commits
1a443fe
67b0fbb
7f3fe50
dc9b374
1f82a9b
be21a84
3f69ba9
9607bd7
b6fb04b
5f4dbe5
2e8378c
434c62e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,6 +97,14 @@ public static InteropInterface Bls12381Add(InteropInterface x, InteropInterface | |
| }; | ||
| } | ||
|
|
||
| [ContractMethod(Hardfork.HF_Gorgon, CpuFee = 1 << 19, Name = "bls12_g1add")] | ||
| public static InteropInterface Bls12G1Add(InteropInterface x, InteropInterface y) | ||
| => Bls12381Add(x, y); | ||
|
||
|
|
||
| [ContractMethod(Hardfork.HF_Gorgon, CpuFee = 1 << 19, Name = "bls12_g2add")] | ||
| public static InteropInterface Bls12G2Add(InteropInterface x, InteropInterface y) | ||
| => Bls12381Add(x, y); | ||
|
|
||
| /// <summary> | ||
| /// Mul operation of gt point and multiplier | ||
| /// </summary> | ||
|
|
@@ -119,6 +127,14 @@ public static InteropInterface Bls12381Mul(InteropInterface x, byte[] mul, bool | |
| }; | ||
| } | ||
|
|
||
| [ContractMethod(Hardfork.HF_Gorgon, CpuFee = 1 << 21, Name = "bls12_g1mul")] | ||
| public static InteropInterface Bls12G1Mul(InteropInterface x, byte[] mul, bool neg) | ||
| => Bls12381Mul(x, mul, neg); | ||
|
|
||
| [ContractMethod(Hardfork.HF_Gorgon, CpuFee = 1 << 21, Name = "bls12_g2mul")] | ||
| public static InteropInterface Bls12G2Mul(InteropInterface x, byte[] mul, bool neg) | ||
| => Bls12381Mul(x, mul, neg); | ||
|
|
||
| /// <summary> | ||
| /// Pairing operation of g1 and g2 | ||
| /// </summary> | ||
|
|
@@ -142,5 +158,9 @@ public static InteropInterface Bls12381Pairing(InteropInterface g1, InteropInter | |
| }; | ||
| return new(Bls12.Pairing(in g1a, in g2a)); | ||
| } | ||
|
|
||
| [ContractMethod(Hardfork.HF_Gorgon, CpuFee = 1 << 23, Name = "bls12_pairing")] | ||
| public static InteropInterface Bls12Pairing(InteropInterface g1, InteropInterface g2) | ||
| => Bls12381Pairing(g1, g2); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be
HF_FaunThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should be Faun