-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial integration with elliptic curves without hashing and serialisation * Restore hashing functionality * Abstract Jacobian coordinates * Attempt to integrate galois-field-0.4 and elliptic-curve-0.2 * Refactor all square roots and Y from X functions * Relocate field and curve parameters and refactor conjugation and scalar multiplication * Remove redundant tests and reorganise tests layout * Remove redundant benchmarks and reorganise benchmarks layout * Refactor Shallue-van de Woestijne encoding * Update benchmarks * Restore serialisation codebase * Update change log and remove dependencies * Update elliptic-curve version * Remove redundant hashToG1 commented code
- Loading branch information
Showing
33 changed files
with
1,104 additions
and
2,175 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
module HashBenchmarks where | ||
|
||
import Protolude | ||
|
||
import Criterion.Main | ||
import Pairing.Hash | ||
|
||
benchmarkHash :: Benchmark | ||
benchmarkHash = bgroup "Hash" | ||
[ bgroup "Hash to G1" | ||
[ bench "swEncBN" | ||
$ whnfIO (swEncBN test_hash) | ||
] | ||
] | ||
|
||
test_hash :: ByteString | ||
test_hash = "TyqIPUBYojDVOnDPacfMGrGOzpaQDWD3KZCpqzLhpE4A3kRUCQFUx040Ok139J8WDVV2C99Sfge3G20Q8MEgu23giWmqRxqOc8pH" |
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,12 @@ | ||
module Main where | ||
|
||
import Protolude | ||
|
||
import Criterion.Main | ||
|
||
import HashBenchmarks | ||
import PairingBenchmarks | ||
|
||
main :: IO () | ||
main = defaultMain | ||
[benchmarkHash, benchmarkPairing] |
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,34 @@ | ||
module PairingBenchmarks where | ||
|
||
import Protolude | ||
|
||
import Control.Monad.Random | ||
import Criterion.Main | ||
import GaloisField | ||
import Pairing.Curve | ||
import Pairing.Pairing | ||
|
||
benchmarkPairing :: Benchmark | ||
benchmarkPairing = bgroup "Pairing" | ||
[ bgroup "Frobenius in Fq12" | ||
[ bench "naive" | ||
$ whnf (frobeniusNaive 1) testFq12 | ||
, bench "fast" | ||
$ whnf (fq12Frobenius 1) testFq12 | ||
] | ||
, bgroup "Final exponentiation" | ||
[ bench "naive" | ||
$ whnf finalExponentiationNaive testFq12 | ||
, bench "fast" | ||
$ whnf finalExponentiation testFq12 | ||
] | ||
, bgroup "Pairing" | ||
[ bench "without final exponentiation" | ||
$ whnf (uncurry atePairing) (gG1, gG2) | ||
, bench "with final exponentiation" | ||
$ whnf (uncurry reducedPairing) (gG1, gG2) | ||
] | ||
] | ||
|
||
testFq12 :: Fq12 | ||
testFq12 = evalRand rnd (mkStdGen 0) |
Oops, something went wrong.