From 996c7fc8c9b3d9efa6890344d641a1cb7d5d591c Mon Sep 17 00:00:00 2001 From: Kenneth MacKenzie Date: Thu, 1 Jun 2023 16:31:39 +0100 Subject: [PATCH] Kwxm/bls12-381/prototype (PLT-192, PLT-1557, PLT-1554, etc). (#5231) * Initial version of BLS pairing builtins * WIP * WIP * WIP: implementations of GT operations * Tidy up instances * More-or-less complete implementation for UPLC * Initial costing benchmarks for BLS builtins * Update benchmarks * Update R code * Forgot source files * Wrong denotation for GT_mul * Partial updates to CreateBuiltinCostModel * Fix typos in function names * Update memory models for BLS12_381 builtins * Update memory models for BLS12_381 builtins * WIP * Rename BLS (de)serialise -> (un)compress * Reformat * inline-r workaround; corrections to cost model generation code * inline-r workaround * Update cost model tests for BLS functions * Update benching results and cost model file for BLS * Update benching results and cost model file for BLS * Update comment * Update comment * Add some extra stuff for the benefit of the QuickCheck shrinker * Add new builtins to plutus-tx * Add a few Haskell BLS examples * WIP * Update cabal file * Merge master * WIP * Update BLS throughput benchmarks * Update cost model for uncompress vs deserialise * Update BSL benchmark program * WIP * Nix weirdness * Updates after merge * Add Groth16 verification example * Tidying up; get rid of SourceSpans * Minor updates * Minor updates * Add proper Criterion benchmarks * Tidying up * Moved file * Forgot cabal file * Fix typo * Update comment * Fix cabal version constraints * Add missing cases for geqStep * Update deriving methods * WIP: property tests * Add Plutus versions of most of the property tests * Tidy up the test code a bit * Use folds for repeated addition; adjust sizes of test inputs * Better folding * Update FFI code to new version * Name change: millerLoop -> pairing * Reorganise files * Tidy up * Tidy up * More tidying up * Add comment * Abstraction for BLS property tests * Tidying up * WIP * Incorporate Inigo's updates * Banish Hedgehog * Add conformance tests for BLS12-381 constants * Add BLS12-381 addition conformance tests * Add BLS12-381 equality conformance tests * Add BLS12-381 negation conformance tests * Update comment on cofactors * More conformance tests * Correct test name * Add BLS12-381 scalar multiplication conformance tests * Remark about source of data for Groth16 verification example * Add BLS12-381 pairing operation conformance tests * Update comment in BLS12-381 peoperty tests * Update comment in BLS12-381 peoperty tests * Typo in file name * Fix types in bls-sizes executable * Update names in costing benchmark CSV file * Update names of built-in types and functions in plutus-core * Update names in conformance tests * Update BLS names in plutus-tx-plugin * Remove parser for MlResult; fix Groth16 example * Tidy up the Groth16 example * Update versions in plutus-benchmark.cabal * applyCode -> unsafeApplyCode after PLT-1552 * Update comment * Minor formatting updates * Make plutus-metatheory work with the BLS builtins to some extent * Fix incorrect test * Exclude failing BLS12-381 Agda tests * Exclude failing BLS12-381 Agda tests * Add property test for periodicity of scalar multiplication * Minor code rearrangement * Import scalarPeriod for tests * Add more property tests for BLS compression * Add conformance tests for BLS scalar mulitplication periodicity * Add descirptive comments to the BLS conformance tests * Improve printing of known builtins when parser encounters an unknown one * Reorganise files containing cryptographic functions * Reorganise Crypto files * hashToCurve -> hashToGroup * Adjust spacing in print-builtin-signatures * Justification * Attempt to update to work with iohk-nix version of libblst * Merge Mauro's metatheory updates * Update to new version of BLS bindings * Update to new version of BLS bindings * Update to new version of BLS bindings * Merge Mauro's metatheory improvements * Still trying to get libblst to work with nix * More informative BLS names in metatheory * Update some comments * Get BSL sizes from blst * Pairing.pairing -> Pairing.millerLoop * Backpatch cost model * Turn on immediate warnings in R * Restore golden budget results after cost model backpatch * Attempt to fix plututs-ledger-api version tests * Restore comment * Add comment * Fix name of plutus-tx-plugin-tests * Improve comments * Extend comments * Reformat comments * Add comments to ignore cbits * Comments on costing benchmarks * Tidying up * Add some more comments * Add changelog entries for BLS12-381 modifications * Remove unnecessary changelog directories from unversioned packages * Update plutus-core/plutus-core/src/PlutusCore/Parser/Builtin.hs Co-authored-by: Michael Peyton Jones * Address some PR comments * Crypto -> PlutusCore.Crypto for stuff we've defined * Address some more PR comments * Update metatheory for package name change * Update metatheory for package name change * Update version numbers in cabal file * Update BLS branch to work with merged version of BLS bindings in cardano-base * Remove commented-out Haskell code in plutus-metatheory * Missing cases in metatheory * Missing cases in metatheory * Missing cases in metatheory * Missing cases in metatheory * Missing cases in metatheory * Reorder constructors in ledger-api cost model interface * Update the comments about wrapping BLS12-381 types * Remove Haskell property tests for BLS12-381 (tested in cardano-base) * Refactoring * Refactoring * Remove some stuff that was left in accidentally * Remove empty lines * Resolve merge problems * Fix comment * Delete unused boilerplate from changelog entry * Update cabal file * Fix alignment * Address some PR comments * Address some PR comments * fromIntegral -> fromSatInt * GHC.Tick -> GHC.HpcTick * Trying to get rid of wrong version of Expr.hs in plutus-tx-plugin * Add missing golden files * Fix weird results in TypeSynthesis/Golden/Bls12* * Try to fix blst * Add BLS builtins to metatheory * Fix Untyped/CEK.lagda; make Agda conformance tests pass * Correct spacing * Remove some remaining merge conflicts * Correct spacing * Correct formatting * Correct formatting * Some renaming * Update flake * Bump plutus-core at el from 1.5 -> 1.6 * Bump haskell.nix, iohk-nix, CHaP * bump cardano-base we needed to get proper blst discovery, until 2.2.0.0 is released. This also means we need to bring in cardano-mempool. * Fix missing blst symbols. This depends on https://github.com/input-output-hk/cardano-base/pull/412. * Agda fixes * liftCode -> liftCodeDef * Remove superlfuous dependencies * Add DST argument to hashToGroup builtins * Address a couple of PR comments * bump haskell.nix * Add NOINLINE to listOfSizedByteStrings * Address some PR comments * Bump haskell.nix To get https://github.com/input-output-hk/haskell.nix/pull/1948 * Error type for overlong DSTs * Error type for overlong DSTs * Stuff about shrinking * Make CI happy. x is unused. * plutus windows cross 8.10 * Finish incomplete test * Typo * Address PR comments * Fix parser for bls12_381_mlresult type * WIP updating things * bump iohk-nix * Improve hash collision tests * Update benching.csv to new format to make merge easier * Resolve some remaining conflicts * Update ciJobs.nix * bump haskell.nix * Update nix/cells/automation/ciJobs.nix * Update nix/cells/automation/ciJobs.nix * Update plutus-metatheory/src/Algorithmic/Erasure.lagda --------- Co-authored-by: Michael Peyton Jones Co-authored-by: Moritz Angermann Co-authored-by: Hamish Mackenzie --- cabal.project | 2 +- flake.lock | 68 +- .../plutus/library/make-plutus-project.nix | 2 +- .../bls-benchmarks/bench/Bench.hs | 64 + plutus-benchmark/bls-benchmarks/exe/Main.hs | 170 ++ .../src/PlutusBenchmark/BLS12_381/Common.hs | 325 ++++ ...85153_effectfully_stop_the_irrelevance.rst | 4 - .../common/PlutusBenchmark/Common.hs | 2 +- plutus-benchmark/ed25519-throughput/Main.hs | 1 + plutus-benchmark/plutus-benchmark.cabal | 61 + .../G1/bad-syntax-1/bad-syntax-1.uplc | 4 + .../bad-syntax-1/bad-syntax-1.uplc.expected | 1 + .../G1/bad-syntax-2/bad-syntax-2.uplc | 4 + .../bad-syntax-2/bad-syntax-2.uplc.expected | 1 + .../bls12-381/G1/bad-zero-1/bad-zero-1.uplc | 4 + .../G1/bad-zero-1/bad-zero-1.uplc.expected | 1 + .../bls12-381/G1/bad-zero-2/bad-zero-2.uplc | 4 + .../G1/bad-zero-2/bad-zero-2.uplc.expected | 1 + .../bls12-381/G1/bad-zero-3/bad-zero-3.uplc | 4 + .../G1/bad-zero-3/bad-zero-3.uplc.expected | 1 + .../bls12-381/G1/off-curve/off-curve.uplc | 4 + .../G1/off-curve/off-curve.uplc.expected | 1 + .../on-curve-bit3-clear.uplc | 4 + .../on-curve-bit3-clear.uplc.expected | 7 + .../on-curve-bit3-set/on-curve-bit3-set.uplc | 4 + .../on-curve-bit3-set.uplc.expected | 7 + .../on-curve-seriliased-not-compressed.uplc | 5 + ...ve-seriliased-not-compressed.uplc.expected | 1 + .../G1/out-of-group/out-of-group.uplc | 4 + .../out-of-group/out-of-group.uplc.expected | 1 + .../bls12-381/G1/too-long/too-long.uplc | 4 + .../G1/too-long/too-long.uplc.expected | 1 + .../bls12-381/G1/too-short/too-short.uplc | 4 + .../G1/too-short/too-short.uplc.expected | 1 + .../constant/bls12-381/G1/zero/zero.uplc | 4 + .../bls12-381/G1/zero/zero.uplc.expected | 7 + .../G2/bad-syntax-1/bad-syntax-1.uplc | 4 + .../bad-syntax-1/bad-syntax-1.uplc.expected | 1 + .../G2/bad-syntax-2/bad-syntax-2.uplc | 4 + .../bad-syntax-2/bad-syntax-2.uplc.expected | 1 + .../bls12-381/G2/bad-zero-1/bad-zero-1.uplc | 4 + .../G2/bad-zero-1/bad-zero-1.uplc.expected | 1 + .../bls12-381/G2/bad-zero-2/bad-zero-2.uplc | 4 + .../G2/bad-zero-2/bad-zero-2.uplc.expected | 1 + .../bls12-381/G2/bad-zero-3/bad-zero-3.uplc | 4 + .../G2/bad-zero-3/bad-zero-3.uplc.expected | 1 + .../bls12-381/G2/off-curve/off-curve.uplc | 4 + .../G2/off-curve/off-curve.uplc.expected | 1 + .../on-curve-bit3-clear.uplc | 4 + .../on-curve-bit3-clear.uplc.expected | 7 + .../on-curve-bit3-set/on-curve-bit3-set.uplc | 4 + .../on-curve-bit3-set.uplc.expected | 7 + .../on-curve-seriliased-not-compressed.uplc | 5 + ...ve-seriliased-not-compressed.uplc.expected | 1 + .../G2/out-of-group/out-of-group.uplc | 4 + .../out-of-group/out-of-group.uplc.expected | 1 + .../bls12-381/G2/too-long/too-long.uplc | 4 + .../G2/too-long/too-long.uplc.expected | 1 + .../bls12-381/G2/too-short/too-short.uplc | 4 + .../G2/too-short/too-short.uplc.expected | 1 + .../constant/bls12-381/G2/zero/zero.uplc | 4 + .../bls12-381/G2/zero/zero.uplc.expected | 7 + .../add-associative/add-associative.uplc | 33 + .../add-associative.uplc.expected | 1 + .../add-commutative/add-commutative.uplc | 22 + .../add-commutative.uplc.expected | 1 + .../bls12_381_G1_add/add-zero/add-zero.uplc | 10 + .../add-zero/add-zero.uplc.expected | 7 + .../semantics/bls12_381_G1_add/add/add.uplc | 10 + .../bls12_381_G1_add/add/add.uplc.expected | 7 + .../compress/compress.uplc | 7 + .../compress/compress.uplc.expected | 7 + .../equal-false/equal-false.uplc | 10 + .../equal-false/equal-false.uplc.expected | 1 + .../equal-true/equal-true.uplc | 10 + .../equal-true/equal-true.uplc.expected | 1 + .../hash-different-msg-same-dst.uplc | 23 + .../hash-different-msg-same-dst.uplc.expected | 1 + .../hash-dst-len-255/hash-dst-len-255.uplc | 10 + .../hash-dst-len-255.uplc.expected | 7 + .../hash-dst-len-256/hash-dst-len-256.uplc | 10 + .../hash-dst-len-256.uplc.expected | 1 + .../hash-empty-dst/hash-empty-dst.uplc | 10 + .../hash-empty-dst.uplc.expected | 7 + .../hash-same-msg-different-dst.uplc | 23 + .../hash-same-msg-different-dst.uplc.expected | 1 + .../bls12_381_G1_hashToGroup/hash/hash.uplc | 10 + .../hash/hash.uplc.expected | 7 + .../bls12_381_G1_neg/add-neg/add-neg.uplc | 13 + .../add-neg/add-neg.uplc.expected | 7 + .../bls12_381_G1_neg/neg-zero/neg-zero.uplc | 7 + .../neg-zero/neg-zero.uplc.expected | 7 + .../semantics/bls12_381_G1_neg/neg/neg.uplc | 7 + .../bls12_381_G1_neg/neg/neg.uplc.expected | 7 + .../bls12_381_G1_scalarMul/addmul/addmul.uplc | 22 + .../addmul/addmul.uplc.expected | 7 + .../bls12_381_G1_scalarMul/mul0/mul0.uplc | 10 + .../mul0/mul0.uplc.expected | 7 + .../bls12_381_G1_scalarMul/mul1/mul1.uplc | 10 + .../mul1/mul1.uplc.expected | 7 + .../mul19+25/mul19+25.uplc | 22 + .../mul19+25/mul19+25.uplc.expected | 7 + .../bls12_381_G1_scalarMul/mul44/mul44.uplc | 10 + .../mul44/mul44.uplc.expected | 7 + .../mul4x11/mul4x11.uplc | 16 + .../mul4x11/mul4x11.uplc.expected | 7 + .../bls12_381_G1_scalarMul/muladd/muladd.uplc | 16 + .../muladd/muladd.uplc.expected | 7 + .../mulneg1/mulneg1.uplc | 10 + .../mulneg1/mulneg1.uplc.expected | 7 + .../mulneg44/mulneg44.uplc | 10 + .../mulneg44/mulneg44.uplc.expected | 7 + .../mulperiodic1/mulperiodic1.uplc | 13 + .../mulperiodic1/mulperiodic1.uplc.expected | 1 + .../mulperiodic2/mulperiodic2.uplc | 23 + .../mulperiodic2/mulperiodic2.uplc.expected | 1 + .../mulperiodic3/mulperiodic3.uplc | 27 + .../mulperiodic3/mulperiodic3.uplc.expected | 1 + .../mulperiodic4/mulperiodic4.uplc | 27 + .../mulperiodic4/mulperiodic4.uplc.expected | 1 + .../bad-zero-1/bad-zero-1.uplc | 7 + .../bad-zero-1/bad-zero-1.uplc.expected | 1 + .../bad-zero-2/bad-zero-2.uplc | 8 + .../bad-zero-2/bad-zero-2.uplc.expected | 1 + .../bad-zero-3/bad-zero-3.uplc | 8 + .../bad-zero-3/bad-zero-3.uplc.expected | 1 + .../off-curve/off-curve.uplc | 7 + .../off-curve/off-curve.uplc.expected | 1 + .../on-curve-bit3-clear.uplc | 8 + .../on-curve-bit3-clear.uplc.expected | 7 + .../on-curve-bit3-set/on-curve-bit3-set.uplc | 8 + .../on-curve-bit3-set.uplc.expected | 9 + .../on-curve-serialised-not-compressed.uplc | 10 + ...ve-serialised-not-compressed.uplc.expected | 1 + .../out-of-group/out-of-group.uplc | 8 + .../out-of-group/out-of-group.uplc.expected | 1 + .../too-long/too-long.uplc | 8 + .../too-long/too-long.uplc.expected | 1 + .../too-short/too-short.uplc | 7 + .../too-short/too-short.uplc.expected | 1 + .../bls12_381_G1_uncompress/zero/zero.uplc | 7 + .../zero/zero.uplc.expected | 7 + .../add-associative/add-associative.uplc | 37 + .../add-associative.uplc.expected | 1 + .../add-commutative/add-commutative.uplc | 24 + .../add-commutative.uplc.expected | 1 + .../bls12_381_G2_add/add-zero/add-zero.uplc | 10 + .../add-zero/add-zero.uplc.expected | 7 + .../semantics/bls12_381_G2_add/add/add.uplc | 10 + .../bls12_381_G2_add/add/add.uplc.expected | 7 + .../compress/compress.uplc | 7 + .../compress/compress.uplc.expected | 7 + .../equal-false/equal-false.uplc | 10 + .../equal-false/equal-false.uplc.expected | 1 + .../equal-true/equal-true.uplc | 10 + .../equal-true/equal-true.uplc.expected | 1 + .../hash-different-msg-same-dst.uplc | 23 + .../hash-different-msg-same-dst.uplc.expected | 1 + .../hash-dst-len-255/hash-dst-len-255.uplc | 10 + .../hash-dst-len-255.uplc.expected | 7 + .../hash-dst-len-256/hash-dst-len-256.uplc | 10 + .../hash-dst-len-256.uplc.expected | 1 + .../hash-empty-dst/hash-empty-dst.uplc | 10 + .../hash-empty-dst.uplc.expected | 7 + .../hash-same-msg-different-dst.uplc | 23 + .../hash-same-msg-different-dst.uplc.expected | 1 + .../bls12_381_G2_hashToGroup/hash/hash.uplc | 10 + .../hash/hash.uplc.expected | 7 + .../bls12_381_G2_neg/add-neg/add-neg.uplc | 13 + .../add-neg/add-neg.uplc.expected | 7 + .../bls12_381_G2_neg/neg-zero/neg-zero.uplc | 7 + .../neg-zero/neg-zero.uplc.expected | 7 + .../semantics/bls12_381_G2_neg/neg/neg.uplc | 7 + .../bls12_381_G2_neg/neg/neg.uplc.expected | 7 + .../bls12_381_G2_scalarMul/addmul/addmul.uplc | 22 + .../addmul/addmul.uplc.expected | 7 + .../bls12_381_G2_scalarMul/mul0/mul0.uplc | 10 + .../mul0/mul0.uplc.expected | 7 + .../bls12_381_G2_scalarMul/mul1/mul1.uplc | 10 + .../mul1/mul1.uplc.expected | 7 + .../mul19+25/mul19+25.uplc | 22 + .../mul19+25/mul19+25.uplc.expected | 7 + .../bls12_381_G2_scalarMul/mul44/mul44.uplc | 10 + .../mul44/mul44.uplc.expected | 7 + .../mul4x11/mul4x11.uplc | 16 + .../mul4x11/mul4x11.uplc.expected | 7 + .../bls12_381_G2_scalarMul/muladd/muladd.uplc | 16 + .../muladd/muladd.uplc.expected | 7 + .../mulneg1/mulneg1.uplc | 10 + .../mulneg1/mulneg1.uplc.expected | 7 + .../mulneg44/mulneg44.uplc | 10 + .../mulneg44/mulneg44.uplc.expected | 7 + .../mulperiodic1/mulperiodic1.uplc | 14 + .../mulperiodic1/mulperiodic1.uplc.expected | 1 + .../mulperiodic2/mulperiodic2.uplc | 26 + .../mulperiodic2/mulperiodic2.uplc.expected | 1 + .../mulperiodic3/mulperiodic3.uplc | 29 + .../mulperiodic3/mulperiodic3.uplc.expected | 1 + .../mulperiodic4/mulperiodic4.uplc | 29 + .../mulperiodic4/mulperiodic4.uplc.expected | 1 + .../bad-zero-1/bad-zero-1.uplc | 7 + .../bad-zero-1/bad-zero-1.uplc.expected | 1 + .../bad-zero-2/bad-zero-2.uplc | 7 + .../bad-zero-2/bad-zero-2.uplc.expected | 1 + .../bad-zero-3/bad-zero-3.uplc | 8 + .../bad-zero-3/bad-zero-3.uplc.expected | 1 + .../off-curve/off-curve.uplc | 7 + .../off-curve/off-curve.uplc.expected | 1 + .../on-curve-bit3-clear.uplc | 8 + .../on-curve-bit3-clear.uplc.expected | 7 + .../on-curve-bit3-set/on-curve-bit3-set.uplc | 8 + .../on-curve-bit3-set.uplc.expected | 7 + .../on-curve-serialised-not-compressed.uplc | 10 + ...ve-serialised-not-compressed.uplc.expected | 1 + .../out-of-group/out-of-group.uplc | 8 + .../out-of-group/out-of-group.uplc.expected | 1 + .../too-long/too-long.uplc | 7 + .../too-long/too-long.uplc.expected | 1 + .../too-short/too-short.uplc | 7 + .../too-short/too-short.uplc.expected | 1 + .../bls12_381_G2_uncompress/zero/zero.uplc | 7 + .../zero/zero.uplc.expected | 7 + .../balanced/balanced.uplc | 33 + .../balanced/balanced.uplc.expected | 1 + .../equal-pairing/equal-pairing.uplc | 22 + .../equal-pairing/equal-pairing.uplc.expected | 1 + .../left-additive/left-additive.uplc | 52 + .../left-additive/left-additive.uplc.expected | 1 + .../random-pairing/random-pairing.uplc | 22 + .../random-pairing.uplc.expected | 1 + .../right-additive/right-additive.uplc | 41 + .../right-additive.uplc.expected | 1 + .../20230323_203720_kwxm_prototype.md | 49 + .../budgeting-bench/Benchmarks/Crypto.hs | 232 ++- .../CreateBuiltinCostModel.hs | 193 +- plutus-core/cost-model/data/benching.csv | 1701 +++++++++++++++++ .../cost-model/data/builtinCostModel.json | 182 ++ plutus-core/cost-model/data/models.R | 163 +- plutus-core/cost-model/test/TestCostModels.hs | 25 +- plutus-core/plutus-core.cabal | 11 +- .../src/PlutusCore/Crypto/BLS12_381/Error.hs | 6 + .../src/PlutusCore/Crypto/BLS12_381/G1.hs | 148 ++ .../src/PlutusCore/Crypto/BLS12_381/G2.hs | 111 ++ .../PlutusCore/Crypto/BLS12_381/Pairing.hs | 70 + .../src/PlutusCore/Crypto/Ed25519.hs | 61 + .../Crypto/Secp256k1.hs} | 77 +- .../src/PlutusCore/Crypto/Utils.hs | 27 + .../src/PlutusCore/Default/Builtins.hs | 155 +- .../src/PlutusCore/Default/Universe.hs | 157 +- .../plutus-core/src/PlutusCore/Error.hs | 4 +- .../Evaluation/Machine/BuiltinCostModel.hs | 18 + .../Evaluation/Machine/ExBudgetingDefaults.hs | 19 + .../Evaluation/Machine/ExMemoryUsage.hs | 15 + .../src/PlutusCore/Parser/Builtin.hs | 45 +- .../plutus-core/src/PlutusCore/Parser/Type.hs | 25 +- .../src/PlutusCore/Pretty/PrettyConst.hs | 8 +- .../Golden/Bls12_381_G1_add.plc.golden | 4 + .../Golden/Bls12_381_G1_compress.plc.golden | 1 + .../Golden/Bls12_381_G1_equal.plc.golden | 1 + .../Bls12_381_G1_hashToGroup.plc.golden | 1 + .../Golden/Bls12_381_G1_neg.plc.golden | 1 + .../Golden/Bls12_381_G1_scalarMul.plc.golden | 1 + .../Golden/Bls12_381_G1_uncompress.plc.golden | 1 + .../Golden/Bls12_381_G2_add.plc.golden | 4 + .../Golden/Bls12_381_G2_compress.plc.golden | 1 + .../Golden/Bls12_381_G2_equal.plc.golden | 1 + .../Bls12_381_G2_hashToGroup.plc.golden | 1 + .../Golden/Bls12_381_G2_neg.plc.golden | 1 + .../Golden/Bls12_381_G2_scalarMul.plc.golden | 1 + .../Golden/Bls12_381_G2_uncompress.plc.golden | 1 + .../Golden/Bls12_381_finalVerify.plc.golden | 1 + .../Golden/Bls12_381_millerLoop.plc.golden | 4 + .../Golden/Bls12_381_mulMlResult.plc.golden | 4 + .../PlutusCore/Generators/Hedgehog/Builtin.hs | 33 + .../Generators/QuickCheck/Builtin.hs | 39 +- .../Generators/QuickCheck/ShrinkTerms.hs | 6 + .../Evaluation/Machine/Cek/Internal.hs | 1 - .../test/Evaluation/Builtins/BLS12_381.hs | 471 +++++ .../Builtins/BLS12_381/TestClasses.hs | 101 + .../Evaluation/Builtins/BLS12_381/Utils.hs | 112 ++ .../test/Evaluation/Builtins/Definition.hs | 37 +- .../20230323_202231_kwxm_prototype.md | 8 + .../src/PlutusLedgerApi/Common/Versions.hs | 9 + .../src/PlutusLedgerApi/V3/ParamName.hs | 38 + .../test/Spec/CostModelParams.hs | 5 +- ...161618_mjaskelioff_abstract_signatures.rst | 32 - plutus-metatheory/plutus-metatheory.cabal | 1 + .../src/Algorithmic/CEK.lagda.md | 27 +- .../src/Algorithmic/Completeness.lagda | 15 +- .../src/Algorithmic/Erasure.lagda | 33 +- .../Erasure/RenamingSubstitution.lagda | 20 +- .../src/Algorithmic/ReductionEC.lagda.md | 2 - .../Algorithmic/RenamingSubstitution.lagda | 30 +- .../src/Algorithmic/Soundness.lagda | 16 +- plutus-metatheory/src/Builtin.lagda.md | 139 +- .../src/Builtin/Constant/AtomicType.lagda.md | 19 +- .../src/Builtin/Constant/Term.lagda.md | 5 +- .../src/Builtin/Constant/Type.lagda.md | 4 +- plutus-metatheory/src/Check.lagda.md | 20 +- .../src/Declarative/Erasure.lagda.md | 15 +- .../Declarative/RenamingSubstitution.lagda.md | 18 +- plutus-metatheory/src/Raw.hs | 27 +- plutus-metatheory/src/RawU.lagda.md | 63 +- .../src/Scoped/Extrication.lagda | 3 + .../src/Type/RenamingSubstitution.lagda.md | 2 +- plutus-metatheory/src/Untyped.lagda.md | 5 +- plutus-metatheory/src/Untyped/CEK.lagda.md | 80 + plutus-metatheory/src/Utils.lagda | 14 +- plutus-metatheory/test/ii.plc | 105 + plutus-metatheory/test/ii.tplc | 78 + plutus-metatheory/test/test.plc | 12 + .../20230323_203447_kwxm_prototype.md | 41 + .../src/PlutusTx/Compiler/Builtins.hs | 146 +- .../20230323_203148_kwxm_prototype.md | 40 + plutus-tx/src/PlutusTx/Builtins.hs | 236 ++- plutus-tx/src/PlutusTx/Builtins/Class.hs | 26 + plutus-tx/src/PlutusTx/Builtins/Internal.hs | 155 +- plutus-tx/src/PlutusTx/Lift/Class.hs | 12 + plutus-tx/src/PlutusTx/Prelude.hs | 38 +- 319 files changed, 7709 insertions(+), 583 deletions(-) create mode 100644 plutus-benchmark/bls-benchmarks/bench/Bench.hs create mode 100644 plutus-benchmark/bls-benchmarks/exe/Main.hs create mode 100644 plutus-benchmark/bls-benchmarks/src/PlutusBenchmark/BLS12_381/Common.hs delete mode 100644 plutus-benchmark/changelog.d/20230310_185153_effectfully_stop_the_irrelevance.rst create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-1/bad-syntax-1.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-1/bad-syntax-1.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-2/bad-syntax-2.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-2/bad-syntax-2.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-1/bad-zero-1.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-1/bad-zero-1.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-2/bad-zero-2.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-2/bad-zero-2.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-3/bad-zero-3.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-3/bad-zero-3.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/off-curve/off-curve.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/off-curve/off-curve.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-clear/on-curve-bit3-clear.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-set/on-curve-bit3-set.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-set/on-curve-bit3-set.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/out-of-group/out-of-group.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/out-of-group/out-of-group.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-long/too-long.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-long/too-long.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-short/too-short.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-short/too-short.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/zero/zero.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/zero/zero.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-1/bad-syntax-1.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-1/bad-syntax-1.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-2/bad-syntax-2.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-2/bad-syntax-2.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-1/bad-zero-1.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-1/bad-zero-1.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-2/bad-zero-2.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-2/bad-zero-2.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-3/bad-zero-3.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-3/bad-zero-3.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/off-curve/off-curve.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/off-curve/off-curve.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-clear/on-curve-bit3-clear.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-set/on-curve-bit3-set.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-set/on-curve-bit3-set.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/out-of-group/out-of-group.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/out-of-group/out-of-group.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-long/too-long.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-long/too-long.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-short/too-short.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-short/too-short.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/zero/zero.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/zero/zero.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-associative/add-associative.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-associative/add-associative.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-commutative/add-commutative.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-commutative/add-commutative.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-zero/add-zero.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-zero/add-zero.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add/add.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add/add.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_compress/compress/compress.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_compress/compress/compress.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-false/equal-false.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-false/equal-false.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-true/equal-true.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-true/equal-true.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-empty-dst/hash-empty-dst.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-empty-dst/hash-empty-dst.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash/hash.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash/hash.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/add-neg/add-neg.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/add-neg/add-neg.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg-zero/neg-zero.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg-zero/neg-zero.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg/neg.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg/neg.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/addmul/addmul.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/addmul/addmul.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul0/mul0.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul0/mul0.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul1/mul1.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul1/mul1.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul19+25/mul19+25.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul19+25/mul19+25.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul44/mul44.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul44/mul44.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul4x11/mul4x11.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul4x11/mul4x11.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/muladd/muladd.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/muladd/muladd.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg1/mulneg1.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg1/mulneg1.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg44/mulneg44.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg44/mulneg44.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic1/mulperiodic1.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic1/mulperiodic1.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic2/mulperiodic2.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic2/mulperiodic2.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic3/mulperiodic3.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic3/mulperiodic3.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic4/mulperiodic4.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic4/mulperiodic4.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-1/bad-zero-1.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-1/bad-zero-1.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-2/bad-zero-2.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-2/bad-zero-2.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-3/bad-zero-3.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-3/bad-zero-3.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/off-curve/off-curve.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/off-curve/off-curve.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/out-of-group/out-of-group.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/out-of-group/out-of-group.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-long/too-long.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-long/too-long.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-short/too-short.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-short/too-short.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/zero/zero.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/zero/zero.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-associative/add-associative.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-associative/add-associative.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-commutative/add-commutative.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-commutative/add-commutative.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-zero/add-zero.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-zero/add-zero.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add/add.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add/add.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_compress/compress/compress.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_compress/compress/compress.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-false/equal-false.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-false/equal-false.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-true/equal-true.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-true/equal-true.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-empty-dst/hash-empty-dst.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-empty-dst/hash-empty-dst.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash/hash.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash/hash.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/add-neg/add-neg.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/add-neg/add-neg.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg-zero/neg-zero.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg-zero/neg-zero.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg/neg.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg/neg.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/addmul/addmul.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/addmul/addmul.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul0/mul0.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul0/mul0.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul1/mul1.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul1/mul1.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul19+25/mul19+25.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul19+25/mul19+25.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul44/mul44.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul44/mul44.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul4x11/mul4x11.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul4x11/mul4x11.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/muladd/muladd.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/muladd/muladd.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg1/mulneg1.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg1/mulneg1.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg44/mulneg44.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg44/mulneg44.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic1/mulperiodic1.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic1/mulperiodic1.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic2/mulperiodic2.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic2/mulperiodic2.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic3/mulperiodic3.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic3/mulperiodic3.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic4/mulperiodic4.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic4/mulperiodic4.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-1/bad-zero-1.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-1/bad-zero-1.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-2/bad-zero-2.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-2/bad-zero-2.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-3/bad-zero-3.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-3/bad-zero-3.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/off-curve/off-curve.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/off-curve/off-curve.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/out-of-group/out-of-group.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/out-of-group/out-of-group.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-long/too-long.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-long/too-long.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-short/too-short.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-short/too-short.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/zero/zero.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/zero/zero.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/balanced/balanced.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/balanced/balanced.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/equal-pairing/equal-pairing.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/equal-pairing/equal-pairing.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/left-additive/left-additive.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/left-additive/left-additive.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/random-pairing/random-pairing.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/random-pairing/random-pairing.uplc.expected create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/right-additive/right-additive.uplc create mode 100644 plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/right-additive/right-additive.uplc.expected create mode 100644 plutus-core/changelog.d/20230323_203720_kwxm_prototype.md create mode 100644 plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/Error.hs create mode 100644 plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/G1.hs create mode 100644 plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/G2.hs create mode 100644 plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/Pairing.hs create mode 100644 plutus-core/plutus-core/src/PlutusCore/Crypto/Ed25519.hs rename plutus-core/plutus-core/src/{Crypto.hs => PlutusCore/Crypto/Secp256k1.hs} (56%) create mode 100644 plutus-core/plutus-core/src/PlutusCore/Crypto/Utils.hs create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_add.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_compress.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_equal.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_hashToGroup.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_neg.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_scalarMul.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_uncompress.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_add.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_compress.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_equal.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_hashToGroup.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_neg.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_scalarMul.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_uncompress.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_finalVerify.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_millerLoop.plc.golden create mode 100644 plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_mulMlResult.plc.golden create mode 100644 plutus-core/untyped-plutus-core/test/Evaluation/Builtins/BLS12_381.hs create mode 100644 plutus-core/untyped-plutus-core/test/Evaluation/Builtins/BLS12_381/TestClasses.hs create mode 100644 plutus-core/untyped-plutus-core/test/Evaluation/Builtins/BLS12_381/Utils.hs create mode 100644 plutus-ledger-api/changelog.d/20230323_202231_kwxm_prototype.md delete mode 100644 plutus-metatheory/changelog.d/20230221_161618_mjaskelioff_abstract_signatures.rst create mode 100644 plutus-metatheory/test/ii.plc create mode 100644 plutus-metatheory/test/ii.tplc create mode 100644 plutus-metatheory/test/test.plc create mode 100644 plutus-tx-plugin/changelog.d/20230323_203447_kwxm_prototype.md create mode 100644 plutus-tx/changelog.d/20230323_203148_kwxm_prototype.md diff --git a/cabal.project b/cabal.project index ee3139d78e3..32f1768b22c 100644 --- a/cabal.project +++ b/cabal.project @@ -16,7 +16,7 @@ index-state: -- Bump both the following dates if you need newer packages from Hackage , hackage.haskell.org 2023-05-23T01:25:23Z -- Bump this if you need newer packages from CHaP - , cardano-haskell-packages 2023-05-16T08:53:30Z + , cardano-haskell-packages 2023-05-26T00:00:00Z packages: doc/read-the-docs-site marlowe-cardano-minimal diff --git a/flake.lock b/flake.lock index d3962d62ba7..24201c4b432 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1684299770, - "narHash": "sha256-4IN4Ai+PPht7griE+YkRqgTRmjlGaLZg7nSxJzQkcic=", + "lastModified": 1685116674, + "narHash": "sha256-UIc+NrOLe0cbFsjUt2EOMZvuh41x9h0L+hBmAtLNZR0=", "owner": "input-output-hk", "repo": "cardano-haskell-packages", - "rev": "7026265aa4c4b35e34c746ca17a2d587d5844801", + "rev": "7b77f33895e91f0221ee0ea5a1c6145b907097ef", "type": "github" }, "original": { @@ -48,6 +48,23 @@ "type": "github" } }, + "blst": { + "flake": false, + "locked": { + "lastModified": 1656163412, + "narHash": "sha256-xero1aTe2v4IhWIJaEDUsVDOfE77dOV5zKeHWntHogY=", + "owner": "supranational", + "repo": "blst", + "rev": "03b5124029979755c752eec45f3c29674b558446", + "type": "github" + }, + "original": { + "owner": "supranational", + "repo": "blst", + "rev": "03b5124029979755c752eec45f3c29674b558446", + "type": "github" + } + }, "cabal-32": { "flake": false, "locked": { @@ -415,16 +432,19 @@ }, "iohk-nix": { "inputs": { + "blst": "blst", "nixpkgs": [ "nixpkgs" - ] + ], + "secp256k1": "secp256k1", + "sodium": "sodium" }, "locked": { - "lastModified": 1681957618, - "narHash": "sha256-6fo/QohImV8buYiIhnSniquMmBj4IgtgQrq0JDpsav4=", + "lastModified": 1684223806, + "narHash": "sha256-IyLoP+zhuyygLtr83XXsrvKyqqLQ8FHXTiySFf4FJOI=", "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "26f56e32169dcc9ef72ac754eccdb3c96d714751", + "rev": "86421fdd89b3af43fa716ccd07638f96c6ecd1e4", "type": "github" }, "original": { @@ -737,6 +757,40 @@ "std": "std" } }, + "secp256k1": { + "flake": false, + "locked": { + "lastModified": 1683999695, + "narHash": "sha256-9nJJVENMXjXEJZzw8DHzin1DkFkF8h9m/c6PuM7Uk4s=", + "owner": "bitcoin-core", + "repo": "secp256k1", + "rev": "acf5c55ae6a94e5ca847e07def40427547876101", + "type": "github" + }, + "original": { + "owner": "bitcoin-core", + "ref": "v0.3.2", + "repo": "secp256k1", + "type": "github" + } + }, + "sodium": { + "flake": false, + "locked": { + "lastModified": 1675156279, + "narHash": "sha256-0uRcN5gvMwO7MCXVYnoqG/OmeBFi8qRVnDWJLnBb9+Y=", + "owner": "input-output-hk", + "repo": "libsodium", + "rev": "dbb48cce5429cb6585c9034f002568964f1ce567", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "libsodium", + "rev": "dbb48cce5429cb6585c9034f002568964f1ce567", + "type": "github" + } + }, "sphinxcontrib-haddock": { "flake": false, "locked": { diff --git a/nix/cells/plutus/library/make-plutus-project.nix b/nix/cells/plutus/library/make-plutus-project.nix index 62734ad868d..692e201e8a9 100644 --- a/nix/cells/plutus/library/make-plutus-project.nix +++ b/nix/cells/plutus/library/make-plutus-project.nix @@ -47,7 +47,7 @@ let package plutus-tx-plugin flags: +use-ghc-stub - -- Exclude test that use `doctest`. They will not work for + -- Exclude tests that use `doctest`. They will not work for -- cross compilation and `cabal` will not be able to make a plan. package prettyprinter-configurable tests: False diff --git a/plutus-benchmark/bls-benchmarks/bench/Bench.hs b/plutus-benchmark/bls-benchmarks/bench/Bench.hs new file mode 100644 index 00000000000..587c2dd6004 --- /dev/null +++ b/plutus-benchmark/bls-benchmarks/bench/Bench.hs @@ -0,0 +1,64 @@ +-- editorconfig-checker-disable-file +{- | Plutus benchmarks measuring actual execution times of some BSL12-381 + operations, mainly intended to give us an idea of what we can do within the + on-chain execution limits. -} +module Main where + +import Criterion.Main + +import PlutusBenchmark.BLS12_381.Common +import PlutusBenchmark.Common (benchTermCek) +import PlutusTx.Prelude qualified as Tx +import UntypedPlutusCore qualified as UPLC + +import Data.ByteString qualified as BS (empty) + +benchProgCek :: UProg -> Benchmarkable +benchProgCek (UPLC.Program _ _ t) = benchTermCek t + +benchHashAndAddG1 :: Integer -> Benchmark +benchHashAndAddG1 n = + let prog = mkHashAndAddG1Script (listOfSizedByteStrings n 4) + in bench (show n) $ benchProgCek prog + +benchHashAndAddG2 :: Integer -> Benchmark +benchHashAndAddG2 n = + let prog = mkHashAndAddG2Script (listOfSizedByteStrings n 4) + in bench (show n) $ benchProgCek prog + +benchUncompressAndAddG1 :: Integer -> Benchmark +benchUncompressAndAddG1 n = + let prog = mkUncompressAndAddG1Script (listOfSizedByteStrings n 4) + in bench (show n) $ benchProgCek prog + +benchUncompressAndAddG2 :: Integer -> Benchmark +benchUncompressAndAddG2 n = + let prog = mkUncompressAndAddG2Script (listOfSizedByteStrings n 4) + in bench (show n) $ benchProgCek prog + +benchPairing :: Benchmark +benchPairing = + case listOfSizedByteStrings 4 4 of + [b1, b2, b3, b4] -> + let emptyDst = Tx.toBuiltin BS.empty + p1 = Tx.bls12_381_G1_hashToGroup (Tx.toBuiltin b1) emptyDst + p2 = Tx.bls12_381_G2_hashToGroup (Tx.toBuiltin b2) emptyDst + q1 = Tx.bls12_381_G1_hashToGroup (Tx.toBuiltin b3) emptyDst + q2 = Tx.bls12_381_G2_hashToGroup (Tx.toBuiltin b4) emptyDst + prog = mkPairingScript p1 p2 q1 q2 + in bench "pairing" $ benchProgCek prog + _ -> error "Unexpected list returned by listOfSizedByteStrings" + +benchGroth16Verify :: Benchmark +benchGroth16Verify = bench "groth16Verify" $ benchProgCek mkGroth16VerifyScript + +main :: IO () +main = do + defaultMain [ + bgroup "hashAndAddG1" $ fmap benchHashAndAddG1 [0, 10..150] + , bgroup "hashAndAddG2" $ fmap benchHashAndAddG2 [0, 10..150] + , bgroup "uncompressAndAddG1" $ fmap benchUncompressAndAddG1 [0, 10..150] + , bgroup "uncompressAndAddG2" $ fmap benchUncompressAndAddG2 [0, 10..150] + , benchPairing + , benchGroth16Verify + ] diff --git a/plutus-benchmark/bls-benchmarks/exe/Main.hs b/plutus-benchmark/bls-benchmarks/exe/Main.hs new file mode 100644 index 00000000000..128376a6e65 --- /dev/null +++ b/plutus-benchmark/bls-benchmarks/exe/Main.hs @@ -0,0 +1,170 @@ +-- editorconfig-checker-disable-file +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE NumericUnderscores #-} + +{- | Print out the costs of various test scripts involving the BLS12_381 + primitives. Most of these work on varying numbers of inputs so that we can + get an idea of what we can do within the on-chain execution limits. +-} +module Main (main) + +where + +import PlutusBenchmark.BLS12_381.Common + +import PlutusCore.Evaluation.Machine.ExBudget (ExBudget (exBudgetCPU, exBudgetMemory)) +import PlutusCore.Evaluation.Machine.ExBudgetingDefaults qualified as PLC +import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (..), ExMemory (..)) +import PlutusTx.Prelude as Tx hiding (sort, (*)) +import UntypedPlutusCore qualified as UPLC +import UntypedPlutusCore.Evaluation.Machine.Cek qualified as Cek + +import Data.ByteString qualified as BS +import Data.SatInt (fromSatInt) +import Flat qualified +import Text.Printf (printf) + +import Prelude (Double, IO, Integral, String, fromIntegral, mapM_, show, (*), (/)) + +-- Protocol parameters (November 2022) + +-- | This is the "maximum transaction size". We're just comparing the size of +-- the script with this, so our results may be a little optimistic if the +-- transaction includes other stuff (I'm not sure exactly what "maximum +-- transaction size" means). +max_tx_size :: Integer +max_tx_size = 16384 + +max_tx_ex_steps :: Integer +max_tx_ex_steps = 10_000_000_000 + +max_tx_ex_mem :: Integer +max_tx_ex_mem = 14_000_000 + +-------------------------------- Printing -------------------------------- + +data TestSize = + NoSize + | TestSize Integer + +stringOfTestSize :: TestSize -> String +stringOfTestSize = + \case + NoSize -> "-" + TestSize n -> show n + +-- Printing utilities +percentage :: (Integral a, Integral b) => a -> b -> Double +percentage a b = + let a' = fromIntegral a :: Double + b' = fromIntegral b :: Double + in (a'* 100) / b' + +percentTxt :: (Integral a, Integral b) => a -> b -> String +percentTxt a b = printf "(%.1f%%)" (percentage a b) + +-- | Evaluate a script and return the CPU and memory costs (according to the cost model) +evaluate :: UProg -> (Integer, Integer) +evaluate (UPLC.Program _ _ prog) = + case Cek.runCekDeBruijn PLC.defaultCekParameters Cek.tallying Cek.noEmitter prog of + (_res, Cek.TallyingSt _ budget, _logs) -> + let ExCPU cpu = exBudgetCPU budget + ExMemory mem = exBudgetMemory budget + in (fromSatInt cpu, fromSatInt mem) + +-- | Evaluate a script and print out the serialised size and the CPU and memory +-- usage, both as absolute values and percentages of the maxima specified in the +-- protocol parameters. +printStatistics :: TestSize -> UProg -> IO () +printStatistics n script = do + let serialised = Flat.flat (UPLC.UnrestrictedProgram $ toAnonDeBruijnProg script) + size = BS.length serialised + (cpu, mem) = evaluate script + printf " %3s %7d %8s %15d %8s %15d %8s \n" + (stringOfTestSize n) + size (percentTxt size max_tx_size) + cpu (percentTxt cpu max_tx_ex_steps) + mem (percentTxt mem max_tx_ex_mem) + +------------------------------- Examples --------------------------------- + +printCosts_HashAndAddG1 :: Integer -> IO () +printCosts_HashAndAddG1 n = + let script = mkHashAndAddG1Script (listOfSizedByteStrings n 4) + in printStatistics (TestSize n) script + + +printCosts_HashAndAddG2 :: Integer -> IO () +printCosts_HashAndAddG2 n = + let script = mkHashAndAddG2Script (listOfSizedByteStrings n 4) + in printStatistics (TestSize n) script + + +printCosts_UncompressAndAddG1 :: Integer -> IO () +printCosts_UncompressAndAddG1 n = + let script = mkUncompressAndAddG1Script (listOfSizedByteStrings n 4) + in printStatistics (TestSize n) script + +printCosts_UncompressAndAddG2 :: Integer -> IO () +printCosts_UncompressAndAddG2 n = + let script = mkUncompressAndAddG2Script (listOfSizedByteStrings n 4) + in printStatistics (TestSize n) script + +printCosts_Pairing :: IO () +printCosts_Pairing = do + let emptyDST = toBuiltin BS.empty + p1 = Tx.bls12_381_G1_hashToGroup (toBuiltin . BS.pack $ [0x23, 0x43, 0x56, 0xf2]) emptyDST + p2 = Tx.bls12_381_G2_hashToGroup (toBuiltin . BS.pack $ [0x10, 0x00, 0xff, 0x88]) emptyDST + q1 = Tx.bls12_381_G1_hashToGroup (toBuiltin . BS.pack $ [0x11, 0x22, 0x33, 0x44]) emptyDST + q2 = Tx.bls12_381_G2_hashToGroup (toBuiltin . BS.pack $ [0xa0, 0xb1, 0xc2, 0xd3]) emptyDST + script = mkPairingScript p1 p2 q1 q2 + printStatistics NoSize script + +printCosts_Groth16Verify :: IO () +printCosts_Groth16Verify = do + let script = mkGroth16VerifyScript + printStatistics NoSize script + +printHeader :: IO () +printHeader = do + printf " n script size CPU usage Memory usage\n" + printf " ----------------------------------------------------------------------\n" + +main :: IO () +main = do + + printf "Hash n bytestrings onto G1 and add points\n\n" + printHeader + mapM_ printCosts_HashAndAddG1 [0, 10..150] + printf "\n\n" + + printf "Hash n bytestrings onto G2 and add points\n\n" + printHeader + mapM_ printCosts_HashAndAddG2 [0, 10..150] + printf "\n\n" + + printf "Uncompress n G1 points and add the results\n\n" + printHeader + mapM_ printCosts_UncompressAndAddG1 [0, 10..150] + printf "\n\n" + + printf "Uncompress n G2 points and add the results\n\n" + printHeader + mapM_ printCosts_UncompressAndAddG2 [0, 10..150] + printf "\n\n" + + printf "Apply pairing to two pairs of points in G1 x G2 and run finalVerify on the results\n\n" + printHeader + printCosts_Pairing + printf "\n\n" + + printf "Groth16 verification example\n\n" + printHeader + printCosts_Groth16Verify + printf "\n" + + if checkGroth16Verify_Haskell + then printf "Groth16Verify succeeded\n" + else printf "Groth16Verify failed\n" + + diff --git a/plutus-benchmark/bls-benchmarks/src/PlutusBenchmark/BLS12_381/Common.hs b/plutus-benchmark/bls-benchmarks/src/PlutusBenchmark/BLS12_381/Common.hs new file mode 100644 index 00000000000..1b7378ff3b8 --- /dev/null +++ b/plutus-benchmark/bls-benchmarks/src/PlutusBenchmark/BLS12_381/Common.hs @@ -0,0 +1,325 @@ +-- editorconfig-checker-disable-file +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE ViewPatterns #-} + +{- | Approximations of the sort of computations involving BLS12-381 primitives + that one might wish to perform on the chain. Real on-chain code will have + extra overhead, but these examples help to give us an idea of the sort of + computation that can feasibly be carried out within the validation budget + limits. -} +module PlutusBenchmark.BLS12_381.Common ( UProg + , UTerm + , checkGroth16Verify_Haskell + , listOfSizedByteStrings + , mkGroth16VerifyScript + , mkHashAndAddG1Script + , mkHashAndAddG2Script + , mkPairingScript + , mkUncompressAndAddG1Script + , mkUncompressAndAddG2Script + , toAnonDeBruijnProg + ) +where +import PlutusCore (DefaultFun, DefaultUni) +import PlutusTx qualified as Tx +import UntypedPlutusCore qualified as UPLC + +import PlutusTx.Prelude as Tx hiding (sort, (*)) + +import Data.ByteString (ByteString) +import Data.ByteString qualified as BS +import Data.Word (Word8) +import Hedgehog.Internal.Gen qualified as G +import Hedgehog.Internal.Range qualified as R +import System.IO.Unsafe (unsafePerformIO) + +import Prelude (fromIntegral) + +-------------------------------- PLC stuff-------------------------------- + +type UTerm = UPLC.Term UPLC.NamedDeBruijn DefaultUni DefaultFun () +type UProg = UPLC.Program UPLC.NamedDeBruijn DefaultUni DefaultFun () +type UDBProg = UPLC.Program UPLC.DeBruijn DefaultUni DefaultFun () + +compiledCodeToTerm + :: Tx.CompiledCodeIn DefaultUni DefaultFun a -> UTerm +compiledCodeToTerm (Tx.getPlcNoAnn -> UPLC.Program _ _ body) = body + +{- | Remove the textual names from a NamedDeBruijn program -} +toAnonDeBruijnProg :: UProg -> UDBProg +toAnonDeBruijnProg (UPLC.Program () ver body) = + UPLC.Program () ver $ UPLC.termMapNames (\(UPLC.NamedDeBruijn _ ix) -> UPLC.DeBruijn ix) body + +-- Create a list containing n bytestrings of length l. This could be better. +{-# NOINLINE listOfSizedByteStrings #-} +listOfSizedByteStrings :: Integer -> Integer -> [ByteString] +listOfSizedByteStrings n l = unsafePerformIO . G.sample $ + G.list (R.singleton $ fromIntegral n) + (G.bytes (R.singleton $ fromIntegral l)) + +---------------- Examples ---------------- + +-- Hash some bytestrings onto G1 and add them all together + +{-# INLINABLE hashAndAddG1 #-} +hashAndAddG1 :: [BuiltinByteString] -> BuiltinBLS12_381_G1_Element +hashAndAddG1 [] = error () +hashAndAddG1 (p:ps) = + go ps (Tx.bls12_381_G1_hashToGroup p emptyByteString) + where go [] acc = acc + go (q:qs) acc = go qs $ Tx.bls12_381_G1_add (Tx.bls12_381_G1_hashToGroup q emptyByteString) acc + +mkHashAndAddG1Script :: [ByteString] -> UProg +mkHashAndAddG1Script l = + let points = map toBuiltin l + in Tx.getPlcNoAnn $ $$(Tx.compile [|| hashAndAddG1 ||]) `Tx.unsafeApplyCode` Tx.liftCodeDef points + +-- Hash some bytestrings onto G2 and add them all together +{-# INLINABLE hashAndAddG2 #-} +hashAndAddG2 :: [BuiltinByteString] -> BuiltinBLS12_381_G2_Element +hashAndAddG2 [] = error () +hashAndAddG2 (p:ps) = + go ps (Tx.bls12_381_G2_hashToGroup p emptyByteString) + where go [] acc = acc + go (q:qs) acc = go qs $ Tx.bls12_381_G2_add (Tx.bls12_381_G2_hashToGroup q emptyByteString) acc + +mkHashAndAddG2Script :: [ByteString] -> UProg +mkHashAndAddG2Script l = + let points = map toBuiltin l + in Tx.getPlcNoAnn $ $$(Tx.compile [|| hashAndAddG2 ||]) `Tx.unsafeApplyCode` Tx.liftCodeDef points + +-- Uncompress a list of compressed G1 points and add them all together +{-# INLINABLE uncompressAndAddG1 #-} +uncompressAndAddG1 :: [BuiltinByteString] -> BuiltinBLS12_381_G1_Element +uncompressAndAddG1 [] = error () +uncompressAndAddG1 (p:ps) = + go ps (Tx.bls12_381_G1_uncompress p) + where go [] acc = acc + go (q:qs) acc = go qs $ Tx.bls12_381_G1_add (Tx.bls12_381_G1_uncompress q) acc + +mkUncompressAndAddG1Script :: [ByteString] -> UProg +mkUncompressAndAddG1Script l = + let ramdomPoint bs = Tx.bls12_381_G1_hashToGroup bs emptyByteString + points = map (Tx.bls12_381_G1_compress . ramdomPoint . toBuiltin) l + in Tx.getPlcNoAnn $ $$(Tx.compile [|| uncompressAndAddG1 ||]) `Tx.unsafeApplyCode` Tx.liftCodeDef points + +-- Uncompress a list of compressed G1 points and add them all together +{-# INLINABLE uncompressAndAddG2 #-} +uncompressAndAddG2 :: [BuiltinByteString] -> BuiltinBLS12_381_G2_Element +uncompressAndAddG2 [] = error () +uncompressAndAddG2 (p:ps) = + go ps (Tx.bls12_381_G2_uncompress p) + where go [] acc = acc + go (q:qs) acc = go qs $ Tx.bls12_381_G2_add (Tx.bls12_381_G2_uncompress q) acc + +mkUncompressAndAddG2Script :: [ByteString] -> UProg +mkUncompressAndAddG2Script l = + let ramdomPoint bs = Tx.bls12_381_G2_hashToGroup bs emptyByteString + points = map (Tx.bls12_381_G2_compress . ramdomPoint . toBuiltin) l + in Tx.getPlcNoAnn $ $$(Tx.compile [|| uncompressAndAddG2 ||]) `Tx.unsafeApplyCode` Tx.liftCodeDef points + +-- Pairing operations + +-- Take two points p1 and p2 in G1 and two points q1 and q2 in G2, apply the +-- Miller loop to (p1,q1) and (p2,q2), and then call finalVerify on the results. +{-# INLINABLE runPairingFunctions #-} +runPairingFunctions + :: Tx.BuiltinBLS12_381_G1_Element + -> Tx.BuiltinBLS12_381_G2_Element + -> Tx.BuiltinBLS12_381_G1_Element + -> Tx.BuiltinBLS12_381_G2_Element + -> Bool +runPairingFunctions p1 q1 p2 q2 = + let r1 = Tx.bls12_381_millerLoop p1 q1 + r2 = Tx.bls12_381_millerLoop p2 q2 + in Tx.bls12_381_finalVerify r1 r2 + +mkPairingScript + :: BuiltinBLS12_381_G1_Element + -> BuiltinBLS12_381_G2_Element + -> BuiltinBLS12_381_G1_Element + -> BuiltinBLS12_381_G2_Element + -> UProg +mkPairingScript p1 q1 p2 q2 = + Tx.getPlcNoAnn $ $$(Tx.compile [|| runPairingFunctions ||]) + `Tx.unsafeApplyCode` Tx.liftCodeDef p1 + `Tx.unsafeApplyCode` Tx.liftCodeDef q1 + `Tx.unsafeApplyCode` Tx.liftCodeDef p2 + `Tx.unsafeApplyCode` Tx.liftCodeDef q2 + +---------------- Groth16 verification ---------------- + +{- | An example of the on-chain computation required for verification of a Groth16 + proof. The data here is derived from + https://github.com/achimcc/groth16-example/blob/main/src/lib.rs -} + +-- Wrappers for compressed group elements for slightly better type safety +newtype CompressedG1Element = CompressedG1Element { g1 :: BuiltinByteString } + deriving newtype (Tx.Lift DefaultUni) + +mkG1Element :: [Word8] -> CompressedG1Element +mkG1Element = CompressedG1Element . toBuiltin . BS.pack + +newtype CompressedG2Element = CompressedG2Element { g2 :: BuiltinByteString } + deriving newtype (Tx.Lift DefaultUni) + +mkG2Element :: [Word8] -> CompressedG2Element +mkG2Element = CompressedG2Element . toBuiltin . BS.pack + +scalar :: Integer +scalar = 0x1884d0cbcc5947434e46d19b3e904e18a8ee8d0d39ce9d315f3b00e338c8f618 + +-- Lots of group elements for input to the computation + +alpha :: CompressedG1Element +alpha = mkG1Element [ 0xb7, 0x1d, 0xb1, 0xfa, 0x5f, 0x41, 0x36, 0x2e + , 0x93, 0x02, 0x5b, 0x35, 0x56, 0xd7, 0x6e, 0xad + , 0x12, 0x25, 0xcf, 0x59, 0x0d, 0x1c, 0xdb, 0x9e + , 0x38, 0x2a, 0x1f, 0xeb, 0xb7, 0x96, 0x3d, 0xcd + , 0x24, 0xa5, 0x1e, 0x18, 0xdf, 0x04, 0xab, 0x22 + , 0x1b, 0xec, 0xaf, 0x29, 0x16, 0x9f, 0xaf, 0x25 ] + +beta :: CompressedG2Element +beta = mkG2Element [ 0xb3, 0xa2, 0x6b, 0x0b, 0x47, 0x12, 0xe7, 0x8d + , 0x5d, 0x71, 0x78, 0x6d, 0x96, 0x13, 0x2a, 0x7c + , 0x58, 0x50, 0x23, 0xa3, 0x66, 0x32, 0xca, 0xda + , 0x44, 0x17, 0x1a, 0xc3, 0xf4, 0x5d, 0xb5, 0x24 + , 0xc3, 0xf6, 0x57, 0x0c, 0x8a, 0x3f, 0x7d, 0xec + , 0x35, 0xae, 0x1a, 0xc3, 0x30, 0x9b, 0x05, 0xdd + , 0x0b, 0x30, 0x6d, 0xb4, 0xf7, 0x4f, 0xd9, 0xec + , 0x42, 0x1c, 0xa7, 0x0c, 0x54, 0x42, 0x5d, 0x92 + , 0x2e, 0xac, 0x4c, 0x40, 0x3b, 0x00, 0xdb, 0x91 + , 0x6f, 0xde, 0xdf, 0x06, 0x5b, 0xdc, 0xe0, 0x0e + , 0xce, 0x17, 0xb9, 0x7a, 0x4e, 0x97, 0x17, 0x3e + , 0x4d, 0x59, 0x89, 0x81, 0x8e, 0xdf, 0xaa, 0x4c ] + +gamma :: CompressedG2Element +gamma = mkG2Element [ 0xb5, 0xac, 0xb8, 0x00, 0xcd, 0x49, 0xed, 0x8c + , 0xbd, 0xdb, 0xf4, 0x91, 0xa1, 0xfc, 0xf8, 0xab + , 0xfc, 0x93, 0xf0, 0x9d, 0x38, 0xbb, 0xb2, 0xec + , 0xb6, 0xb0, 0x8e, 0x23, 0xa4, 0x64, 0x2c, 0xe5 + , 0x9c, 0x9b, 0x03, 0x86, 0x53, 0x9a, 0xc3, 0xce + , 0xcd, 0xfb, 0x66, 0xa9, 0xf0, 0x27, 0xfc, 0x21 + , 0x0f, 0x25, 0x95, 0x10, 0x75, 0x64, 0x44, 0xbc + , 0x5e, 0xef, 0x65, 0x4f, 0x4d, 0x06, 0x12, 0xb5 + , 0xd6, 0x37, 0x5f, 0x95, 0x26, 0xb1, 0xb9, 0x66 + , 0xce, 0x53, 0xb8, 0xf1, 0x25, 0x94, 0xe1, 0xb3 + , 0x99, 0xd0, 0x82, 0x31, 0xcf, 0xe6, 0xc2, 0x69 + , 0xa4, 0x4a, 0xa8, 0xd5, 0x87, 0xf2, 0x36, 0x9d ] + +delta :: CompressedG2Element +delta = mkG2Element [ 0xb3, 0xaa, 0x79, 0x7b, 0xaf, 0xa3, 0x9a, 0x48 + , 0xf6, 0xf8, 0x7c, 0x24, 0x83, 0xc8, 0x94, 0xc2 + , 0x81, 0xc8, 0x07, 0x82, 0x1c, 0x47, 0x30, 0x1f + , 0xfb, 0x75, 0x5a, 0xcf, 0xcf, 0xd2, 0x2c, 0x23 + , 0x23, 0xce, 0xdf, 0x63, 0x49, 0xc7, 0xfe, 0xdd + , 0x32, 0x00, 0xa4, 0xae, 0x55, 0x86, 0x31, 0xe5 + , 0x01, 0xd2, 0x99, 0xeb, 0x93, 0x13, 0x5c, 0x07 + , 0xcf, 0x69, 0x4c, 0xa1, 0x18, 0xd1, 0xb3, 0x86 + , 0x49, 0x05, 0x29, 0xc6, 0x0f, 0x57, 0x93, 0x5c + , 0xef, 0xa8, 0x9f, 0xca, 0xfa, 0x13, 0xa8, 0x3f + , 0x84, 0x20, 0x7b, 0x76, 0xfe, 0x07, 0x8d, 0xc8 + , 0x59, 0xd4, 0x02, 0x74, 0x3d, 0x46, 0x8c, 0x15 ] + +gamma_abc_1 :: CompressedG1Element +gamma_abc_1 = mkG1Element [ 0xb7, 0xf6, 0xd0, 0x6d, 0xd3, 0xe5, 0x24, 0x6e + , 0xf6, 0xb5, 0x1b, 0x07, 0x5c, 0x30, 0xb6, 0x8f + , 0xd4, 0x90, 0xfb, 0xf8, 0x5e, 0x02, 0x05, 0xf7 + , 0x9f, 0xa0, 0x4d, 0x81, 0x13, 0x31, 0x92, 0x13 + , 0x94, 0x63, 0xb5, 0xe8, 0xef, 0xb2, 0x2c, 0x39 + , 0xef, 0x3d, 0xd1, 0xc5, 0x09, 0x20, 0x15, 0xb8 ] + +gamma_abc_2 :: CompressedG1Element +gamma_abc_2 = mkG1Element [ 0xa2, 0xe6, 0x37, 0xdb, 0xff, 0x52, 0xa1, 0xe4 + , 0xa8, 0xc5, 0xd9, 0x85, 0xb3, 0x41, 0x1f, 0xc5 + , 0xfd, 0x44, 0xaf, 0x60, 0x7e, 0x42, 0x92, 0x3e + , 0xab, 0xb4, 0x7a, 0xd8, 0x76, 0xe1, 0xf0, 0x2b + , 0x5b, 0xe0, 0x34, 0xad, 0xaf, 0x73, 0x95, 0x2a + , 0xe8, 0xaf, 0xfe, 0xe5, 0xf5, 0x18, 0x41, 0xde ] + +a :: CompressedG1Element +a = mkG1Element [ 0xa0, 0x5b, 0xe5, 0x0f, 0xab, 0x57, 0x95, 0xbb + , 0x87, 0x84, 0x39, 0x3a, 0x50, 0x45, 0xf9, 0x87 + , 0x47, 0x17, 0x3a, 0xd2, 0x87, 0xf5, 0x5e, 0x21 + , 0x34, 0x71, 0xbd, 0x55, 0x97, 0x45, 0x55, 0x14 + , 0x52, 0x45, 0x3c, 0x4c, 0x3a, 0x39, 0xe7, 0xc8 + , 0x83, 0x10, 0x84, 0x9f, 0x3c, 0x7a, 0x1f, 0xc3 ] + +b :: CompressedG2Element +b = mkG2Element [ 0xad, 0x63, 0x48, 0xb6, 0xb7, 0xb3, 0x4c, 0x86 + , 0xbf, 0x37, 0xa7, 0x48, 0xcd, 0x2d, 0x82, 0xa2 + , 0x50, 0xdf, 0xc6, 0x48, 0x46, 0x75, 0x66, 0x88 + , 0x25, 0xa1, 0x6f, 0x7d, 0xa6, 0xa0, 0x4d, 0x34 + , 0x24, 0x11, 0x3e, 0x32, 0x5c, 0xe7, 0x34, 0xec + , 0x44, 0x95, 0x60, 0x82, 0xc0, 0xa0, 0x6e, 0x5f + , 0x18, 0x68, 0xe1, 0xf1, 0xa6, 0xe5, 0x59, 0xb9 + , 0xfe, 0x81, 0xf1, 0xa9, 0x01, 0xf8, 0xa6, 0x34 + , 0x1b, 0x30, 0x1c, 0x45, 0xb2, 0x5d, 0x30, 0x80 + , 0xfb, 0xc5, 0x03, 0x93, 0x53, 0xd8, 0xf7, 0x1b + , 0x55, 0x0b, 0x27, 0x4e, 0xc4, 0xc0, 0x7c, 0x70 + , 0xcd, 0x11, 0x53, 0x56, 0x2c, 0x31, 0x4c, 0x97 ] + +c :: CompressedG1Element +c = mkG1Element [ 0xb5, 0x69, 0xcc, 0x49, 0x1b, 0x4d, 0xf0, 0x35 + , 0xcb, 0xf4, 0x9e, 0x95, 0x1f, 0xd4, 0xfe, 0x30 + , 0xaa, 0x82, 0x36, 0xb0, 0xe2, 0xaf, 0x68, 0xf4 + , 0xc1, 0x59, 0x2c, 0xd4, 0x0d, 0xeb, 0xeb, 0x71 + , 0x8a, 0xf3, 0x36, 0x39, 0xdb, 0x6b, 0xc1, 0xe2 + , 0xda, 0x9d, 0x98, 0xe5, 0x53, 0xe5, 0xea, 0xed ] + +{-# INLINABLE groth16Verify #-} +groth16Verify + :: BuiltinByteString -- G1 + -> BuiltinByteString -- G2 + -> BuiltinByteString -- G2 + -> BuiltinByteString -- G1 + -> BuiltinByteString -- G1 + -> BuiltinByteString -- G1 + -> BuiltinByteString -- G1 + -> BuiltinByteString -- G2 + -> BuiltinByteString -- G1 + -> Integer + -> Bool +groth16Verify (Tx.bls12_381_G1_uncompress -> alpha') + (Tx.bls12_381_G2_uncompress -> beta') + (Tx.bls12_381_G2_uncompress -> gamma') + (Tx.bls12_381_G2_uncompress -> delta') + (Tx.bls12_381_G1_uncompress -> abc1') + (Tx.bls12_381_G1_uncompress -> abc2') + (Tx.bls12_381_G1_uncompress -> a') + (Tx.bls12_381_G2_uncompress -> b') + (Tx.bls12_381_G1_uncompress -> c') + s = + let l1 = Tx.bls12_381_millerLoop a' b' + l2 = Tx.bls12_381_millerLoop alpha' beta' + l3 = Tx.bls12_381_millerLoop c' delta' + p = Tx.bls12_381_G1_add abc1' (Tx.bls12_381_G1_scalarMul s abc2') + l4 = Tx.bls12_381_millerLoop p gamma' + y = Tx.bls12_381_mulMlResult l2 (Tx.bls12_381_mulMlResult l3 l4) + in Tx.bls12_381_finalVerify l1 y + +{- | Make a UPLC script applying groth16Verify to the inputs. Passing the + newtype inputs increases the size and CPU cost slightly, so we unwrap them + first. This should return `True`. -} +mkGroth16VerifyScript :: UProg +mkGroth16VerifyScript = + Tx.getPlcNoAnn $ $$(Tx.compile [|| groth16Verify ||]) + `Tx.unsafeApplyCode` (Tx.liftCodeDef $ g1 alpha) + `Tx.unsafeApplyCode` (Tx.liftCodeDef $ g2 beta) + `Tx.unsafeApplyCode` (Tx.liftCodeDef $ g2 gamma) + `Tx.unsafeApplyCode` (Tx.liftCodeDef $ g2 delta) + `Tx.unsafeApplyCode` (Tx.liftCodeDef $ g1 gamma_abc_1) + `Tx.unsafeApplyCode` (Tx.liftCodeDef $ g1 gamma_abc_2) + `Tx.unsafeApplyCode` (Tx.liftCodeDef $ g1 a) + `Tx.unsafeApplyCode` (Tx.liftCodeDef $ g2 b) + `Tx.unsafeApplyCode` (Tx.liftCodeDef $ g1 c) + `Tx.unsafeApplyCode` Tx.liftCodeDef scalar + +-- | Check that the Haskell version returns the correct result. +checkGroth16Verify_Haskell :: Bool +checkGroth16Verify_Haskell = + groth16Verify (g1 alpha) (g2 beta) (g2 gamma) (g2 delta) + (g1 gamma_abc_1) (g1 gamma_abc_2) (g1 a) (g2 b) (g1 c) scalar + diff --git a/plutus-benchmark/changelog.d/20230310_185153_effectfully_stop_the_irrelevance.rst b/plutus-benchmark/changelog.d/20230310_185153_effectfully_stop_the_irrelevance.rst deleted file mode 100644 index 3b60d0298c8..00000000000 --- a/plutus-benchmark/changelog.d/20230310_185153_effectfully_stop_the_irrelevance.rst +++ /dev/null @@ -1,4 +0,0 @@ -Fixed ------ - -- Made the `validation` benchmarks use the actual production evaluator (#5200) diff --git a/plutus-benchmark/common/PlutusBenchmark/Common.hs b/plutus-benchmark/common/PlutusBenchmark/Common.hs index f359d3c2880..d206e62732b 100644 --- a/plutus-benchmark/common/PlutusBenchmark/Common.hs +++ b/plutus-benchmark/common/PlutusBenchmark/Common.hs @@ -47,7 +47,7 @@ getConfig limit = do timeLimit = limit } -type Term = UPLC.Term PLC.NamedDeBruijn DefaultUni DefaultFun () +type Term = UPLC.Term PLC.NamedDeBruijn DefaultUni DefaultFun () {- | Given a DeBruijn-named term, give every variable the name "v". If we later call unDeBruijn, that will rename the variables to things like "v123", where diff --git a/plutus-benchmark/ed25519-throughput/Main.hs b/plutus-benchmark/ed25519-throughput/Main.hs index 3b25da35935..1205fa00f5c 100644 --- a/plutus-benchmark/ed25519-throughput/Main.hs +++ b/plutus-benchmark/ed25519-throughput/Main.hs @@ -110,6 +110,7 @@ builtinHash :: BuiltinHashFun builtinHash = Tx.sha2_256 -- Create a list containing n bytestrings of length l. This could be better. +{-# NOINLINE listOfSizedByteStrings #-} listOfSizedByteStrings :: Integer -> Integer -> [ByteString] listOfSizedByteStrings n l = unsafePerformIO . G.sample $ G.list (R.singleton $ fromIntegral n) diff --git a/plutus-benchmark/plutus-benchmark.cabal b/plutus-benchmark/plutus-benchmark.cabal index 0ad0f6349cc..dd1a06930a0 100644 --- a/plutus-benchmark/plutus-benchmark.cabal +++ b/plutus-benchmark/plutus-benchmark.cabal @@ -332,6 +332,67 @@ executable ed25519-throughput , plutus-tx ^>=1.7 , plutus-tx-plugin ^>=1.7 +---------------- BLS12-381 experiments ---------------- + +library bls-internal + import: lang + + if impl(ghc <9.0) + buildable: False + + -- Something weird causes this to sometimes report + -- the plugin package as unused... + ghc-options: -Wno-unused-packages + hs-source-dirs: bls-benchmarks/src + exposed-modules: PlutusBenchmark.BLS12_381.Common + build-depends: + , base >=4.9 && <5 + , bytestring + , cardano-crypto-class + , deepseq + , hedgehog + , plutus-benchmark-common + , plutus-core ^>=1.7 + , plutus-tx ^>=1.7 + , plutus-tx-plugin ^>=1.7 + +-- Print out predicted costs of various scripts involving BLS12_381 operations +executable bls-costs + import: lang + + if impl(ghc <9.0) + buildable: False + + default-language: Haskell2010 + main-is: Main.hs + hs-source-dirs: bls-benchmarks/exe + build-depends: + , base >=4.9 && <5 + , bls-internal + , bytestring + , flat + , plutus-core ^>=1.7 + , plutus-tx ^>=1.7 + +-- Run benchmarks for various scripts involving BLS12_381 operations +benchmark bls-benchmarks + import: lang + + if impl(ghc <9.0) + buildable: False + + type: exitcode-stdio-1.0 + main-is: Bench.hs + hs-source-dirs: bls-benchmarks/bench + build-depends: + , base >=4.9 && <5 + , bls-internal + , bytestring + , criterion >=1.5.9.0 + , plutus-benchmark-common + , plutus-core ^>=1.7 + , plutus-tx ^>=1.7 + ---------------- script contexts ---------------- library script-contexts-internal diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-1/bad-syntax-1.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-1/bad-syntax-1.uplc new file mode 100644 index 00000000000..0ed6ae36234 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-1/bad-syntax-1.uplc @@ -0,0 +1,4 @@ +-- Missing the 0x prefix. +(program 0.0.0 +(con bls12_381_G1_element c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-1/bad-syntax-1.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-1/bad-syntax-1.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-1/bad-syntax-1.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-2/bad-syntax-2.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-2/bad-syntax-2.uplc new file mode 100644 index 00000000000..8f780571775 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-2/bad-syntax-2.uplc @@ -0,0 +1,4 @@ +-- This has # instead of 0x. +(program 0.0.0 +(con bls12_381_G1_element #c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-2/bad-syntax-2.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-2/bad-syntax-2.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-syntax-2/bad-syntax-2.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-1/bad-zero-1.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-1/bad-zero-1.uplc new file mode 100644 index 00000000000..0bd57991a8e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-1/bad-zero-1.uplc @@ -0,0 +1,4 @@ +-- A bad encoding: this has the negative bit set, but nothing else. +(program 0.0.0 +(con bls12_381_G1_element 0x400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-1/bad-zero-1.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-1/bad-zero-1.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-1/bad-zero-1.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-2/bad-zero-2.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-2/bad-zero-2.uplc new file mode 100644 index 00000000000..7809efb253f --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-2/bad-zero-2.uplc @@ -0,0 +1,4 @@ +-- Almost a correct representation of the zero point, but with the negation bit set. +(program 0.0.0 +(con bls12_381_G1_element 0xe00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-2/bad-zero-2.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-2/bad-zero-2.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-2/bad-zero-2.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-3/bad-zero-3.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-3/bad-zero-3.uplc new file mode 100644 index 00000000000..b68f07f037d --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-3/bad-zero-3.uplc @@ -0,0 +1,4 @@ +-- The zero point, but with a random bit set in the body (should all be 0) +(program 0.0.0 +(con bls12_381_G1_element 0xc00000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-3/bad-zero-3.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-3/bad-zero-3.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/bad-zero-3/bad-zero-3.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/off-curve/off-curve.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/off-curve/off-curve.uplc new file mode 100644 index 00000000000..9a2cea0cf93 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/off-curve/off-curve.uplc @@ -0,0 +1,4 @@ +-- This encodes a field element which isn't the x-coordinate of any point on the curve (no square root). +(program 0.0.0 +(con bls12_381_G1_element 0xa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/off-curve/off-curve.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/off-curve/off-curve.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/off-curve/off-curve.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-clear/on-curve-bit3-clear.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-clear/on-curve-bit3-clear.uplc new file mode 100644 index 00000000000..8a18eac52b4 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-clear/on-curve-bit3-clear.uplc @@ -0,0 +1,4 @@ +-- This is a valid encoding with the sign bit clear. +(program 0.0.0 +(con bls12_381_G1_element 0x81e9a0c68985059bd25a5ef05b351ca22f7d7c19e37928583ae12a1f4939440ff754cfd85b23df4a54f66c7089db6deb) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected new file mode 100644 index 00000000000..d66818b0c7c --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected @@ -0,0 +1,7 @@ +(program + 0.0.0 + (con + bls12_381_G1_element + 0x81e9a0c68985059bd25a5ef05b351ca22f7d7c19e37928583ae12a1f4939440ff754cfd85b23df4a54f66c7089db6deb + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-set/on-curve-bit3-set.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-set/on-curve-bit3-set.uplc new file mode 100644 index 00000000000..b62e1f56624 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-set/on-curve-bit3-set.uplc @@ -0,0 +1,4 @@ +-- This is a valid encoding with the sign bit set (obtained by hashing 0x0102030405 to G1) +(program 0.0.0 +(con bls12_381_G1_element 0xa1e9a0c68985059bd25a5ef05b351ca22f7d7c19e37928583ae12a1f4939440ff754cfd85b23df4a54f66c7089db6deb) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-set/on-curve-bit3-set.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-set/on-curve-bit3-set.uplc.expected new file mode 100644 index 00000000000..207dc29498f --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-bit3-set/on-curve-bit3-set.uplc.expected @@ -0,0 +1,7 @@ +(program + 0.0.0 + (con + bls12_381_G1_element + 0xa1e9a0c68985059bd25a5ef05b351ca22f7d7c19e37928583ae12a1f4939440ff754cfd85b23df4a54f66c7089db6deb + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc new file mode 100644 index 00000000000..2c9a0a3697e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc @@ -0,0 +1,5 @@ +-- This is a valid serialisation of a point on G1 (obtained by hashing 0x0102030405), +-- but we only accept compressed points. +(program 0.0.0 +(con bls12_381_G1_element 0x01e9a0c68985059bd25a5ef05b351ca22f7d7c19e37928583ae12a1f4939440ff754cfd85b23df4a54f66c7089db6deb12ae8470d881eb628dfcf4bb083fb8a6968d907a0c265f6d06e04b05a19418d395d3e0c115430f88e7156822904ef5bf) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/out-of-group/out-of-group.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/out-of-group/out-of-group.uplc new file mode 100644 index 00000000000..9c5eee17827 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/out-of-group/out-of-group.uplc @@ -0,0 +1,4 @@ +-- This is a valid point on the E1 curve, but it's not in the G1 subgroup. +(program 0.0.0 +(con bls12_381_G1_element 0xa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/out-of-group/out-of-group.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/out-of-group/out-of-group.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/out-of-group/out-of-group.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-long/too-long.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-long/too-long.uplc new file mode 100644 index 00000000000..f97781c738a --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-long/too-long.uplc @@ -0,0 +1,4 @@ +-- The compressed encoding of the zero element of G1, but with an extra zero byte at the end. +(program 0.0.0 +(con bls12_381_G1_element 0xc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-long/too-long.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-long/too-long.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-long/too-long.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-short/too-short.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-short/too-short.uplc new file mode 100644 index 00000000000..df72313eb27 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-short/too-short.uplc @@ -0,0 +1,4 @@ +-- The zero element of G1, but one byte short +(program 0.0.0 +(con bls12_381_G1_element 0xc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-short/too-short.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-short/too-short.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/too-short/too-short.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/zero/zero.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/zero/zero.uplc new file mode 100644 index 00000000000..78eee62828c --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/zero/zero.uplc @@ -0,0 +1,4 @@ +-- A correct compressed encoding of the zero element of G1. +(program 0.0.0 +(con bls12_381_G1_element 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/zero/zero.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/zero/zero.uplc.expected new file mode 100644 index 00000000000..63a548b8782 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G1/zero/zero.uplc.expected @@ -0,0 +1,7 @@ +(program + 0.0.0 + (con + bls12_381_G1_element + 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-1/bad-syntax-1.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-1/bad-syntax-1.uplc new file mode 100644 index 00000000000..22406d89fad --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-1/bad-syntax-1.uplc @@ -0,0 +1,4 @@ +-- Missing the 0x prefix. +(program 0.0.0 +(con bls12_381_G2_element c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-1/bad-syntax-1.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-1/bad-syntax-1.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-1/bad-syntax-1.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-2/bad-syntax-2.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-2/bad-syntax-2.uplc new file mode 100644 index 00000000000..8f95d3ee7a5 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-2/bad-syntax-2.uplc @@ -0,0 +1,4 @@ +-- This has # instead of 0x. +(program 0.0.0 +(con bls12_381_G2_element #c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-2/bad-syntax-2.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-2/bad-syntax-2.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-syntax-2/bad-syntax-2.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-1/bad-zero-1.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-1/bad-zero-1.uplc new file mode 100644 index 00000000000..220457d62b5 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-1/bad-zero-1.uplc @@ -0,0 +1,4 @@ +-- A bad encoding: this has the negative bit set, but nothing else. +(program 0.0.0 +(con bls12_381_G2_element 0x400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-1/bad-zero-1.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-1/bad-zero-1.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-1/bad-zero-1.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-2/bad-zero-2.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-2/bad-zero-2.uplc new file mode 100644 index 00000000000..c8907a22885 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-2/bad-zero-2.uplc @@ -0,0 +1,4 @@ +-- Almost a correct represntation of the zero point, but with the negation bit set. +(program 0.0.0 +(con bls12_381_G2_element 0xe00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-2/bad-zero-2.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-2/bad-zero-2.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-2/bad-zero-2.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-3/bad-zero-3.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-3/bad-zero-3.uplc new file mode 100644 index 00000000000..abf4ad4c8bc --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-3/bad-zero-3.uplc @@ -0,0 +1,4 @@ +-- The zero point, but with a random bit set in the body (should all be 0) +(program 0.0.0 +(con bls12_381_G2_element 0xc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-3/bad-zero-3.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-3/bad-zero-3.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/bad-zero-3/bad-zero-3.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/off-curve/off-curve.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/off-curve/off-curve.uplc new file mode 100644 index 00000000000..749f56f1ba2 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/off-curve/off-curve.uplc @@ -0,0 +1,4 @@ +-- This encodes a field element which isn't the x-coordinate of any point on the curve (no square root). +(program 0.0.0 +(con bls12_381_G2_element 0xa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/off-curve/off-curve.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/off-curve/off-curve.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/off-curve/off-curve.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-clear/on-curve-bit3-clear.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-clear/on-curve-bit3-clear.uplc new file mode 100644 index 00000000000..1cd98b2a00f --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-clear/on-curve-bit3-clear.uplc @@ -0,0 +1,4 @@ +-- This is a valid encoding with the sign bit clear. +(program 0.0.0 +(con bls12_381_G2_element 0x88138ebea766d4d1aa64dd3b5826244c32ea3fe9351f9c8d584203716dae151d14bb5d06e245c24877955c79287682ba082d077bbb2afdb1ad1d48d18e2f0c56b001bce207801adfa9fd451fc59d56f0433b02f921ba5a272c58c06536291d07) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected new file mode 100644 index 00000000000..ca926b8fba1 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected @@ -0,0 +1,7 @@ +(program + 0.0.0 + (con + bls12_381_G2_element + 0x88138ebea766d4d1aa64dd3b5826244c32ea3fe9351f9c8d584203716dae151d14bb5d06e245c24877955c79287682ba082d077bbb2afdb1ad1d48d18e2f0c56b001bce207801adfa9fd451fc59d56f0433b02f921ba5a272c58c06536291d07 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-set/on-curve-bit3-set.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-set/on-curve-bit3-set.uplc new file mode 100644 index 00000000000..fbcc5915dad --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-set/on-curve-bit3-set.uplc @@ -0,0 +1,4 @@ +-- This is a valid encoding with the sign bit set (obtained by hashing 0x0102030405 to G2) +(program 0.0.0 +(con bls12_381_G2_element 0xa8138ebea766d4d1aa64dd3b5826244c32ea3fe9351f9c8d584203716dae151d14bb5d06e245c24877955c79287682ba082d077bbb2afdb1ad1d48d18e2f0c56b001bce207801adfa9fd451fc59d56f0433b02f921ba5a272c58c06536291d07) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-set/on-curve-bit3-set.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-set/on-curve-bit3-set.uplc.expected new file mode 100644 index 00000000000..99a8697468a --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-bit3-set/on-curve-bit3-set.uplc.expected @@ -0,0 +1,7 @@ +(program + 0.0.0 + (con + bls12_381_G2_element + 0xa8138ebea766d4d1aa64dd3b5826244c32ea3fe9351f9c8d584203716dae151d14bb5d06e245c24877955c79287682ba082d077bbb2afdb1ad1d48d18e2f0c56b001bce207801adfa9fd451fc59d56f0433b02f921ba5a272c58c06536291d07 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc new file mode 100644 index 00000000000..400d3bfa0dc --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc @@ -0,0 +1,5 @@ +-- This is a valid serialisation of a point on G2 (obtained by hashing 0x0102030405), +-- but we only accept compressed points. +(program 0.0.0 +(con bls12_381_G2_element 0x08138ebea766d4d1aa64dd3b5826244c32ea3fe9351f9c8d584203716dae151d14bb5d06e245c24877955c79287682ba082d077bbb2afdb1ad1d48d18e2f0c56b001bce207801adfa9fd451fc59d56f0433b02f921ba5a272c58c06536291d071676b275e27060b26dd91aac0a1feb56d1c1de7c323f486e48d54eae0c3c8f4caa45faad589c5d180ac0830dcdb3ecd8126c9c5db86cdf7129cf18582013d267a7c2827a901ef61ab58e7ef150219441abc57671eb39009f6bb166bcbade700d) +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/on-curve-serialised-not-compressed/on-curve-seriliased-not-compressed.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/out-of-group/out-of-group.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/out-of-group/out-of-group.uplc new file mode 100644 index 00000000000..2bfb2df2c05 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/out-of-group/out-of-group.uplc @@ -0,0 +1,4 @@ +-- This is a valid point on the E2 curve, but it's not in the G2 subgroup. +(program 0.0.0 +(con bls12_381_G2_element 0xa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/out-of-group/out-of-group.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/out-of-group/out-of-group.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/out-of-group/out-of-group.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-long/too-long.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-long/too-long.uplc new file mode 100644 index 00000000000..06802b52d34 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-long/too-long.uplc @@ -0,0 +1,4 @@ +-- The compressed encoding of the zero element of G2, but with an extra zero byte at the end. +(program 0.0.0 +(con bls12_381_G2_element 0xc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-long/too-long.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-long/too-long.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-long/too-long.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-short/too-short.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-short/too-short.uplc new file mode 100644 index 00000000000..4513a488caa --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-short/too-short.uplc @@ -0,0 +1,4 @@ +-- The zero element of G2, but one byte short +(program 0.0.0 +(con bls12_381_G2_element 0xc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-short/too-short.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-short/too-short.uplc.expected new file mode 100644 index 00000000000..fd56948990e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/too-short/too-short.uplc.expected @@ -0,0 +1 @@ +parse error \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/zero/zero.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/zero/zero.uplc new file mode 100644 index 00000000000..63a8301e671 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/zero/zero.uplc @@ -0,0 +1,4 @@ +-- A correct compressed encoding of the zero element of G2 +(program 0.0.0 +(con bls12_381_G2_element 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/zero/zero.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/zero/zero.uplc.expected new file mode 100644 index 00000000000..9b995f812ab --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/constant/bls12-381/G2/zero/zero.uplc.expected @@ -0,0 +1,7 @@ +(program + 0.0.0 + (con + bls12_381_G2_element + 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-associative/add-associative.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-associative/add-associative.uplc new file mode 100644 index 00000000000..656eb7e8654 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-associative/add-associative.uplc @@ -0,0 +1,33 @@ +-- p+(q+r) = (p+q)+r for three random points on G1. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_equal) + [ + [ + (builtin bls12_381_G1_add) + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + [ + [ + (builtin bls12_381_G1_add) + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] + (con bls12_381_G1_element 0xb962fd0cc81048e0cf7557bf3e4b6edc5ab4bfb3dc87f83af428b6300727b139c404ab159bdf2eaea3f649903421537f) + ] + ] + ] + [ + (builtin bls12_381_G1_add) + [ + [ + (builtin bls12_381_G1_add) + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] + (con bls12_381_G1_element 0xb962fd0cc81048e0cf7557bf3e4b6edc5ab4bfb3dc87f83af428b6300727b139c404ab159bdf2eaea3f649903421537f) + ] + ] +) + diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-associative/add-associative.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-associative/add-associative.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-associative/add-associative.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-commutative/add-commutative.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-commutative/add-commutative.uplc new file mode 100644 index 00000000000..54d75b3c6a9 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-commutative/add-commutative.uplc @@ -0,0 +1,22 @@ +-- p+q = q+p for two random points in G1. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_equal) + [ + [ + (builtin bls12_381_G1_add) + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] + ] + [ + [ + (builtin bls12_381_G1_add) + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-commutative/add-commutative.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-commutative/add-commutative.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-commutative/add-commutative.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-zero/add-zero.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-zero/add-zero.uplc new file mode 100644 index 00000000000..f2b27774bc8 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-zero/add-zero.uplc @@ -0,0 +1,10 @@ +-- Adding the zero element to a random point doesn't change it. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_add) + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + (con bls12_381_G1_element 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-zero/add-zero.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-zero/add-zero.uplc.expected new file mode 100644 index 00000000000..67f6485eba1 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add-zero/add-zero.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add/add.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add/add.uplc new file mode 100644 index 00000000000..807a32bff97 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add/add.uplc @@ -0,0 +1,10 @@ +-- Adding a random pair of points in G1 +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_add) + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add/add.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add/add.uplc.expected new file mode 100644 index 00000000000..233b768f87b --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_add/add/add.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0xa4870e983a149bb1e7cc70fde907a2aa52302833bce4d62f679819022924e9caab52e3631d376d36d9692664b4cfbc22 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_compress/compress/compress.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_compress/compress/compress.uplc new file mode 100644 index 00000000000..90ee2269c48 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_compress/compress/compress.uplc @@ -0,0 +1,7 @@ +-- Check that compression of a random point in G1 succeeds and gives the expected result. +(program 1.0.0 + [ + (builtin bls12_381_G1_compress) + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_compress/compress/compress.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_compress/compress/compress.uplc.expected new file mode 100644 index 00000000000..a7fad2a09c2 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_compress/compress/compress.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bytestring + #950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-false/equal-false.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-false/equal-false.uplc new file mode 100644 index 00000000000..34b2ace7577 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-false/equal-false.uplc @@ -0,0 +1,10 @@ +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_equal) + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] +) + diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-false/equal-false.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-false/equal-false.uplc.expected new file mode 100644 index 00000000000..3ee9f07f31d --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-false/equal-false.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool False)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-true/equal-true.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-true/equal-true.uplc new file mode 100644 index 00000000000..c0653b789d5 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-true/equal-true.uplc @@ -0,0 +1,10 @@ +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_equal) + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] +) + diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-true/equal-true.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-true/equal-true.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_equal/equal-true/equal-true.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc new file mode 100644 index 00000000000..03438c0e74a --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc @@ -0,0 +1,23 @@ +-- Check that hashing different messages with the same DST gives different +-- results: this should return False. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_equal) + [ + [ + (builtin bls12_381_G1_hashToGroup) + (con bytestring #8e) + ] + (con bytestring #0a) + ] + ] + [ + [ + (builtin bls12_381_G1_hashToGroup) + (con bytestring #81) + ] + (con bytestring #0a) + ] + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc.expected new file mode 100644 index 00000000000..3ee9f07f31d --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool False)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc new file mode 100644 index 00000000000..fa4446d66ff --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc @@ -0,0 +1,10 @@ +-- Maximum length of DST is 255 bytes: this should be OK +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_hashToGroup) + (con bytestring #3f) + ] + (con bytestring #123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc.expected new file mode 100644 index 00000000000..4108e2b1f4b --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0x931bd1f65dd2d34a55c93d82c20dcacd3a91afa5932fdd7fed06119f8574520c9609d337d680060b4bd2c59f0b60bb54 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc new file mode 100644 index 00000000000..c26a6322534 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc @@ -0,0 +1,10 @@ +-- Maximum length of DST is 255 bytes: this should fail +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_hashToGroup) + (con bytestring #3f) + ] + (con bytestring #123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890ff) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-empty-dst/hash-empty-dst.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-empty-dst/hash-empty-dst.uplc new file mode 100644 index 00000000000..be2ec7805e2 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-empty-dst/hash-empty-dst.uplc @@ -0,0 +1,10 @@ +-- Check that hashing a random bytestring with an empty DST gives the expected result. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_hashToGroup) + (con bytestring #8e) + ] + (con bytestring #) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-empty-dst/hash-empty-dst.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-empty-dst/hash-empty-dst.uplc.expected new file mode 100644 index 00000000000..6f6aa1a8030 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-empty-dst/hash-empty-dst.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0x9019067bf1fa5b2a7a40fb31a70c66f25a3de7e3ef42f8365c9b7963dc01e15a2e086df6d1a181b1d12811a520440909 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc new file mode 100644 index 00000000000..143d83881ee --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc @@ -0,0 +1,23 @@ +-- Check that hashing the same message with different DSTs gives different +-- results: this should return False. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_equal) + [ + [ + (builtin bls12_381_G1_hashToGroup) + (con bytestring #8e) + ] + (con bytestring #0a) + ] + ] + [ + [ + (builtin bls12_381_G1_hashToGroup) + (con bytestring #8e) + ] + (con bytestring #01) + ] + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc.expected new file mode 100644 index 00000000000..3ee9f07f31d --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool False)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash/hash.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash/hash.uplc new file mode 100644 index 00000000000..2675d56267a --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash/hash.uplc @@ -0,0 +1,10 @@ +-- Check that hashing a random bytestring gives the expected result. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_hashToGroup) + (con bytestring #8e) + ] + (con bytestring #0a) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash/hash.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash/hash.uplc.expected new file mode 100644 index 00000000000..b0e88897420 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_hashToGroup/hash/hash.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0xa45ddef02cdd86039be4b0a863cba70ea903194ea0489ce619c6276175839d62eea72b095d6566067f4a44b85614f199 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/add-neg/add-neg.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/add-neg/add-neg.uplc new file mode 100644 index 00000000000..92d3c7a915f --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/add-neg/add-neg.uplc @@ -0,0 +1,13 @@ +-- Check that adding a random point to its negative gives the zero element. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_add) + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] + [ + (builtin bls12_381_G1_neg) + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/add-neg/add-neg.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/add-neg/add-neg.uplc.expected new file mode 100644 index 00000000000..2ea2f53f47c --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/add-neg/add-neg.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg-zero/neg-zero.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg-zero/neg-zero.uplc new file mode 100644 index 00000000000..f66ddeda40c --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg-zero/neg-zero.uplc @@ -0,0 +1,7 @@ +-- The negative of the zero point is the zero point. +(program 1.0.0 + [ + (builtin bls12_381_G1_neg) + (con bls12_381_G1_element 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg-zero/neg-zero.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg-zero/neg-zero.uplc.expected new file mode 100644 index 00000000000..2ea2f53f47c --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg-zero/neg-zero.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg/neg.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg/neg.uplc new file mode 100644 index 00000000000..7bc37d591dc --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg/neg.uplc @@ -0,0 +1,7 @@ +-- Check that negating a random point in G1 gives the expected result. +(program 1.0.0 + [ + (builtin bls12_381_G1_neg) + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg/neg.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg/neg.uplc.expected new file mode 100644 index 00000000000..c53839615ce --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_neg/neg/neg.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0x8bd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/addmul/addmul.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/addmul/addmul.uplc new file mode 100644 index 00000000000..0701e6bf94d --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/addmul/addmul.uplc @@ -0,0 +1,22 @@ +-- 2157p + 2157q for random points p and q in G1. This should give the same result as muladd. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_add) + [ + [ + (builtin bls12_381_G1_scalarMul) + (con integer 2157) + ] + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] + ] + [ + [ + (builtin bls12_381_G1_scalarMul) + (con integer 2157) + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/addmul/addmul.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/addmul/addmul.uplc.expected new file mode 100644 index 00000000000..8a8440b5c93 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/addmul/addmul.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0x8cc84679c6c870408169a656c245a2ab9ccc46598769b19f07711c18624284d1bfa33667cac7b99a12e058abfd14ef88 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul0/mul0.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul0/mul0.uplc new file mode 100644 index 00000000000..f4858c59c92 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul0/mul0.uplc @@ -0,0 +1,10 @@ +-- Multiplication by the zero scalar gives the zero point of G1. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_scalarMul) + (con integer 0) + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul0/mul0.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul0/mul0.uplc.expected new file mode 100644 index 00000000000..2ea2f53f47c --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul0/mul0.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul1/mul1.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul1/mul1.uplc new file mode 100644 index 00000000000..d1718d8ee5f --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul1/mul1.uplc @@ -0,0 +1,10 @@ +-- Scalar multiplication by 1 leaves a random point unchanged. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_scalarMul) + (con integer 1) + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul1/mul1.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul1/mul1.uplc.expected new file mode 100644 index 00000000000..67f6485eba1 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul1/mul1.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul19+25/mul19+25.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul19+25/mul19+25.uplc new file mode 100644 index 00000000000..4f179b654ab --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul19+25/mul19+25.uplc @@ -0,0 +1,22 @@ +-- 19p+25p for a random point p in G1. This should give the same result as mul44. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_add) + [ + [ + (builtin bls12_381_G1_scalarMul) + (con integer 19) + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + ] + [ + [ + (builtin bls12_381_G1_scalarMul) + (con integer 25) + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul19+25/mul19+25.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul19+25/mul19+25.uplc.expected new file mode 100644 index 00000000000..de8b77d3929 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul19+25/mul19+25.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0x8d9e9f6adcea14e8d38221bb3cfe4afdcc59b86e9d3b0093c0ef8252d5d90dfc5d73c9e9d352b9a54b46d35e7ff4d58c + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul44/mul44.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul44/mul44.uplc new file mode 100644 index 00000000000..968a91530a6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul44/mul44.uplc @@ -0,0 +1,10 @@ +-- Check that multiplication by the scalar 44 gives the expected result. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_scalarMul) + (con integer 44) + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul44/mul44.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul44/mul44.uplc.expected new file mode 100644 index 00000000000..de8b77d3929 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul44/mul44.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0x8d9e9f6adcea14e8d38221bb3cfe4afdcc59b86e9d3b0093c0ef8252d5d90dfc5d73c9e9d352b9a54b46d35e7ff4d58c + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul4x11/mul4x11.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul4x11/mul4x11.uplc new file mode 100644 index 00000000000..8e6057a13d9 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul4x11/mul4x11.uplc @@ -0,0 +1,16 @@ +-- 4*(11*p) for a point in G1. This should give the same result as mul44. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_scalarMul) + (con integer 4) + ] + [ + [ + (builtin bls12_381_G1_scalarMul) + (con integer 11) + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul4x11/mul4x11.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul4x11/mul4x11.uplc.expected new file mode 100644 index 00000000000..de8b77d3929 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mul4x11/mul4x11.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0x8d9e9f6adcea14e8d38221bb3cfe4afdcc59b86e9d3b0093c0ef8252d5d90dfc5d73c9e9d352b9a54b46d35e7ff4d58c + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/muladd/muladd.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/muladd/muladd.uplc new file mode 100644 index 00000000000..1e28131d567 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/muladd/muladd.uplc @@ -0,0 +1,16 @@ +-- n(p+q) = np + nq (n scalar, p and q random points in G1). +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_scalarMul) + (con integer 2157) + ] + [ + [ + (builtin bls12_381_G1_add) + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/muladd/muladd.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/muladd/muladd.uplc.expected new file mode 100644 index 00000000000..8a8440b5c93 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/muladd/muladd.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0x8cc84679c6c870408169a656c245a2ab9ccc46598769b19f07711c18624284d1bfa33667cac7b99a12e058abfd14ef88 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg1/mulneg1.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg1/mulneg1.uplc new file mode 100644 index 00000000000..b15f84a513d --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg1/mulneg1.uplc @@ -0,0 +1,10 @@ +-- Check that the result of multiplying by -1 is as expected. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_scalarMul) + (con integer -1) + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg1/mulneg1.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg1/mulneg1.uplc.expected new file mode 100644 index 00000000000..c53839615ce --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg1/mulneg1.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0x8bd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg44/mulneg44.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg44/mulneg44.uplc new file mode 100644 index 00000000000..f9e5a077bd1 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg44/mulneg44.uplc @@ -0,0 +1,10 @@ +-- Multiplying a random point in G1 by the scalar -44 gives the expected result. +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_scalarMul) + (con integer -44) + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg44/mulneg44.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg44/mulneg44.uplc.expected new file mode 100644 index 00000000000..e96e2fa1eec --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulneg44/mulneg44.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G1_element + 0xad9e9f6adcea14e8d38221bb3cfe4afdcc59b86e9d3b0093c0ef8252d5d90dfc5d73c9e9d352b9a54b46d35e7ff4d58c + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic1/mulperiodic1.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic1/mulperiodic1.uplc new file mode 100644 index 00000000000..974dc102591 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic1/mulperiodic1.uplc @@ -0,0 +1,13 @@ +-- Scalar multiplication by the group size should give you the zero element of the group. +(program 1.0.0 +[ + [ (builtin bls12_381_G1_equal) + [ + (builtin bls12_381_G1_scalarMul) + (con integer 52435875175126190479447740508185965837690552500527637822603658699938581184513 ) + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + ] + (con bls12_381_G1_element 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic1/mulperiodic1.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic1/mulperiodic1.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic1/mulperiodic1.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic2/mulperiodic2.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic2/mulperiodic2.uplc new file mode 100644 index 00000000000..8b0277589cc --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic2/mulperiodic2.uplc @@ -0,0 +1,23 @@ +-- Scalar multiplication should be periodic modulo the group size +(program 1.0.0 + [ + [ + (builtin bls12_381_G1_equal) + [ + [ + (builtin bls12_381_G1_scalarMul) + [ + [ (builtin addInteger) (con integer 123) ] + (con integer 52435875175126190479447740508185965837690552500527637822603658699938581184513) + ] + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + ] + [ + [ (builtin bls12_381_G1_scalarMul) (con integer 123) ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + ] +) + diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic2/mulperiodic2.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic2/mulperiodic2.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic2/mulperiodic2.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic3/mulperiodic3.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic3/mulperiodic3.uplc new file mode 100644 index 00000000000..8aeb4591ce8 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic3/mulperiodic3.uplc @@ -0,0 +1,27 @@ +-- Scalar multiplication should be periodic modulo the group size +(program + 1.0.0 + [ + [ + (builtin bls12_381_G1_equal) + [ + [ + (builtin bls12_381_G1_scalarMul) + [ + [ (builtin addInteger) (con integer 123) ] + [ + [ (builtin multiplyInteger) (con integer 987654321) ] + (con integer 52435875175126190479447740508185965837690552500527637822603658699938581184513) + ] + ] + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + ] + [ + [ (builtin bls12_381_G1_scalarMul) (con integer 123) ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + ] +) + diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic3/mulperiodic3.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic3/mulperiodic3.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic3/mulperiodic3.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic4/mulperiodic4.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic4/mulperiodic4.uplc new file mode 100644 index 00000000000..250e6fa3711 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic4/mulperiodic4.uplc @@ -0,0 +1,27 @@ +-- Scalar multiplication should be periodic modulo the group size +(program + 1.0.0 + [ + [ + (builtin bls12_381_G1_equal) + [ + [ + (builtin bls12_381_G1_scalarMul) + [ + [ (builtin addInteger) (con integer 123) ] + [ + [ (builtin multiplyInteger) (con integer -987654321) ] + (con integer 52435875175126190479447740508185965837690552500527637822603658699938581184513) + ] + ] + ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + ] + [ + [ (builtin bls12_381_G1_scalarMul) (con integer 123) ] + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + ] +) + diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic4/mulperiodic4.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic4/mulperiodic4.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_scalarMul/mulperiodic4/mulperiodic4.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-1/bad-zero-1.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-1/bad-zero-1.uplc new file mode 100644 index 00000000000..24e3ca33672 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-1/bad-zero-1.uplc @@ -0,0 +1,7 @@ +-- This has the infinity bit set but not the compression bit, and so is invalid. +(program 0.0.0 + [ + (builtin bls12_381_G1_uncompress) + (con bytestring #400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-1/bad-zero-1.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-1/bad-zero-1.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-1/bad-zero-1.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-2/bad-zero-2.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-2/bad-zero-2.uplc new file mode 100644 index 00000000000..122d86c4d18 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-2/bad-zero-2.uplc @@ -0,0 +1,8 @@ +-- This is the zero point of G1, but with the sign bit set. It should fail to uncompress. +(program 0.0.0 + [ + (builtin bls12_381_G1_uncompress) + (con bytestring #e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + ] +) + \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-2/bad-zero-2.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-2/bad-zero-2.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-2/bad-zero-2.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-3/bad-zero-3.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-3/bad-zero-3.uplc new file mode 100644 index 00000000000..5bfda3919cb --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-3/bad-zero-3.uplc @@ -0,0 +1,8 @@ +-- This is the zero point of G1, but with a random bit set in the body. It +-- should fail to uncompress. +(program 0.0.0 + [ + (builtin bls12_381_G1_uncompress) + (con bytestring #c00000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-3/bad-zero-3.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-3/bad-zero-3.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/bad-zero-3/bad-zero-3.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/off-curve/off-curve.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/off-curve/off-curve.uplc new file mode 100644 index 00000000000..f8ffadf26cb --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/off-curve/off-curve.uplc @@ -0,0 +1,7 @@ +-- This contains a value which is not the x-coordinate of a point on the E1 curve. +(program 0.0.0 + [ + (builtin bls12_381_G1_uncompress) + (con bytestring #a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/off-curve/off-curve.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/off-curve/off-curve.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/off-curve/off-curve.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc new file mode 100644 index 00000000000..5033b288f0c --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc @@ -0,0 +1,8 @@ +-- This value was obtained by hashing 0x0102030405 to G1 but has had the +-- compression bit cleared, so uncompression should fail. +(program 0.0.0 + [ + (builtin bls12_381_G1_uncompress) + (con bytestring #81e9a0c68985059bd25a5ef05b351ca22f7d7c19e37928583ae12a1f4939440ff754cfd85b23df4a54f66c7089db6deb) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected new file mode 100644 index 00000000000..d66818b0c7c --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected @@ -0,0 +1,7 @@ +(program + 0.0.0 + (con + bls12_381_G1_element + 0x81e9a0c68985059bd25a5ef05b351ca22f7d7c19e37928583ae12a1f4939440ff754cfd85b23df4a54f66c7089db6deb + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc new file mode 100644 index 00000000000..9872b0d8762 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc @@ -0,0 +1,8 @@ +-- This value was obtained by hashing 0x0102030405 to G1 and has the compression +-- bit set, so uncompression should succeed. +(program 0.0.0 + [ + (builtin bls12_381_G1_uncompress) + (con bytestring #a1e9a0c68985059bd25a5ef05b351ca22f7d7c19e37928583ae12a1f4939440ff754cfd85b23df4a54f66c7089db6deb) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc.expected new file mode 100644 index 00000000000..54e3096578f --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc.expected @@ -0,0 +1,9 @@ +-- This value was obtained by hashing 0x0102030405 to G2 and has the compression +-- bit set, so uncompression should succeed. +(program + 0.0.0 + (con + bls12_381_G1_element + 0xa1e9a0c68985059bd25a5ef05b351ca22f7d7c19e37928583ae12a1f4939440ff754cfd85b23df4a54f66c7089db6deb + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc new file mode 100644 index 00000000000..64ac24576f9 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc @@ -0,0 +1,10 @@ +-- This checks that the uncompression function fails on a valid *serialised* G1 +-- point (obtained by hashing 0x0102030405 onto G1). The deserialisation +-- function in the blst library can handle both serialised and compressed +-- points, but we should fail on the former. +(program 0.0.0 + [ (builtin bls12_381_G1_uncompress) + (con bytestring + #01e9a0c68985059bd25a5ef05b351ca22f7d7c19e37928583ae12a1f4939440ff754cfd85b23df4a54f66c7089db6deb12ae8470d881eb628dfcf4bb083fb8a6968d907a0c265f6d06e04b05a19418d395d3e0c115430f88e7156822904ef5bf) +] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/out-of-group/out-of-group.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/out-of-group/out-of-group.uplc new file mode 100644 index 00000000000..2c34b8e2948 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/out-of-group/out-of-group.uplc @@ -0,0 +1,8 @@ +-- This contains a value which is the x-coordinate of a point which lies on the +-- E1 curve but not the G1 subgroup. +(program 0.0.0 + [ + (builtin bls12_381_G1_uncompress) + (con bytestring #a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/out-of-group/out-of-group.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/out-of-group/out-of-group.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/out-of-group/out-of-group.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-long/too-long.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-long/too-long.uplc new file mode 100644 index 00000000000..0779c332cab --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-long/too-long.uplc @@ -0,0 +1,8 @@ +-- The bytestring is the compressed version of the G1 zero point, but extended +-- to 49 bytes. +(program 0.0.0 + [ + (builtin bls12_381_G1_uncompress) + (con bytestring #c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-long/too-long.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-long/too-long.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-long/too-long.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-short/too-short.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-short/too-short.uplc new file mode 100644 index 00000000000..98d9f22fc93 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-short/too-short.uplc @@ -0,0 +1,7 @@ +-- The bytestring is the compressed version of the G1 zero point, but truncated to 47 bytes. +(program 0.0.0 + [ + (builtin bls12_381_G1_uncompress) + (con bytestring #c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-short/too-short.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-short/too-short.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/too-short/too-short.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/zero/zero.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/zero/zero.uplc new file mode 100644 index 00000000000..127c894d18c --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/zero/zero.uplc @@ -0,0 +1,7 @@ +-- The zero element of G1 uncompresses correctly. +(program 0.0.0 + [ + (builtin bls12_381_G1_uncompress) + (con bytestring #c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/zero/zero.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/zero/zero.uplc.expected new file mode 100644 index 00000000000..63a548b8782 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G1_uncompress/zero/zero.uplc.expected @@ -0,0 +1,7 @@ +(program + 0.0.0 + (con + bls12_381_G1_element + 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-associative/add-associative.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-associative/add-associative.uplc new file mode 100644 index 00000000000..a0ee7305a68 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-associative/add-associative.uplc @@ -0,0 +1,37 @@ +-- p+(q+r) = (p+q)+r for three random points on G2. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_equal) + [ + [ + (builtin bls12_381_G2_add) + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + [ + [ + (builtin bls12_381_G2_add) + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a +) + ] + (con bls12_381_G2_element 0xa69d86e011cf692e51ac2031201c27aa06a8f902068fcb98f284d9d925c6502bb0821ba4f49ece3d1db06cd9556f690a117e51df792f7c1d1f5f22b91c3155e9ef2bc43f24ab0a62d8606b3262a117c5635326ae8c9ad897980db6bf4849f903 +) + ] + ] + ] + [ + (builtin bls12_381_G2_add) + [ + [ + (builtin bls12_381_G2_add) + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a +) + ] + (con bls12_381_G2_element 0xa69d86e011cf692e51ac2031201c27aa06a8f902068fcb98f284d9d925c6502bb0821ba4f49ece3d1db06cd9556f690a117e51df792f7c1d1f5f22b91c3155e9ef2bc43f24ab0a62d8606b3262a117c5635326ae8c9ad897980db6bf4849f903 +) + ] + ] +) + diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-associative/add-associative.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-associative/add-associative.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-associative/add-associative.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-commutative/add-commutative.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-commutative/add-commutative.uplc new file mode 100644 index 00000000000..441b8699f7d --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-commutative/add-commutative.uplc @@ -0,0 +1,24 @@ +-- p+q = q+p for two random points in G2. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_equal) + [ + [ + (builtin bls12_381_G2_add) + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1 +) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] + ] + [ + [ + (builtin bls12_381_G2_add) + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1 +) + ] + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-commutative/add-commutative.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-commutative/add-commutative.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-commutative/add-commutative.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-zero/add-zero.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-zero/add-zero.uplc new file mode 100644 index 00000000000..18adedbe813 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-zero/add-zero.uplc @@ -0,0 +1,10 @@ +-- Adding the zero element to a random point doesn't change it. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_add) + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + (con bls12_381_G2_element 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-zero/add-zero.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-zero/add-zero.uplc.expected new file mode 100644 index 00000000000..fa158051a37 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add-zero/add-zero.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add/add.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add/add.uplc new file mode 100644 index 00000000000..7eb51f91ad4 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add/add.uplc @@ -0,0 +1,10 @@ +-- Check that adding two random points on G2 gives the expected result. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_add) + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add/add.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add/add.uplc.expected new file mode 100644 index 00000000000..5cecee55c71 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_add/add/add.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0xb5cf6c76309d98a38950948ce6768309e2e92561762734caaaab65077e1279faff6bba6f9f21bbb3b3fa4ee55aa1332d0f4b3b9a6fa4848e0bf7ae0d38fdc1f1c1908b953ee2b47b88a595b10431acab16522d12a785e27692fc7e0ffa33be07 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_compress/compress/compress.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_compress/compress/compress.uplc new file mode 100644 index 00000000000..86a22550d0f --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_compress/compress/compress.uplc @@ -0,0 +1,7 @@ +-- Check that compression of a random point in G2 succeeds and gives the expected result. +(program 1.0.0 + [ + (builtin bls12_381_G2_compress) + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_compress/compress/compress.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_compress/compress/compress.uplc.expected new file mode 100644 index 00000000000..0230ddaef20 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_compress/compress/compress.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bytestring + #b0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-false/equal-false.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-false/equal-false.uplc new file mode 100644 index 00000000000..6c90ac74ea0 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-false/equal-false.uplc @@ -0,0 +1,10 @@ +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_equal) + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] +) + diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-false/equal-false.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-false/equal-false.uplc.expected new file mode 100644 index 00000000000..3ee9f07f31d --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-false/equal-false.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool False)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-true/equal-true.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-true/equal-true.uplc new file mode 100644 index 00000000000..c4007b4dbb7 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-true/equal-true.uplc @@ -0,0 +1,10 @@ +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_equal) + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] +) + diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-true/equal-true.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-true/equal-true.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_equal/equal-true/equal-true.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc new file mode 100644 index 00000000000..417ac4fa476 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc @@ -0,0 +1,23 @@ +-- Check that hashing different messages with the same DST gives different +-- results: this should return False. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_equal) + [ + [ + (builtin bls12_381_G2_hashToGroup) + (con bytestring #8e) + ] + (con bytestring #0a) + ] + ] + [ + [ + (builtin bls12_381_G2_hashToGroup) + (con bytestring #81) + ] + (con bytestring #0a) + ] + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc.expected new file mode 100644 index 00000000000..3ee9f07f31d --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-different-msg-same-dst/hash-different-msg-same-dst.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool False)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc new file mode 100644 index 00000000000..b9ba3819514 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc @@ -0,0 +1,10 @@ +-- Maximum length of DST is 255 bytes: this should be OK +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_hashToGroup) + (con bytestring #3f) + ] + (con bytestring #123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc.expected new file mode 100644 index 00000000000..adc5ec3b0fb --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-255/hash-dst-len-255.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0x9028b507444b4283faf2f85e7f7d3890b67e9bcf84c7de2f75fe603996ab1b12a25b4637d68f310b7bd6d47ec11e3fa60d0f8f9d1dc880746105b4d7e9b5bba86abfdef96dfda303b1fb00b5d866b5d7f67883efb39efca301ae44a7f1322a33 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc new file mode 100644 index 00000000000..c0178489cec --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc @@ -0,0 +1,10 @@ +-- Maximum length of DST is 255 bytes: this should fail +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_hashToGroup) + (con bytestring #3f) + ] + (con bytestring #123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890ff) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-dst-len-256/hash-dst-len-256.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-empty-dst/hash-empty-dst.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-empty-dst/hash-empty-dst.uplc new file mode 100644 index 00000000000..ab6c5797880 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-empty-dst/hash-empty-dst.uplc @@ -0,0 +1,10 @@ +-- Check that hashing a random bytestring with an empty DST gives the expected result. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_hashToGroup) + (con bytestring #8e) + ] + (con bytestring #) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-empty-dst/hash-empty-dst.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-empty-dst/hash-empty-dst.uplc.expected new file mode 100644 index 00000000000..8201dfc70cd --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-empty-dst/hash-empty-dst.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0x8785334bbccf9f7a1bc656fcbcaf9901521cc09a076ff69d40e467082b605d668219747dfec37c798c97b2c7f28ec90117c4ccfc54ef3cc3c0038951c4969a3c0b3fb842a78103586657428ab38d719c9d3314de566cd95540aaccf7afd48821 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc new file mode 100644 index 00000000000..08b234b68c4 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc @@ -0,0 +1,23 @@ +-- Check that hashing the same message with different DSTs gives different +-- results: this should return False. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_equal) + [ + [ + (builtin bls12_381_G2_hashToGroup) + (con bytestring #8e) + ] + (con bytestring #0a) + ] + ] + [ + [ + (builtin bls12_381_G2_hashToGroup) + (con bytestring #8e) + ] + (con bytestring #01) + ] + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc.expected new file mode 100644 index 00000000000..3ee9f07f31d --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash-same-msg-different-dst/hash-same-msg-different-dst.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool False)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash/hash.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash/hash.uplc new file mode 100644 index 00000000000..ec831773b79 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash/hash.uplc @@ -0,0 +1,10 @@ +-- Check that hashing a random bytestring gives the expected result. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_hashToGroup) + (con bytestring #8e) + ] + (con bytestring #0a) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash/hash.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash/hash.uplc.expected new file mode 100644 index 00000000000..6c0812e6f4a --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_hashToGroup/hash/hash.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0xabdb064dbaa986d9609796d7a80ef07f719f99fa5d9876e01f9298793d4c7e7ba9b2c55da6896f90693ad76a093d280118a4c24df9a387eaf85b15927365a110fe5256f53ddf8bef4069fe761d8215d4a73ec980f1a801dbaba25146b6ca7e07 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/add-neg/add-neg.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/add-neg/add-neg.uplc new file mode 100644 index 00000000000..470c530ad17 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/add-neg/add-neg.uplc @@ -0,0 +1,13 @@ +-- Check that adding a random point to its negative gives the zero element. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_add) + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + [ + (builtin bls12_381_G2_neg) + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/add-neg/add-neg.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/add-neg/add-neg.uplc.expected new file mode 100644 index 00000000000..145261a1d6f --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/add-neg/add-neg.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg-zero/neg-zero.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg-zero/neg-zero.uplc new file mode 100644 index 00000000000..56cc680357e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg-zero/neg-zero.uplc @@ -0,0 +1,7 @@ +-- The negative of the zero point is the zero point. +(program 1.0.0 + [ + (builtin bls12_381_G2_neg) + (con bls12_381_G2_element 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg-zero/neg-zero.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg-zero/neg-zero.uplc.expected new file mode 100644 index 00000000000..145261a1d6f --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg-zero/neg-zero.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg/neg.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg/neg.uplc new file mode 100644 index 00000000000..1894886a3c7 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg/neg.uplc @@ -0,0 +1,7 @@ +-- Check that hashing a random bytestring gives the expected result. +(program 1.0.0 + [ + (builtin bls12_381_G2_neg) + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg/neg.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg/neg.uplc.expected new file mode 100644 index 00000000000..cb37047e5d2 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_neg/neg/neg.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0xa310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/addmul/addmul.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/addmul/addmul.uplc new file mode 100644 index 00000000000..0b8eb2276c2 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/addmul/addmul.uplc @@ -0,0 +1,22 @@ +-- 2157p + 2157q for random points p and q in G2. This should give the same result as muladd. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_add) + [ + [ + (builtin bls12_381_G2_scalarMul) + (con integer 2157) + ] + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + ] + [ + [ + (builtin bls12_381_G2_scalarMul) + (con integer 2157) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/addmul/addmul.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/addmul/addmul.uplc.expected new file mode 100644 index 00000000000..284acd1ff01 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/addmul/addmul.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0xb8a335cdbb3de744ba2b6bb3c9ad9c209a7f33a1453c2ed0460e188c1f31f185e359a62727fe1d8ba5c931d75ef644e50173e5255b62194677fb67323ce42bac5c6b1b077e682df3aabca1caee2f640db1fed0b4ad511562f7c54d84ea76debc + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul0/mul0.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul0/mul0.uplc new file mode 100644 index 00000000000..f8cad427305 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul0/mul0.uplc @@ -0,0 +1,10 @@ +-- Multiplication by the zero scalar gives the zero point of G2. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_scalarMul) + (con integer 0) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul0/mul0.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul0/mul0.uplc.expected new file mode 100644 index 00000000000..145261a1d6f --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul0/mul0.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul1/mul1.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul1/mul1.uplc new file mode 100644 index 00000000000..f63ae4a7683 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul1/mul1.uplc @@ -0,0 +1,10 @@ +-- Scalar multiplication by 1 leaves a random point unchanged. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_scalarMul) + (con integer 1) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul1/mul1.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul1/mul1.uplc.expected new file mode 100644 index 00000000000..a89b74d0c16 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul1/mul1.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul19+25/mul19+25.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul19+25/mul19+25.uplc new file mode 100644 index 00000000000..545d5e60457 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul19+25/mul19+25.uplc @@ -0,0 +1,22 @@ +-- 19p+25p for a random point p in G2. This should give the same result as mul44. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_add) + [ + [ + (builtin bls12_381_G2_scalarMul) + (con integer 19) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] + ] + [ + [ + (builtin bls12_381_G2_scalarMul) + (con integer 25) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul19+25/mul19+25.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul19+25/mul19+25.uplc.expected new file mode 100644 index 00000000000..3597841c912 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul19+25/mul19+25.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0xaa2a95bc9936c61f5039cc6fbbe0e25fa8b1528ea18c5be09c93ed941d1c9052597086b8d3b3b5fbbd110ce389378c5414efd310de2120a7efbaaf70d01f5b80835118c1f39a4273a10f1f2a4af0ed33a7c17fba4c8e3f7cb08a1d97e82d5611 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul44/mul44.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul44/mul44.uplc new file mode 100644 index 00000000000..7c7a68d776b --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul44/mul44.uplc @@ -0,0 +1,10 @@ +-- Check that multiplication by the scalar 44 gives the expected result. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_scalarMul) + (con integer 44) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul44/mul44.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul44/mul44.uplc.expected new file mode 100644 index 00000000000..3597841c912 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul44/mul44.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0xaa2a95bc9936c61f5039cc6fbbe0e25fa8b1528ea18c5be09c93ed941d1c9052597086b8d3b3b5fbbd110ce389378c5414efd310de2120a7efbaaf70d01f5b80835118c1f39a4273a10f1f2a4af0ed33a7c17fba4c8e3f7cb08a1d97e82d5611 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul4x11/mul4x11.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul4x11/mul4x11.uplc new file mode 100644 index 00000000000..a85dfe79476 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul4x11/mul4x11.uplc @@ -0,0 +1,16 @@ +-- 4*(11*p) for a point in G2. This should give the same result as mul44. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_scalarMul) + (con integer 4) + ] + [ + [ + (builtin bls12_381_G2_scalarMul) + (con integer 11) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul4x11/mul4x11.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul4x11/mul4x11.uplc.expected new file mode 100644 index 00000000000..3597841c912 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mul4x11/mul4x11.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0xaa2a95bc9936c61f5039cc6fbbe0e25fa8b1528ea18c5be09c93ed941d1c9052597086b8d3b3b5fbbd110ce389378c5414efd310de2120a7efbaaf70d01f5b80835118c1f39a4273a10f1f2a4af0ed33a7c17fba4c8e3f7cb08a1d97e82d5611 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/muladd/muladd.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/muladd/muladd.uplc new file mode 100644 index 00000000000..5d37d126edd --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/muladd/muladd.uplc @@ -0,0 +1,16 @@ +-- n(p+q) = np + nq (n scalar, p and q random points in G2). +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_scalarMul) + (con integer 2157) + ] + [ + [ + (builtin bls12_381_G2_add) + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/muladd/muladd.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/muladd/muladd.uplc.expected new file mode 100644 index 00000000000..284acd1ff01 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/muladd/muladd.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0xb8a335cdbb3de744ba2b6bb3c9ad9c209a7f33a1453c2ed0460e188c1f31f185e359a62727fe1d8ba5c931d75ef644e50173e5255b62194677fb67323ce42bac5c6b1b077e682df3aabca1caee2f640db1fed0b4ad511562f7c54d84ea76debc + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg1/mulneg1.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg1/mulneg1.uplc new file mode 100644 index 00000000000..41555d76198 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg1/mulneg1.uplc @@ -0,0 +1,10 @@ +-- Check that the result of multiplying by -1 is as expected. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_scalarMul) + (con integer -1) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg1/mulneg1.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg1/mulneg1.uplc.expected new file mode 100644 index 00000000000..cb37047e5d2 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg1/mulneg1.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0xa310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg44/mulneg44.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg44/mulneg44.uplc new file mode 100644 index 00000000000..dc2f11a75e7 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg44/mulneg44.uplc @@ -0,0 +1,10 @@ +-- Multiplying a random point in G2 by the scalar -44 gives the expected result. +(program 1.0.0 + [ + [ + (builtin bls12_381_G2_scalarMul) + (con integer -44) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg44/mulneg44.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg44/mulneg44.uplc.expected new file mode 100644 index 00000000000..22aaa867c53 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulneg44/mulneg44.uplc.expected @@ -0,0 +1,7 @@ +(program + 1.0.0 + (con + bls12_381_G2_element + 0x8a2a95bc9936c61f5039cc6fbbe0e25fa8b1528ea18c5be09c93ed941d1c9052597086b8d3b3b5fbbd110ce389378c5414efd310de2120a7efbaaf70d01f5b80835118c1f39a4273a10f1f2a4af0ed33a7c17fba4c8e3f7cb08a1d97e82d5611 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic1/mulperiodic1.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic1/mulperiodic1.uplc new file mode 100644 index 00000000000..b9c3fc157d1 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic1/mulperiodic1.uplc @@ -0,0 +1,14 @@ +-- Scalar multiplication by the group size should give you the zero element of the group. +(program 1.0.0 +[ + [ (builtin bls12_381_G2_equal) + [ + (builtin bls12_381_G2_scalarMul) + (con integer 52435875175126190479447740508185965837690552500527637822603658699938581184513 ) + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + ] + (con bls12_381_G2_element + 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) +] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic1/mulperiodic1.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic1/mulperiodic1.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic1/mulperiodic1.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic2/mulperiodic2.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic2/mulperiodic2.uplc new file mode 100644 index 00000000000..134e98d0951 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic2/mulperiodic2.uplc @@ -0,0 +1,26 @@ +-- Scalar multiplication should be periodic modulo the group size +(program + 1.0.0 + [ + [ + (builtin bls12_381_G2_equal) + [ + [ + (builtin bls12_381_G2_scalarMul) + [ + [ (builtin addInteger) (con integer 123) ] + (con integer 52435875175126190479447740508185965837690552500527637822603658699938581184513) + ] + ] + (con bls12_381_G2_element + 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + ] + [ + [ (builtin bls12_381_G2_scalarMul) (con integer 123) ] + (con bls12_381_G2_element + 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + ] +) + diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic2/mulperiodic2.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic2/mulperiodic2.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic2/mulperiodic2.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic3/mulperiodic3.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic3/mulperiodic3.uplc new file mode 100644 index 00000000000..0218e35941e --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic3/mulperiodic3.uplc @@ -0,0 +1,29 @@ +-- Scalar multiplication should be periodic modulo the group size +(program + 1.0.0 + [ + [ + (builtin bls12_381_G2_equal) + [ + [ + (builtin bls12_381_G2_scalarMul) + [ + [ (builtin addInteger) (con integer 123) ] + [ + [ (builtin multiplyInteger) (con integer 987654321) ] + (con integer 52435875175126190479447740508185965837690552500527637822603658699938581184513) + ] + ] + ] + (con bls12_381_G2_element + 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + ] + [ + [ (builtin bls12_381_G2_scalarMul) (con integer 123) ] + (con bls12_381_G2_element + 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + ] +) + diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic3/mulperiodic3.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic3/mulperiodic3.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic3/mulperiodic3.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic4/mulperiodic4.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic4/mulperiodic4.uplc new file mode 100644 index 00000000000..5bb2845d8d9 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic4/mulperiodic4.uplc @@ -0,0 +1,29 @@ +-- Scalar multiplication should be periodic modulo the group size +(program + 1.0.0 + [ + [ + (builtin bls12_381_G2_equal) + [ + [ + (builtin bls12_381_G2_scalarMul) + [ + [ (builtin addInteger) (con integer 123) ] + [ + [ (builtin multiplyInteger) (con integer -987654321) ] + (con integer 52435875175126190479447740508185965837690552500527637822603658699938581184513) + ] + ] + ] + (con bls12_381_G2_element + 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + ] + [ + [ (builtin bls12_381_G2_scalarMul) (con integer 123) ] + (con bls12_381_G2_element + 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + ] +) + diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic4/mulperiodic4.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic4/mulperiodic4.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_scalarMul/mulperiodic4/mulperiodic4.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-1/bad-zero-1.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-1/bad-zero-1.uplc new file mode 100644 index 00000000000..3b53f7cc25d --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-1/bad-zero-1.uplc @@ -0,0 +1,7 @@ +-- This has the infinity bit set but not the compression bit, and so is invalid. +(program 0.0.0 + [ + (builtin bls12_381_G2_uncompress) + (con bytestring #400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-1/bad-zero-1.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-1/bad-zero-1.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-1/bad-zero-1.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-2/bad-zero-2.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-2/bad-zero-2.uplc new file mode 100644 index 00000000000..d00ae03254c --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-2/bad-zero-2.uplc @@ -0,0 +1,7 @@ +-- This is the zero point of G2, but with the sign bit set. It should fail to uncompress. +(program 0.0.0 + [ + (builtin bls12_381_G2_uncompress) + (con bytestring #e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-2/bad-zero-2.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-2/bad-zero-2.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-2/bad-zero-2.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-3/bad-zero-3.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-3/bad-zero-3.uplc new file mode 100644 index 00000000000..42285e53fd9 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-3/bad-zero-3.uplc @@ -0,0 +1,8 @@ +-- This is the zero point of G2, but with the sign bit set. It should fail to +-- uncompress. +(program 0.0.0 + [ + (builtin bls12_381_G2_uncompress) + (con bytestring #c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-3/bad-zero-3.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-3/bad-zero-3.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/bad-zero-3/bad-zero-3.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/off-curve/off-curve.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/off-curve/off-curve.uplc new file mode 100644 index 00000000000..f0105428ad8 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/off-curve/off-curve.uplc @@ -0,0 +1,7 @@ +-- This contains a value which is not the x-coordinate of a point on the E2 curve. +(program 0.0.0 + [ + (builtin bls12_381_G2_uncompress) + (con bytestring #a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/off-curve/off-curve.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/off-curve/off-curve.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/off-curve/off-curve.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc new file mode 100644 index 00000000000..073cd7c7b71 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc @@ -0,0 +1,8 @@ +-- This value was obtained by hashing 0x0102030405 to G2 but has had the +-- compression bit cleared, so uncompression should fail. +(program 0.0.0 + [ + (builtin bls12_381_G2_uncompress) + (con bytestring #88138ebea766d4d1aa64dd3b5826244c32ea3fe9351f9c8d584203716dae151d14bb5d06e245c24877955c79287682ba082d077bbb2afdb1ad1d48d18e2f0c56b001bce207801adfa9fd451fc59d56f0433b02f921ba5a272c58c06536291d07) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected new file mode 100644 index 00000000000..ca926b8fba1 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-clear/on-curve-bit3-clear.uplc.expected @@ -0,0 +1,7 @@ +(program + 0.0.0 + (con + bls12_381_G2_element + 0x88138ebea766d4d1aa64dd3b5826244c32ea3fe9351f9c8d584203716dae151d14bb5d06e245c24877955c79287682ba082d077bbb2afdb1ad1d48d18e2f0c56b001bce207801adfa9fd451fc59d56f0433b02f921ba5a272c58c06536291d07 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc new file mode 100644 index 00000000000..fc7c9f47393 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc @@ -0,0 +1,8 @@ +-- This value was obtained by hashing 0x0102030405 to G2 but has had the +-- compression bit cleared, so uncompression should fail. +(program 0.0.0 + [ + (builtin bls12_381_G2_uncompress) + (con bytestring #a8138ebea766d4d1aa64dd3b5826244c32ea3fe9351f9c8d584203716dae151d14bb5d06e245c24877955c79287682ba082d077bbb2afdb1ad1d48d18e2f0c56b001bce207801adfa9fd451fc59d56f0433b02f921ba5a272c58c06536291d07) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc.expected new file mode 100644 index 00000000000..99a8697468a --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-bit3-set/on-curve-bit3-set.uplc.expected @@ -0,0 +1,7 @@ +(program + 0.0.0 + (con + bls12_381_G2_element + 0xa8138ebea766d4d1aa64dd3b5826244c32ea3fe9351f9c8d584203716dae151d14bb5d06e245c24877955c79287682ba082d077bbb2afdb1ad1d48d18e2f0c56b001bce207801adfa9fd451fc59d56f0433b02f921ba5a272c58c06536291d07 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc new file mode 100644 index 00000000000..e7590e055f2 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc @@ -0,0 +1,10 @@ +-- This checks that the uncompression function fails on a valid *serialised* G2 +-- point (obtained by hashing 0x0102030405 onto G2). The deserialisation +-- function in the blst library can handle both serialised and compressed +-- points, but we should fail on the former. +(program 0.0.0 + [ + (builtin bls12_381_G2_uncompress) + (con bytestring #08138ebea766d4d1aa64dd3b5826244c32ea3fe9351f9c8d584203716dae151d14bb5d06e245c24877955c79287682ba082d077bbb2afdb1ad1d48d18e2f0c56b001bce207801adfa9fd451fc59d56f0433b02f921ba5a272c58c06536291d071676b275e27060b26dd91aac0a1feb56d1c1de7c323f486e48d54eae0c3c8f4caa45faad589c5d180ac0830dcdb3ecd8126c9c5db86cdf7129cf18582013d267a7c2827a901ef61ab58e7ef150219441abc57671eb39009f6bb166bcbade700d) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/on-curve-serialised-not-compressed/on-curve-serialised-not-compressed.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/out-of-group/out-of-group.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/out-of-group/out-of-group.uplc new file mode 100644 index 00000000000..38d5d6da64a --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/out-of-group/out-of-group.uplc @@ -0,0 +1,8 @@ +-- This contains a value which is the x-coordinate of a point which lies on the +-- E2 curve but not the G2 subgroup. +(program 0.0.0 + [ + (builtin bls12_381_G2_uncompress) + (con bytestring #a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/out-of-group/out-of-group.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/out-of-group/out-of-group.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/out-of-group/out-of-group.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-long/too-long.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-long/too-long.uplc new file mode 100644 index 00000000000..57fabd0a1fd --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-long/too-long.uplc @@ -0,0 +1,7 @@ +-- The bytestring is the compressed version of the G2 zero point, but extended to 97 bytes. +(program 0.0.0 + [ + (builtin bls12_381_G2_uncompress) + (con bytestring #c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-long/too-long.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-long/too-long.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-long/too-long.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-short/too-short.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-short/too-short.uplc new file mode 100644 index 00000000000..46a98e3f82a --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-short/too-short.uplc @@ -0,0 +1,7 @@ +-- The bytestring is the compressed version of the G2 zero point, but truncated to 94 bytes. +(program 0.0.0 + [ + (builtin bls12_381_G2_uncompress) + (con bytestring #c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + ] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-short/too-short.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-short/too-short.uplc.expected new file mode 100644 index 00000000000..ccc477ffed6 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/too-short/too-short.uplc.expected @@ -0,0 +1 @@ +evaluation failure \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/zero/zero.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/zero/zero.uplc new file mode 100644 index 00000000000..ba2fd0af99c --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/zero/zero.uplc @@ -0,0 +1,7 @@ +-- The zero element of G2 uncompresses correctly. +(program 0.0.0 + [ + (builtin bls12_381_G2_uncompress) + (con bytestring #c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/zero/zero.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/zero/zero.uplc.expected new file mode 100644 index 00000000000..9b995f812ab --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_G2_uncompress/zero/zero.uplc.expected @@ -0,0 +1,7 @@ +(program + 0.0.0 + (con + bls12_381_G2_element + 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + ) +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/balanced/balanced.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/balanced/balanced.uplc new file mode 100644 index 00000000000..915ed0fe1ff --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/balanced/balanced.uplc @@ -0,0 +1,33 @@ +-- = +(program + 1.0.0 + [ + [ + (builtin bls12_381_finalVerify) + [ + [ + (builtin bls12_381_millerLoop) + [ + [ (builtin bls12_381_G1_scalarMul) (con integer 251123) ] + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5 + ) + ] + ] + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + ] + [ + [ + (builtin bls12_381_millerLoop) + (con + bls12_381_G1_element + 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5 + ) + ] + [ + [ (builtin bls12_381_G2_scalarMul) (con integer 251123) ] + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + ] + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/balanced/balanced.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/balanced/balanced.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/balanced/balanced.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/equal-pairing/equal-pairing.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/equal-pairing/equal-pairing.uplc new file mode 100644 index 00000000000..59e8c5ced4f --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/equal-pairing/equal-pairing.uplc @@ -0,0 +1,22 @@ +-- Check that applying finalVerify to the same two points in GT returns True. +(program 1.0.0 + [ + [ + (builtin bls12_381_finalVerify) + [ + [ + (builtin bls12_381_millerLoop) + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + ] + [ + [ + (builtin bls12_381_millerLoop) + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] +] +) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/equal-pairing/equal-pairing.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/equal-pairing/equal-pairing.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/equal-pairing/equal-pairing.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/left-additive/left-additive.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/left-additive/left-additive.uplc new file mode 100644 index 00000000000..33e64ab8261 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/left-additive/left-additive.uplc @@ -0,0 +1,52 @@ +-- = +(program + 1.0.0 + [ + [ + (builtin bls12_381_finalVerify) + [ + [ + (builtin bls12_381_millerLoop) + [ + [ + (builtin bls12_381_G1_add) + (con + bls12_381_G1_element + 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5 + ) + ] + (con + bls12_381_G1_element + 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f + ) + ] + ] + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1 + ) + ] + ] + [ + [ + (builtin bls12_381_mulMlResult) + [ + [ + (builtin bls12_381_millerLoop) + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5 + ) + ] + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1 + ) + ] + ] + [ + [ + (builtin bls12_381_millerLoop) + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f + ) + ] + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1 + ) + ] + ] + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/left-additive/left-additive.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/left-additive/left-additive.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/left-additive/left-additive.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/random-pairing/random-pairing.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/random-pairing/random-pairing.uplc new file mode 100644 index 00000000000..45e479c3470 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/random-pairing/random-pairing.uplc @@ -0,0 +1,22 @@ +-- Check that the results of two millerLoops of random points are different. +(program 1.0.0 + [ + [ + (builtin bls12_381_finalVerify) + [ + [ + (builtin bls12_381_millerLoop) + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + ] + [ + [ + (builtin bls12_381_millerLoop) + (con bls12_381_G1_element 0xabd61864f519748032551e42e0ac417fd828f079454e3e3c9891c5c29ed7f10bdecc046854e3931cb7002779bd76d71f) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/random-pairing/random-pairing.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/random-pairing/random-pairing.uplc.expected new file mode 100644 index 00000000000..3ee9f07f31d --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/random-pairing/random-pairing.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool False)) \ No newline at end of file diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/right-additive/right-additive.uplc b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/right-additive/right-additive.uplc new file mode 100644 index 00000000000..d5e13650b04 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/right-additive/right-additive.uplc @@ -0,0 +1,41 @@ +-- = +(program + 1.0.0 + [ + [ + (builtin bls12_381_finalVerify) + [ + [ + (builtin bls12_381_millerLoop) + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] + [ + [ + (builtin bls12_381_G2_add) + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] + ] + ] + [ + [ + (builtin bls12_381_mulMlResult) + [ + [ + (builtin bls12_381_millerLoop) + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] + (con bls12_381_G2_element 0xb0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1) + ] + ] + [ + [ + (builtin bls12_381_millerLoop) + (con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5) + ] + (con bls12_381_G2_element 0x8310bc97fc7ad9b1616e51226c6a521b9d7fdf03f7299833e6a208ae0399fec76045a43ceef846e0958d0cdf05cf2b1f00460ee6edd2778b413eb7c272bc5b94d12b910f8ac4eb1b55e50a93644714787417bc462349c5e0f6f357b9ac32262a) + ] + ] + ] +) diff --git a/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/right-additive/right-additive.uplc.expected b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/right-additive/right-additive.uplc.expected new file mode 100644 index 00000000000..3760fc7a698 --- /dev/null +++ b/plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/bls12_381_millerLoop/right-additive/right-additive.uplc.expected @@ -0,0 +1 @@ +(program 1.0.0 (con bool True)) \ No newline at end of file diff --git a/plutus-core/changelog.d/20230323_203720_kwxm_prototype.md b/plutus-core/changelog.d/20230323_203720_kwxm_prototype.md new file mode 100644 index 00000000000..aef3b23489a --- /dev/null +++ b/plutus-core/changelog.d/20230323_203720_kwxm_prototype.md @@ -0,0 +1,49 @@ + + + +### Added + +- Three new types for BLS12-381 objects (see CIP-0381). +- Seventeen new built-in functions for BLS12-381 operations (see CIP-0381). +- Costing benchmarks for the BLS12-381 builtins. +- R code to infer cost models for the BLS12-381 builtins. +- Property tests for the BLS12-381 builtins. +- Code for Haskell bindings to the`blst` library has been added in `cbits` and + `plutus-core/src/Crypto/External/`. These have been copied from PR #266 + in `cardano-base` and will be removed when that is merged. + +### Changed + +- Costing functions for the BLS12-381 builtins were added to `builtinCostModel.json`. +- Costing benchmark results for the BLS12-381 builtins were added to `benching.csv`. +- Some of the R code in `models.R` was improved. +- The files in `plutus-core/src/crypto` were reorganised to put code relating to + different sets of crypto functions into separate files. + + + + diff --git a/plutus-core/cost-model/budgeting-bench/Benchmarks/Crypto.hs b/plutus-core/cost-model/budgeting-bench/Benchmarks/Crypto.hs index c25e933ed76..fd6c69af1e9 100644 --- a/plutus-core/cost-model/budgeting-bench/Benchmarks/Crypto.hs +++ b/plutus-core/cost-model/budgeting-bench/Benchmarks/Crypto.hs @@ -1,23 +1,29 @@ +-- editorconfig-checker-disable-file {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} --- | Budgeting benchmarks for cryptographic functions, including hashing. module Benchmarks.Crypto (makeBenchmarks) where import Common import Generators import PlutusCore -import Cardano.Crypto.DSIGN.Class +import Cardano.Crypto.DSIGN.Class (ContextDSIGN, DSIGNAlgorithm, Signable, deriveVerKeyDSIGN, + genKeyDSIGN, rawSerialiseSigDSIGN, rawSerialiseVerKeyDSIGN, + signDSIGN) import Cardano.Crypto.DSIGN.EcdsaSecp256k1 (EcdsaSecp256k1DSIGN, toMessageHash) import Cardano.Crypto.DSIGN.Ed25519 (Ed25519DSIGN) import Cardano.Crypto.DSIGN.SchnorrSecp256k1 (SchnorrSecp256k1DSIGN) import Cardano.Crypto.Seed (mkSeedFromBytes) +import PlutusCore.Crypto.BLS12_381.G1 qualified as G1 +import PlutusCore.Crypto.BLS12_381.G2 qualified as G2 +import PlutusCore.Crypto.BLS12_381.Pairing qualified as Pairing + import Criterion.Main (Benchmark, bgroup) -import Data.ByteString (ByteString) +import Data.ByteString (ByteString, empty) import Hedgehog qualified as H (Seed) import System.Random (StdGen) @@ -34,7 +40,6 @@ bigByteStrings :: H.Seed -> [ByteString] bigByteStrings seed = makeSizedByteStrings seed (fmap (10*) byteStringSizes) -- Up to 784,000 bytes. - ---------------- Signature verification ---------------- data MessageSize = Arbitrary | Fixed Int @@ -63,12 +68,12 @@ data MessageSize = Arbitrary | Fixed Int length. This means that we have to add a ByteString -> message conversion function as a parameter here. -} -mkBmInputs :: forall v msg . +mkDsignBmInputs :: forall v msg . (Signable v msg, DSIGNAlgorithm v, ContextDSIGN v ~ ()) => (ByteString -> msg) -> MessageSize -> [(ByteString, ByteString, ByteString)] -mkBmInputs toMsg msgSize = +mkDsignBmInputs toMsg msgSize = map mkOneInput (zip seeds messages) where seeds = listOfSizedByteStrings numSamples 128 -- ^ Seeds for key generation. For some algorithms the seed has to be @@ -79,23 +84,21 @@ mkBmInputs toMsg msgSize = Arbitrary -> bigByteStrings seedA Fixed n -> listOfSizedByteStrings numSamples n mkOneInput (seed, msg) = - -- Signing key (private) - let signKey = genKeyDSIGN @v $ mkSeedFromBytes seed - -- Verification key (public) - vkBytes = rawSerialiseVerKeyDSIGN $ deriveVerKeyDSIGN signKey + let signKey = genKeyDSIGN @v $ mkSeedFromBytes seed -- Signing key (private) + vkBytes = rawSerialiseVerKeyDSIGN $ deriveVerKeyDSIGN signKey -- Verification key (public) sigBytes = rawSerialiseSigDSIGN $ signDSIGN () (toMsg msg) signKey in (vkBytes, msg, sigBytes) benchVerifyEd25519Signature :: Benchmark benchVerifyEd25519Signature = let name = VerifyEd25519Signature - inputs = mkBmInputs @Ed25519DSIGN id Arbitrary + inputs = mkDsignBmInputs @Ed25519DSIGN id Arbitrary in createThreeTermBuiltinBenchElementwise name [] inputs benchVerifyEcdsaSecp256k1Signature :: Benchmark benchVerifyEcdsaSecp256k1Signature = let name = VerifyEcdsaSecp256k1Signature - inputs = mkBmInputs @EcdsaSecp256k1DSIGN toMsg (Fixed 32) + inputs = mkDsignBmInputs @EcdsaSecp256k1DSIGN toMsg (Fixed 32) in createThreeTermBuiltinBenchElementwise name [] inputs where toMsg b = case toMessageHash b of @@ -107,7 +110,7 @@ benchVerifyEcdsaSecp256k1Signature = benchVerifySchnorrSecp256k1Signature :: Benchmark benchVerifySchnorrSecp256k1Signature = let name = VerifySchnorrSecp256k1Signature - inputs = mkBmInputs @SchnorrSecp256k1DSIGN id Arbitrary + inputs = mkDsignBmInputs @SchnorrSecp256k1DSIGN id Arbitrary in createThreeTermBuiltinBenchElementwise name [] inputs @@ -119,15 +122,200 @@ benchByteStringOneArgOp name = where mkBM b = benchDefault (showMemoryUsage b) $ mkApp1 name [] b +---------------- BLS12_381 buitlins ---------------- + + +byteStrings :: [ByteString] +byteStrings = listOfSizedByteStrings 200 20 + +byteStringsA :: [ByteString] +byteStringsA = take 100 byteStrings + +byteStringsB :: [ByteString] +byteStringsB = take 100 (drop 100 byteStrings) + + +-- Random elements in G1 + +-- Create random group elements by hashing a random bytestring (with an empty +-- DST). This will always give us a valid group element, unlike uncompressing +-- random bytestrings, which will almost always fail. +randomG1Element :: ByteString -> G1.Element +randomG1Element s = + case G1.hashToGroup s Data.ByteString.empty of + Left err -> error $ "Error in randomG1Element: " ++ show err + Right p -> p + +g1inputsA :: [G1.Element] +g1inputsA = fmap randomG1Element byteStringsA + +g1inputsB :: [G1.Element] +g1inputsB = fmap randomG1Element byteStringsB + +-- Random elements in G2 +randomG2Element :: ByteString -> G2.Element +randomG2Element s = + case G2.hashToGroup s Data.ByteString.empty of + Left err -> error $ "Error in randomG2Element: " ++ show err + Right p -> p + +g2inputsA :: [G2.Element] +g2inputsA = fmap randomG2Element byteStringsA + +g2inputsB :: [G2.Element] +g2inputsB = fmap randomG2Element byteStringsB + +-- Random values of type MlResult. The only way we can manufacture values of +-- this type is by using millerLoop, which should always succeed on the inputs +-- we give it here. +gtinputsA :: [Pairing.MlResult] +gtinputsA = zipWith Pairing.millerLoop g1inputsA g2inputsA + +gtinputsB :: [Pairing.MlResult] +gtinputsB = zipWith Pairing.millerLoop g1inputsB g2inputsB + +benchBls12_381_G1_add :: Benchmark +benchBls12_381_G1_add = + let name = Bls12_381_G1_add + in createTwoTermBuiltinBenchElementwise name [] g1inputsA g1inputsB +-- constant time +-- Two arguments, points on G1 + +benchBls12_381_G1_neg :: Benchmark +benchBls12_381_G1_neg = + let name = Bls12_381_G1_neg + in createOneTermBuiltinBench name [] g1inputsA +-- constant time + +benchBls12_381_G1_scalarMul :: [Integer] -> Benchmark +benchBls12_381_G1_scalarMul multipliers = + let name = Bls12_381_G1_scalarMul + in createTwoTermBuiltinBenchElementwise name [] multipliers g1inputsA +-- linear in x (size of scalar) + +benchBls12_381_G1_equal :: Benchmark +benchBls12_381_G1_equal = + let name = Bls12_381_G1_equal + in createTwoTermBuiltinBenchElementwise name [] g1inputsA g1inputsA + -- Same arguments twice +-- constant time + +benchBls12_381_G1_hashToGroup :: Benchmark +benchBls12_381_G1_hashToGroup = + let name = Bls12_381_G1_hashToGroup + inputs = listOfByteStrings 100 + -- The maximum length of a DST is 255 bytes, so let's use that for all + -- cases (DST size shouldn't make much difference anyway). + dsts = listOfSizedByteStrings 100 255 + in createTwoTermBuiltinBenchElementwise name [] inputs dsts +-- linear in input size + +benchBls12_381_G1_compress :: Benchmark +benchBls12_381_G1_compress = + let name = Bls12_381_G1_compress + in createOneTermBuiltinBench name [] g1inputsA +-- constant time + +benchBls12_381_G1_uncompress :: Benchmark +benchBls12_381_G1_uncompress = + let name = Bls12_381_G1_uncompress + inputs = fmap G1.compress g1inputsA + in createOneTermBuiltinBench name [] inputs +-- constant time + +benchBls12_381_G2_add :: Benchmark +benchBls12_381_G2_add = + let name = Bls12_381_G2_add + in createTwoTermBuiltinBenchElementwise name [] g2inputsA g2inputsB +-- constant time + +benchBls12_381_G2_neg :: Benchmark +benchBls12_381_G2_neg = + let name = Bls12_381_G2_neg + in createOneTermBuiltinBench name [] g2inputsB +-- constant time + +benchBls12_381_G2_scalarMul :: [Integer] -> Benchmark +benchBls12_381_G2_scalarMul multipliers = + let name = Bls12_381_G2_scalarMul + in createTwoTermBuiltinBenchElementwise name [] multipliers g2inputsA +-- linear in x (size of scalar) + +benchBls12_381_G2_equal :: Benchmark +benchBls12_381_G2_equal = + let name = Bls12_381_G2_equal + in createTwoTermBuiltinBenchElementwise name [] g2inputsA g2inputsA + -- Same arguments twice +-- constant time + +benchBls12_381_G2_hashToGroup :: Benchmark +benchBls12_381_G2_hashToGroup = + let name = Bls12_381_G2_hashToGroup + inputs = listOfByteStrings 100 + dsts = listOfSizedByteStrings 100 255 + in createTwoTermBuiltinBenchElementwise name [] inputs dsts +-- linear in size of input + +benchBls12_381_G2_compress :: Benchmark +benchBls12_381_G2_compress = + let name = Bls12_381_G2_compress + in createOneTermBuiltinBench name [] g2inputsA +-- constant time + +benchBls12_381_G2_uncompress :: Benchmark +benchBls12_381_G2_uncompress = + let name = Bls12_381_G2_uncompress + inputs = fmap G2.compress g2inputsA + in createOneTermBuiltinBench name [] inputs +-- constant time + +benchBls12_381_millerLoop :: Benchmark +benchBls12_381_millerLoop = + let name = Bls12_381_millerLoop + in createTwoTermBuiltinBenchElementwise name [] g1inputsA g2inputsA +-- constant time + +benchBls12_381_mulMlResult :: Benchmark +benchBls12_381_mulMlResult = + let name = Bls12_381_mulMlResult + in createTwoTermBuiltinBenchElementwise name [] gtinputsA gtinputsB +-- constant time + +benchBls12_381_finalVerify :: Benchmark +benchBls12_381_finalVerify = + let name = Bls12_381_finalVerify + in createTwoTermBuiltinBenchElementwise name [] gtinputsA gtinputsB +-- constant time + + +blsBenchmarks :: StdGen -> [Benchmark] +blsBenchmarks gen = + let multipliers = fst $ makeSizedIntegers gen [1..100] -- Constants for scalar multiplication functions + in [ benchBls12_381_G1_add + , benchBls12_381_G1_neg + , benchBls12_381_G1_scalarMul multipliers + , benchBls12_381_G1_equal + , benchBls12_381_G1_hashToGroup + , benchBls12_381_G1_compress + , benchBls12_381_G1_uncompress + , benchBls12_381_G2_add + , benchBls12_381_G2_neg + , benchBls12_381_G2_scalarMul multipliers + , benchBls12_381_G2_equal + , benchBls12_381_G2_hashToGroup + , benchBls12_381_G2_compress + , benchBls12_381_G2_uncompress + , benchBls12_381_millerLoop + , benchBls12_381_mulMlResult + , benchBls12_381_finalVerify + ] + ---------------- Main benchmarks ---------------- makeBenchmarks :: StdGen -> [Benchmark] -makeBenchmarks _gen = - [benchVerifyEd25519Signature - , benchVerifyEcdsaSecp256k1Signature - , benchVerifySchnorrSecp256k1Signature] - <> (benchByteStringOneArgOp <$> [Sha2_256, Sha3_256, Blake2b_256]) - --- Sha3_256 takes about 2.65 times longer than Sha2_256, which in turn takes --- 2.82 times longer than Blake2b_256. All are (very) linear in the size of the --- input. +makeBenchmarks gen = [ benchVerifyEd25519Signature + , benchVerifyEcdsaSecp256k1Signature + , benchVerifySchnorrSecp256k1Signature + ] + <> (benchByteStringOneArgOp <$> [Sha2_256, Sha3_256, Blake2b_256]) + <> blsBenchmarks gen diff --git a/plutus-core/cost-model/create-cost-model/CreateBuiltinCostModel.hs b/plutus-core/cost-model/create-cost-model/CreateBuiltinCostModel.hs index dfd8d353ca5..81aa6cb25ec 100644 --- a/plutus-core/cost-model/create-cost-model/CreateBuiltinCostModel.hs +++ b/plutus-core/cost-model/create-cost-model/CreateBuiltinCostModel.hs @@ -8,6 +8,9 @@ module CreateBuiltinCostModel where +import PlutusCore.Crypto.BLS12_381.G1 qualified as G1 +import PlutusCore.Crypto.BLS12_381.G2 qualified as G2 +import PlutusCore.Crypto.BLS12_381.Pairing qualified as Pairing import PlutusCore.Evaluation.Machine.BuiltinCostModel import PlutusCore.Evaluation.Machine.CostStream import PlutusCore.Evaluation.Machine.ExMemory @@ -101,6 +104,23 @@ builtinCostModelNames = BuiltinCostModelBase , paramMkNilData = "mkNilDataModel" , paramMkNilPairData = "mkNilPairDataModel" , paramSerialiseData = "serialiseDataModel" + , paramBls12_381_G1_add = "bls12_381_G1_addModel" + , paramBls12_381_G1_neg = "bls12_381_G1_negModel" + , paramBls12_381_G1_scalarMul = "bls12_381_G1_scalarMulModel" + , paramBls12_381_G1_equal = "bls12_381_G1_equalModel" + , paramBls12_381_G1_compress = "bls12_381_G1_compressModel" + , paramBls12_381_G1_uncompress = "bls12_381_G1_uncompressModel" + , paramBls12_381_G1_hashToGroup = "bls12_381_G1_hashToGroupModel" + , paramBls12_381_G2_add = "bls12_381_G2_addModel" + , paramBls12_381_G2_neg = "bls12_381_G2_negModel" + , paramBls12_381_G2_scalarMul = "bls12_381_G2_scalarMulModel" + , paramBls12_381_G2_equal = "bls12_381_G2_equalModel" + , paramBls12_381_G2_compress = "bls12_381_G2_compressModel" + , paramBls12_381_G2_uncompress = "bls12_381_G2_uncompressModel" + , paramBls12_381_G2_hashToGroup = "bls12_381_G2_hashToGroupModel" + , paramBls12_381_millerLoop = "bls12_381_millerLoopModel" + , paramBls12_381_mulMlResult = "bls12_381_mulMlResultModel" + , paramBls12_381_finalVerify = "bls12_381_finalVerifyModel" } @@ -149,12 +169,12 @@ createBuiltinCostModel bmfile rfile = do paramLessThanByteString <- getParams lessThanByteString paramLessThanByteString paramLessThanEqualsByteString <- getParams lessThanEqualsByteString paramLessThanEqualsByteString -- Cryptography and hashes - paramSha2_256 <- getParams sha2_256 paramSha2_256 - paramSha3_256 <- getParams sha3_256 paramSha3_256 - paramBlake2b_256 <- getParams blake2b_256 paramBlake2b_256 - paramVerifyEd25519Signature <- getParams verifyEd25519Signature paramVerifyEd25519Signature - paramVerifyEcdsaSecp256k1Signature <- getParams verifyEcdsaSecp256k1Signature paramVerifyEcdsaSecp256k1Signature - paramVerifySchnorrSecp256k1Signature <- getParams verifySchnorrSecp256k1Signature paramVerifySchnorrSecp256k1Signature + paramSha2_256 <- getParams sha2_256 paramSha2_256 + paramSha3_256 <- getParams sha3_256 paramSha3_256 + paramBlake2b_256 <- getParams blake2b_256 paramBlake2b_256 + paramVerifyEd25519Signature <- getParams verifyEd25519Signature paramVerifyEd25519Signature + paramVerifyEcdsaSecp256k1Signature <- getParams verifyEcdsaSecp256k1Signature paramVerifyEcdsaSecp256k1Signature + paramVerifySchnorrSecp256k1Signature <- getParams verifySchnorrSecp256k1Signature paramVerifySchnorrSecp256k1Signature -- Strings paramAppendString <- getParams appendString paramAppendString paramEqualsString <- getParams equalsString paramEqualsString @@ -193,6 +213,24 @@ createBuiltinCostModel bmfile rfile = do paramMkPairData <- getParams mkPairData paramMkPairData paramMkNilData <- getParams mkNilData paramMkNilData paramMkNilPairData <- getParams mkNilPairData paramMkNilPairData + -- BLS12-381 + paramBls12_381_G1_add <- getParams bls12_381_G1_add paramBls12_381_G1_add + paramBls12_381_G1_neg <- getParams bls12_381_G1_neg paramBls12_381_G1_neg + paramBls12_381_G1_scalarMul <- getParams bls12_381_G1_scalarMul paramBls12_381_G1_scalarMul + paramBls12_381_G1_equal <- getParams bls12_381_G1_equal paramBls12_381_G1_equal + paramBls12_381_G1_compress <- getParams bls12_381_G1_compress paramBls12_381_G1_compress + paramBls12_381_G1_uncompress <- getParams bls12_381_G1_uncompress paramBls12_381_G1_uncompress + paramBls12_381_G1_hashToGroup <- getParams bls12_381_G1_hashToGroup paramBls12_381_G1_hashToGroup + paramBls12_381_G2_add <- getParams bls12_381_G2_add paramBls12_381_G2_add + paramBls12_381_G2_neg <- getParams bls12_381_G2_neg paramBls12_381_G2_neg + paramBls12_381_G2_scalarMul <- getParams bls12_381_G2_scalarMul paramBls12_381_G2_scalarMul + paramBls12_381_G2_equal <- getParams bls12_381_G2_equal paramBls12_381_G2_equal + paramBls12_381_G2_compress <- getParams bls12_381_G2_compress paramBls12_381_G2_compress + paramBls12_381_G2_uncompress <- getParams bls12_381_G2_uncompress paramBls12_381_G2_uncompress + paramBls12_381_G2_hashToGroup <- getParams bls12_381_G2_hashToGroup paramBls12_381_G2_hashToGroup + paramBls12_381_millerLoop <- getParams bls12_381_millerLoop paramBls12_381_millerLoop + paramBls12_381_mulMlResult <- getParams bls12_381_mulMlResult paramBls12_381_mulMlResult + paramBls12_381_finalVerify <- getParams bls12_381_finalVerify paramBls12_381_finalVerify pure $ BuiltinCostModelBase {..} @@ -293,7 +331,6 @@ readModelLinearOnDiagonal model c = do boolMemModel :: ModelTwoArguments boolMemModel = ModelTwoArgumentsConstantCost 1 - memoryUsageAsCostingInteger :: ExMemoryUsage a => a -> CostingInteger memoryUsageAsCostingInteger = coerce . sumCostStream . flattenCostRose . memoryUsage @@ -306,7 +343,7 @@ addInteger cpuModelR = do -- The worst case is adding e.g. `maxBound :: Int` + `maxBound :: Int`, which increases the memory usage by one. -- (max x y) + 1 let memModel = ModelTwoArgumentsMaxSize $ ModelMaxSize 1 1 - pure $ CostingFun (cpuModel) memModel + pure $ CostingFun cpuModel memModel subtractInteger :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelTwoArguments) subtractInteger cpuModelR = do @@ -480,7 +517,7 @@ verifyEd25519Signature cpuModelR = do code is very fast. The Z-based cost function returns a constant cost since the size of the third argument is constant; we should be using a Y-based function instead, but that would give similar results and we're not - undercharging siginficantly. To fix this we need to change the shape of + undercharging significantly. To fix this we need to change the shape of the model from "linear_in_z" to "linear_in_y", but that's something we need to be careful about: see SCP-3038. -} @@ -734,3 +771,141 @@ mkNilPairData cpuModelR = do let memModel = ModelOneArgumentConstantCost 32 pure $ CostingFun cpuModel memModel -- () -> [] :: [(Data,Data)] + + +---------------- BLS12_381 operations ---------------- + +toMemSize :: Int -> CostingInteger +toMemSize n = fromIntegral $ n `div` 8 + +-- Group order is 255 bits -> 32 bytes (4 words). +-- Field size is 381 bits -> 48 bytes (6 words) +-- (with three spare bits used for encoding purposes). + +-- Sizes below from sizePoint, compressedSizePoint, and sizePT in +-- Crypto.EllipticCurve.BLS12_381.Internal + +-- In-memory G1 points take up 144 bytes (18 words). +-- These are projective points, so we have *three* 48-byte coordinates. +g1MemSize :: CostingInteger +g1MemSize = toMemSize G1.memSizeBytes + +-- Compressed G1 points take up 48 bytes (6 words) +g1CompressedSize :: CostingInteger +g1CompressedSize = toMemSize G1.compressedSizeBytes + +-- In-memory G2 points take up 288 bytes (36 words) +g2MemSize :: CostingInteger +g2MemSize = toMemSize G2.memSizeBytes + +-- Compressed G2 points take up 96 bytes (12 words) +g2CompressedSize :: CostingInteger +g2CompressedSize = toMemSize G2.compressedSizeBytes + +-- In-memory G2 points take up 576 bytes (72 words) +mlResultMemSize :: CostingInteger +mlResultMemSize = toMemSize Pairing.mlResultMemSizeBytes + +bls12_381_G1_add :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelTwoArguments) +bls12_381_G1_add cpuModelR = do + cpuModel <- ModelTwoArgumentsConstantCost <$> readModelConstantCost cpuModelR + let memModel = ModelTwoArgumentsConstantCost g1MemSize + pure $ CostingFun cpuModel memModel + +bls12_381_G1_neg :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelOneArgument) +bls12_381_G1_neg cpuModelR = do + cpuModel <- ModelOneArgumentConstantCost <$> readModelConstantCost cpuModelR + let memModel = ModelOneArgumentConstantCost g1MemSize + pure $ CostingFun cpuModel memModel + +bls12_381_G1_scalarMul :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelTwoArguments) +bls12_381_G1_scalarMul cpuModelR = do + cpuModel <- ModelTwoArgumentsLinearInX <$> readModelLinearInX cpuModelR + let memModel = ModelTwoArgumentsConstantCost g1MemSize + pure $ CostingFun cpuModel memModel + +bls12_381_G1_equal :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelTwoArguments) +bls12_381_G1_equal cpuModelR = do + cpuModel <- ModelTwoArgumentsConstantCost <$> readModelConstantCost cpuModelR + let memModel = boolMemModel + pure $ CostingFun cpuModel memModel + +bls12_381_G1_hashToGroup :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelTwoArguments) +bls12_381_G1_hashToGroup cpuModelR = do + cpuModel <- ModelTwoArgumentsLinearInX <$> readModelLinearInX cpuModelR + let memModel = ModelTwoArgumentsConstantCost g1MemSize + pure $ CostingFun cpuModel memModel + +bls12_381_G1_compress :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelOneArgument) +bls12_381_G1_compress cpuModelR = do + cpuModel <- ModelOneArgumentConstantCost <$> readModelConstantCost cpuModelR + let memModel = ModelOneArgumentConstantCost g1CompressedSize + pure $ CostingFun cpuModel memModel + +bls12_381_G1_uncompress :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelOneArgument) +bls12_381_G1_uncompress cpuModelR = do + cpuModel <- ModelOneArgumentConstantCost <$> readModelConstantCost cpuModelR + let memModel = ModelOneArgumentConstantCost g1MemSize + pure $ CostingFun cpuModel memModel + +bls12_381_G2_add :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelTwoArguments) +bls12_381_G2_add cpuModelR = do + cpuModel <- ModelTwoArgumentsConstantCost <$> readModelConstantCost cpuModelR + let memModel = ModelTwoArgumentsConstantCost g2MemSize + pure $ CostingFun cpuModel memModel + +bls12_381_G2_neg :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelOneArgument) +bls12_381_G2_neg cpuModelR = do + cpuModel <- ModelOneArgumentConstantCost <$> readModelConstantCost cpuModelR + let memModel = ModelOneArgumentConstantCost g2MemSize + pure $ CostingFun cpuModel memModel + +bls12_381_G2_scalarMul :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelTwoArguments) +bls12_381_G2_scalarMul cpuModelR = do + cpuModel <- ModelTwoArgumentsLinearInX <$> readModelLinearInX cpuModelR + let memModel = ModelTwoArgumentsConstantCost g2MemSize + pure $ CostingFun cpuModel memModel + +bls12_381_G2_equal :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelTwoArguments) +bls12_381_G2_equal cpuModelR = do + cpuModel <- ModelTwoArgumentsConstantCost <$> readModelConstantCost cpuModelR + let memModel = boolMemModel + pure $ CostingFun cpuModel memModel + +bls12_381_G2_hashToGroup :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelTwoArguments) +bls12_381_G2_hashToGroup cpuModelR = do + cpuModel <- ModelTwoArgumentsLinearInX <$> readModelLinearInX cpuModelR + let memModel = ModelTwoArgumentsConstantCost g2MemSize + pure $ CostingFun cpuModel memModel + +bls12_381_G2_compress :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelOneArgument) +bls12_381_G2_compress cpuModelR = do + cpuModel <- ModelOneArgumentConstantCost <$> readModelConstantCost cpuModelR + let memModel = ModelOneArgumentConstantCost g2CompressedSize + pure $ CostingFun cpuModel memModel + +bls12_381_G2_uncompress :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelOneArgument) +bls12_381_G2_uncompress cpuModelR = do + cpuModel <- ModelOneArgumentConstantCost <$> readModelConstantCost cpuModelR + let memModel = ModelOneArgumentConstantCost g2MemSize + pure $ CostingFun cpuModel memModel + +bls12_381_millerLoop :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelTwoArguments) +bls12_381_millerLoop cpuModelR = do + cpuModel <- ModelTwoArgumentsConstantCost <$> readModelConstantCost cpuModelR + let memModel = ModelTwoArgumentsConstantCost mlResultMemSize + pure $ CostingFun cpuModel memModel + +bls12_381_mulMlResult :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelTwoArguments) +bls12_381_mulMlResult cpuModelR = do + cpuModel <- ModelTwoArgumentsConstantCost <$> readModelConstantCost cpuModelR + let memModel = ModelTwoArgumentsConstantCost mlResultMemSize + pure $ CostingFun cpuModel memModel + +bls12_381_finalVerify :: MonadR m => (SomeSEXP (Region m)) -> m (CostingFun ModelTwoArguments) +bls12_381_finalVerify cpuModelR= do + cpuModel <- ModelTwoArgumentsConstantCost <$> readModelConstantCost cpuModelR + let memModel = boolMemModel + pure $ CostingFun cpuModel memModel + + diff --git a/plutus-core/cost-model/data/benching.csv b/plutus-core/cost-model/data/benching.csv index 83edbd12830..266db535c35 100644 --- a/plutus-core/cost-model/data/benching.csv +++ b/plutus-core/cost-model/data/benching.csv @@ -1,4 +1,5 @@ # Benchmark results for cost model update prior to Vasil HF (12th May 2022). +# BLS12-381 results: May 2023 benchmark,t,t.mean.lb,t.mean.ub,t.sd,t.sd.lb,t.sd.ub IfThenElse/100/100,9.903368819621599e-7,9.67013522777269e-7,1.0172648298758596e-6,7.964815537277713e-8,6.98433698700813e-8,9.587075593393516e-8 IfThenElse/100/500,1.0855692272700772e-6,1.0476374612918429e-6,1.1620386696812784e-6,1.5989478294521692e-7,8.85710711974263e-8,3.1376848013729205e-7 @@ -2052,6 +2053,1706 @@ Blake2b_256/9700,1.0207647561413394e-4,1.014787688985795e-4,1.0323633561979889e- Blake2b_256/9800,1.0227941028300047e-4,1.017729043697749e-4,1.0444631558372355e-4,2.52368984984658e-6,9.555889044727126e-7,5.869269836003722e-6 Blake2b_256/9900,1.0465353877735825e-4,1.0408786611233812e-4,1.0606485586693787e-4,3.384054598698011e-6,1.6580780889069696e-6,5.960723836126841e-6 Blake2b_256/10000,1.0493704545146666e-4,1.0435372217420162e-4,1.0650937107249171e-4,3.234244305844669e-6,1.125263001034833e-6,5.9368682331128935e-6 +Bls12_381_G1_add/12/12,1.66632732699414e-6,1.66529329666621e-6,1.6672949997954758e-6,3.5081441131624374e-9,3.0809353761891355e-9,4.092938813345758e-9 +Bls12_381_G1_add/12/12,1.6753127089572078e-6,1.6744838692321767e-6,1.6762510140685204e-6,3.0956520418533004e-9,2.5666119678554987e-9,3.680937282056884e-9 +Bls12_381_G1_add/12/12,1.6641381470922022e-6,1.6633073889172297e-6,1.6650520313544842e-6,2.9164556837276715e-9,2.3800451071253958e-9,3.586341322980612e-9 +Bls12_381_G1_add/12/12,1.6598482527068796e-6,1.659114092119812e-6,1.6606949542716055e-6,2.7289872609350184e-9,2.278642189547749e-9,3.2287881206810735e-9 +Bls12_381_G1_add/12/12,1.6645513606930202e-6,1.6635004792881381e-6,1.665748496835621e-6,3.821980074070961e-9,3.0812208720787725e-9,5.085723355810849e-9 +Bls12_381_G1_add/12/12,1.6692546990313446e-6,1.667952762655368e-6,1.6710863487379616e-6,4.9935028687826945e-9,4.157279031825569e-9,5.99521553552218e-9 +Bls12_381_G1_add/12/12,1.6651354669626162e-6,1.6638644665629757e-6,1.6664518124136246e-6,4.549364754442831e-9,3.9172667994627365e-9,5.491513607879953e-9 +Bls12_381_G1_add/12/12,1.6714343068254789e-6,1.6699226324208289e-6,1.6732053335883905e-6,5.585646065480813e-9,4.659201640488342e-9,7.183434407149998e-9 +Bls12_381_G1_add/12/12,1.667045568873619e-6,1.665463065404157e-6,1.668789921953282e-6,5.681081358994778e-9,4.685532924688061e-9,7.0405160235223775e-9 +Bls12_381_G1_add/12/12,1.6655454948332827e-6,1.664760438108116e-6,1.6665816684689431e-6,3.0950930393903338e-9,2.406909528201739e-9,4.275416585453753e-9 +Bls12_381_G1_add/12/12,1.6671996365640918e-6,1.6662174605427985e-6,1.6683171055765714e-6,3.4597442967788396e-9,2.8729417337956203e-9,4.3430513367740895e-9 +Bls12_381_G1_add/12/12,1.6680431033475795e-6,1.6672032654218044e-6,1.6691783330557516e-6,3.2561328967165426e-9,2.627278621270261e-9,3.99668006534075e-9 +Bls12_381_G1_add/12/12,1.673254000767591e-6,1.6721161558817989e-6,1.674819731949235e-6,4.519491676886601e-9,3.856157331491081e-9,5.4906834267803455e-9 +Bls12_381_G1_add/12/12,1.6643374500564255e-6,1.6630706758600716e-6,1.665759658877838e-6,4.374258106315866e-9,3.6007879419881553e-9,5.918428327301319e-9 +Bls12_381_G1_add/12/12,1.675033644673657e-6,1.6741110192786205e-6,1.6758999427128362e-6,3.0193196851122563e-9,2.497029526078243e-9,3.7039003151267264e-9 +Bls12_381_G1_add/12/12,1.6682508107096133e-6,1.6670794902179998e-6,1.6693865500117958e-6,3.874433172767817e-9,3.2716405811314278e-9,4.762591324270748e-9 +Bls12_381_G1_add/12/12,1.6712907722765005e-6,1.6699903652492786e-6,1.6729907523531922e-6,4.947900511238491e-9,3.938687426174157e-9,6.487760088373589e-9 +Bls12_381_G1_add/12/12,1.6714705978491765e-6,1.6708270798732332e-6,1.6722611103747045e-6,2.3632916737459753e-9,2.0077699584389235e-9,2.791575169404104e-9 +Bls12_381_G1_add/12/12,1.667767466165817e-6,1.6668408813091738e-6,1.6687716124543298e-6,3.346045927475368e-9,2.885064078953536e-9,3.926518154369233e-9 +Bls12_381_G1_add/12/12,1.6656475153944737e-6,1.6645876141558154e-6,1.6668597952259378e-6,3.797467364669177e-9,3.289149935158591e-9,4.510674533887416e-9 +Bls12_381_G1_add/12/12,1.6640036161307483e-6,1.6631758642569999e-6,1.6647962169865289e-6,2.757794417877687e-9,2.3693980921807484e-9,3.397776277992072e-9 +Bls12_381_G1_add/12/12,1.6641590057386273e-6,1.6633008251138166e-6,1.6653267824997017e-6,3.2391936799524534e-9,2.7248383997465438e-9,3.9422257577890005e-9 +Bls12_381_G1_add/12/12,1.6656796793404137e-6,1.664740344711258e-6,1.6666866918301014e-6,3.3159497835190833e-9,2.7897426588165566e-9,4.092477657461383e-9 +Bls12_381_G1_add/12/12,1.6626138424035979e-6,1.6607486720731504e-6,1.6652089896590779e-6,7.177208376610341e-9,4.961774872089198e-9,1.0989629260817102e-8 +Bls12_381_G1_add/12/12,1.6666893590750386e-6,1.6658487217653578e-6,1.6675123815215043e-6,2.6701691926641192e-9,2.155898303917367e-9,3.4459613579821374e-9 +Bls12_381_G1_add/12/12,1.6613455178672208e-6,1.660545464354908e-6,1.662324409716327e-6,2.981903284182765e-9,2.4672141281171498e-9,3.7227102665834935e-9 +Bls12_381_G1_add/12/12,1.6605769289414799e-6,1.659823875239869e-6,1.6615074119894164e-6,2.7631542472700306e-9,2.2979906840828435e-9,3.4132509359048377e-9 +Bls12_381_G1_add/12/12,1.6628952444812586e-6,1.6623878626951233e-6,1.6634754265343402e-6,1.938077719158481e-9,1.6570294355186254e-9,2.2833387378138843e-9 +Bls12_381_G1_add/12/12,1.6676214008412099e-6,1.666569371526417e-6,1.6686071598368582e-6,3.521348694190784e-9,2.9001534155334825e-9,4.50232320632257e-9 +Bls12_381_G1_add/12/12,1.6636459524937375e-6,1.6629546234649409e-6,1.6644047135910665e-6,2.436941850578891e-9,2.075028775194422e-9,2.958613188847631e-9 +Bls12_381_G1_add/12/12,1.661731670480039e-6,1.6608502514481807e-6,1.6626288505881492e-6,2.93344891212785e-9,2.4223928974386977e-9,3.585625726264158e-9 +Bls12_381_G1_add/12/12,1.6645821759903e-6,1.6638631701583334e-6,1.6653011012355394e-6,2.466470621107351e-9,2.0291010240479956e-9,3.1630639634671857e-9 +Bls12_381_G1_add/12/12,1.662237251544539e-6,1.6614072223615436e-6,1.6631049237472334e-6,3.0444058067156595e-9,2.654057852381596e-9,3.6078038301868446e-9 +Bls12_381_G1_add/12/12,1.666903685465707e-6,1.665971625237408e-6,1.6679916969677448e-6,3.3733762034287557e-9,2.7422563974498014e-9,4.555126227720154e-9 +Bls12_381_G1_add/12/12,1.6821244531805879e-6,1.6810888477751478e-6,1.683433082743583e-6,3.903717142445729e-9,2.927641155358717e-9,5.765437413726818e-9 +Bls12_381_G1_add/12/12,1.6713371722680514e-6,1.6702478116910385e-6,1.6723340176875188e-6,3.5526608165478717e-9,2.8471341176760485e-9,4.897354247789531e-9 +Bls12_381_G1_add/12/12,1.6641673030960683e-6,1.6633695451944982e-6,1.6651784437978277e-6,3.0851221760611785e-9,2.1929780423093534e-9,4.89420189587705e-9 +Bls12_381_G1_add/12/12,1.665652021070642e-6,1.6649333486701765e-6,1.6664965186376556e-6,2.694867755783641e-9,2.2870116329375177e-9,3.3065049413631918e-9 +Bls12_381_G1_add/12/12,1.6623140032926114e-6,1.661515459975733e-6,1.6632718356689329e-6,2.892146289579109e-9,2.372991490751258e-9,3.48853076850503e-9 +Bls12_381_G1_add/12/12,1.6683167148220207e-6,1.6674873313884061e-6,1.669111749020664e-6,2.6187532672674926e-9,2.242901392970405e-9,3.0714590249058484e-9 +Bls12_381_G1_add/12/12,1.6702810683040718e-6,1.6692899186292323e-6,1.6713946150257075e-6,3.7149318463245965e-9,3.373835176891417e-9,4.24886777197234e-9 +Bls12_381_G1_add/12/12,1.6670620572471678e-6,1.6660486495074507e-6,1.6682482089910533e-6,3.6557676686267754e-9,3.0851399502394104e-9,4.266260926162386e-9 +Bls12_381_G1_add/12/12,1.6701889971271938e-6,1.6692177335138035e-6,1.6711596965974847e-6,3.39561209481265e-9,2.882857219657846e-9,4.056458506460987e-9 +Bls12_381_G1_add/12/12,1.6620460539900466e-6,1.6612579765159791e-6,1.6629413837370303e-6,2.9592218359354892e-9,2.596495246063736e-9,3.5631858797910048e-9 +Bls12_381_G1_add/12/12,1.6658218737175083e-6,1.6651537006246427e-6,1.6665436777629353e-6,2.3322414376022487e-9,1.9460101998174967e-9,2.8574243639385293e-9 +Bls12_381_G1_add/12/12,1.6639443695335304e-6,1.663068011970521e-6,1.6649466632994968e-6,3.2851863011408123e-9,2.797980496334699e-9,4.055848632834154e-9 +Bls12_381_G1_add/12/12,1.6677908291884998e-6,1.666839677238645e-6,1.6687075495175168e-6,3.299477726094923e-9,2.6730671787481254e-9,4.105534104917152e-9 +Bls12_381_G1_add/12/12,1.6592264675170765e-6,1.658364169081842e-6,1.6602007966203753e-6,2.9813643102579986e-9,2.5135484458747756e-9,3.5377383342809906e-9 +Bls12_381_G1_add/12/12,1.6665007353576335e-6,1.6653197007477127e-6,1.667854467434898e-6,4.3718320980825255e-9,3.725429993711736e-9,5.36968947307058e-9 +Bls12_381_G1_add/12/12,1.6609039488932117e-6,1.6601253997195324e-6,1.6617448113346535e-6,2.680525475820749e-9,2.352924200746501e-9,3.2134322830204814e-9 +Bls12_381_G1_add/12/12,1.6706524533830278e-6,1.6697916401079669e-6,1.671732169912524e-6,3.4244740569236716e-9,2.84520805251711e-9,4.275907689115833e-9 +Bls12_381_G1_add/12/12,1.674518695999947e-6,1.6728861403083482e-6,1.6763461808529767e-6,5.534535167597088e-9,4.488005482650863e-9,7.438926371337595e-9 +Bls12_381_G1_add/12/12,1.6600339399835818e-6,1.6590045467786855e-6,1.6610088351322939e-6,3.4259278382282493e-9,2.892278603741928e-9,4.379581680737131e-9 +Bls12_381_G1_add/12/12,1.6639199091715688e-6,1.6630377130892725e-6,1.6649454750891085e-6,3.3068231992959743e-9,2.632582766739255e-9,4.383841662594434e-9 +Bls12_381_G1_add/12/12,1.6642810825408903e-6,1.6634777527355952e-6,1.6652252645981926e-6,2.8822443618838176e-9,2.5017029942288964e-9,3.4272812546231035e-9 +Bls12_381_G1_add/12/12,1.6612292537445852e-6,1.6602984095332111e-6,1.6624490327933261e-6,3.4445155253868536e-9,2.684698626326679e-9,4.4809297089642e-9 +Bls12_381_G1_add/12/12,1.661613926264666e-6,1.6606120938537679e-6,1.662541750938188e-6,3.28707655365575e-9,2.7537389567016003e-9,3.89175134196461e-9 +Bls12_381_G1_add/12/12,1.6681758497538207e-6,1.667313593903988e-6,1.669153529009464e-6,3.123935508529797e-9,2.6343104671357366e-9,4.06937619617983e-9 +Bls12_381_G1_add/12/12,1.6615027930506735e-6,1.6604251682566684e-6,1.6627345056558164e-6,3.769547708857046e-9,3.1620007203436774e-9,4.645976729959087e-9 +Bls12_381_G1_add/12/12,1.667628127135085e-6,1.6668683369522762e-6,1.6684050139128892e-6,2.6055537923246915e-9,2.153244155704415e-9,3.3102923172167996e-9 +Bls12_381_G1_add/12/12,1.6582268416314122e-6,1.657617252081099e-6,1.6591155776906156e-6,2.375764882706739e-9,1.8117083733453108e-9,3.056052443823245e-9 +Bls12_381_G1_add/12/12,1.6682323065920873e-6,1.6675991981266583e-6,1.6689525049648371e-6,2.33767232702594e-9,1.8990401350567003e-9,2.8261199521551018e-9 +Bls12_381_G1_add/12/12,1.673404265060308e-6,1.6726668280818692e-6,1.6744230095301259e-6,2.9970203349315926e-9,2.4686448907388823e-9,3.9410333770987076e-9 +Bls12_381_G1_add/12/12,1.6675615070106749e-6,1.666353586424548e-6,1.6686271551013406e-6,4.034919960871357e-9,3.490787807708446e-9,4.748191213470455e-9 +Bls12_381_G1_add/12/12,1.667466059630407e-6,1.6668493278974869e-6,1.6682573318685697e-6,2.332220853517837e-9,1.901089109756739e-9,2.896433772495122e-9 +Bls12_381_G1_add/12/12,1.6676253956931946e-6,1.6666552806860012e-6,1.6687242044458749e-6,3.618299531886246e-9,3.1011003177310148e-9,4.8052915016560984e-9 +Bls12_381_G1_add/12/12,1.6667027320019448e-6,1.6659308976399255e-6,1.6675584994026162e-6,2.7880894963972184e-9,2.380941156694021e-9,3.2267255417160413e-9 +Bls12_381_G1_add/12/12,1.6666824338324483e-6,1.6657903630073646e-6,1.6675289085948693e-6,2.951995155022313e-9,2.5979333219661776e-9,3.3874670654685277e-9 +Bls12_381_G1_add/12/12,1.6610893929616608e-6,1.6601744293516077e-6,1.6622435291140212e-6,3.4066227364336114e-9,2.9305275019074395e-9,4.299488641483736e-9 +Bls12_381_G1_add/12/12,1.6607969983107583e-6,1.659799868778441e-6,1.6621308330203685e-6,3.822147725140707e-9,3.217306542689079e-9,5.082059606442579e-9 +Bls12_381_G1_add/12/12,1.661744200778071e-6,1.6609617125562083e-6,1.6626539995642634e-6,3.0177217903305816e-9,2.5891627201096146e-9,3.551326460359728e-9 +Bls12_381_G1_add/12/12,1.6579941011713685e-6,1.6571216046977495e-6,1.658886264098878e-6,2.8473999935417095e-9,2.4686816969199205e-9,3.348179796300742e-9 +Bls12_381_G1_add/12/12,1.6592737698641898e-6,1.6585412819370128e-6,1.660039417257253e-6,2.5092397093176654e-9,2.12739688447407e-9,3.0266209946024694e-9 +Bls12_381_G1_add/12/12,1.6637938467448926e-6,1.6628910227580331e-6,1.6649375651397335e-6,3.4547730991569402e-9,2.6299513915536373e-9,4.337322129037804e-9 +Bls12_381_G1_add/12/12,1.6729943868824233e-6,1.6717984420721154e-6,1.6747118710103937e-6,4.85356239220558e-9,3.73731318051774e-9,7.01567413694729e-9 +Bls12_381_G1_add/12/12,1.6691601596827192e-6,1.6678321075101585e-6,1.6704785983651138e-6,4.430114472922608e-9,3.841424331013058e-9,5.199355006525253e-9 +Bls12_381_G1_add/12/12,1.6721501152726566e-6,1.6711651692359384e-6,1.673223434240468e-6,3.6422107527041368e-9,3.0784652196918556e-9,4.420824625821854e-9 +Bls12_381_G1_add/12/12,1.6715723601810555e-6,1.6702473428248357e-6,1.6729400043205392e-6,4.383478066103578e-9,3.7121597054154585e-9,5.323583843806096e-9 +Bls12_381_G1_add/12/12,1.6701067451683636e-6,1.6692618007623891e-6,1.670956850254739e-6,2.965704933194504e-9,2.4346213292612913e-9,3.881392133293839e-9 +Bls12_381_G1_add/12/12,1.6646813937974598e-6,1.663783064929126e-6,1.6660077489722068e-6,3.789723314950685e-9,2.9982377077589002e-9,5.2720739107650364e-9 +Bls12_381_G1_add/12/12,1.6635948172781353e-6,1.6625437316262266e-6,1.664666729513529e-6,3.6077263111786557e-9,2.992488031333894e-9,4.59870393830378e-9 +Bls12_381_G1_add/12/12,1.6676065435299399e-6,1.666587810349754e-6,1.668691688956697e-6,3.570916635739704e-9,3.0879865224066787e-9,4.180420608533037e-9 +Bls12_381_G1_add/12/12,1.6645559667237387e-6,1.663307424067217e-6,1.6661146247205073e-6,4.566870434243856e-9,3.6659909065137234e-9,5.893138471041983e-9 +Bls12_381_G1_add/12/12,1.6602156570884058e-6,1.6590956961824907e-6,1.6616063365470586e-6,4.179098939189828e-9,3.624527389679626e-9,4.904262095110625e-9 +Bls12_381_G1_add/12/12,1.6646125749420472e-6,1.6637892285433218e-6,1.66529448668683e-6,2.5942534875184733e-9,2.1836624845829497e-9,3.1556407283426574e-9 +Bls12_381_G1_add/12/12,1.6679074529111765e-6,1.6670866543790686e-6,1.6689692749752786e-6,3.27407494318396e-9,2.535216120713125e-9,4.3527146757113114e-9 +Bls12_381_G1_add/12/12,1.6604327313945717e-6,1.6596789207546891e-6,1.6613188588039673e-6,2.786178643150668e-9,2.270659104036509e-9,3.6066619161678243e-9 +Bls12_381_G1_add/12/12,1.6681624864403862e-6,1.6672493800284032e-6,1.669113348769419e-6,3.166378917835764e-9,2.706835152905869e-9,3.822172182986073e-9 +Bls12_381_G1_add/12/12,1.6647801541328935e-6,1.6637426565328028e-6,1.6660185065687718e-6,3.767387814086036e-9,3.063199962575247e-9,4.73094217106588e-9 +Bls12_381_G1_add/12/12,1.6601986424010707e-6,1.6590507013674706e-6,1.6615826848256708e-6,4.274801366986017e-9,3.5592665234477972e-9,5.294713702529145e-9 +Bls12_381_G1_add/12/12,1.6689033651884073e-6,1.668173874406072e-6,1.6696661487455685e-6,2.5529618883934736e-9,2.0959633114560678e-9,3.1872978618840564e-9 +Bls12_381_G1_add/12/12,1.6647000377031504e-6,1.6637648906804302e-6,1.6658178561708442e-6,3.4818600102359715e-9,3.0276841191611112e-9,3.992658498318551e-9 +Bls12_381_G1_add/12/12,1.660480215229696e-6,1.6596552721512775e-6,1.66162287381722e-6,3.2632314105010576e-9,2.4499254338655202e-9,4.303145395532397e-9 +Bls12_381_G1_add/12/12,1.6651639644461252e-6,1.6644272630535103e-6,1.6660594564010427e-6,2.6447418559065653e-9,2.208747696295694e-9,3.197126216446987e-9 +Bls12_381_G1_add/12/12,1.6667288876459788e-6,1.66564194585106e-6,1.6679865840425916e-6,3.889305956247195e-9,3.1745961582218355e-9,5.0751508928392224e-9 +Bls12_381_G1_add/12/12,1.6666311591200831e-6,1.6655897752097695e-6,1.6677394743826185e-6,3.637508998189914e-9,3.2078048310933746e-9,4.271735069805737e-9 +Bls12_381_G1_add/12/12,1.6757257077522265e-6,1.6740748430661362e-6,1.6776542951795165e-6,6.112642630371589e-9,5.033758295890689e-9,7.815000747941027e-9 +Bls12_381_G1_add/12/12,1.6703030876573912e-6,1.6688278936027568e-6,1.6720005772626201e-6,5.564331763825774e-9,4.645223763762545e-9,7.113770735301905e-9 +Bls12_381_G1_add/12/12,1.662807858569497e-6,1.6619024273443862e-6,1.6635836337840606e-6,2.8401776712212645e-9,2.28294086793587e-9,3.833873004660082e-9 +Bls12_381_G1_add/12/12,1.6603383454193462e-6,1.6593930024308378e-6,1.6613888451732864e-6,3.3207058744260245e-9,2.759035125278011e-9,3.995719296745574e-9 +Bls12_381_G1_scalarMul/1/12,9.473202813734018e-5,9.471549528251172e-5,9.475079002486112e-5,5.860471023662001e-8,4.857240929024022e-8,7.295877180000864e-8 +Bls12_381_G1_scalarMul/2/12,9.512890178509712e-5,9.511141171893544e-5,9.514725848920655e-5,6.210489006722184e-8,4.6870528125302787e-8,8.482896472670579e-8 +Bls12_381_G1_scalarMul/3/12,9.556526390359471e-5,9.55448769750068e-5,9.558525364825546e-5,6.736113185392191e-8,5.7100471850104365e-8,8.152939004534215e-8 +Bls12_381_G1_scalarMul/4/12,9.601751817622431e-5,9.59996029451122e-5,9.603789054946759e-5,6.679298663429758e-8,5.61061610950901e-8,8.396149790794258e-8 +Bls12_381_G1_scalarMul/5/12,9.621160726168009e-5,9.618461920483442e-5,9.6233911178979e-5,8.335551171477349e-8,6.58729369452768e-8,1.0976315018556657e-7 +Bls12_381_G1_scalarMul/6/12,9.613953036205746e-5,9.612190504803043e-5,9.615843939953997e-5,6.252090079923303e-8,5.263222547796535e-8,7.648396884742356e-8 +Bls12_381_G1_scalarMul/7/12,9.632804145755302e-5,9.629713185306643e-5,9.635365181127376e-5,9.610908977636641e-8,7.947800020084132e-8,1.215735529422552e-7 +Bls12_381_G1_scalarMul/8/12,9.638022533841284e-5,9.635331968522137e-5,9.6407341125872e-5,9.031495609650978e-8,7.588547346962139e-8,1.0666644835654606e-7 +Bls12_381_G1_scalarMul/9/12,9.666264702554533e-5,9.664313227275407e-5,9.66800571891484e-5,5.994466403864609e-8,5.261601688749431e-8,6.9374038120338e-8 +Bls12_381_G1_scalarMul/10/12,9.64577374482299e-5,9.643641547906456e-5,9.648182343711754e-5,7.440373227406892e-8,6.026786605934256e-8,9.324115926421187e-8 +Bls12_381_G1_scalarMul/11/12,9.645341542694658e-5,9.643038752648292e-5,9.647520748539464e-5,7.682557335054775e-8,6.239385529563293e-8,1.0330739236209227e-7 +Bls12_381_G1_scalarMul/12/12,9.662734920163714e-5,9.660278247769547e-5,9.665452553812456e-5,8.71542333748271e-8,6.861349974636448e-8,1.339577915492316e-7 +Bls12_381_G1_scalarMul/13/12,9.665640702127216e-5,9.663613868221957e-5,9.668038768270141e-5,7.202105709029782e-8,6.020749790076391e-8,9.230338801450357e-8 +Bls12_381_G1_scalarMul/14/12,9.664860015247759e-5,9.661100220946872e-5,9.668261774858459e-5,1.2731449049781672e-7,1.1112063069450307e-7,1.4862094041018218e-7 +Bls12_381_G1_scalarMul/15/12,9.671836679965902e-5,9.669390603503663e-5,9.674307842763685e-5,8.215300975304477e-8,6.768245494335076e-8,1.0168199302596716e-7 +Bls12_381_G1_scalarMul/16/12,9.688628885615623e-5,9.685537743605175e-5,9.691061074685011e-5,9.383447728828867e-8,7.276210459436432e-8,1.2162219284770931e-7 +Bls12_381_G1_scalarMul/17/12,9.672795607720879e-5,9.671128480615008e-5,9.674782251802835e-5,6.114968615521164e-8,5.081574699508083e-8,7.411764591727461e-8 +Bls12_381_G1_scalarMul/18/12,9.68096411179731e-5,9.678231602269308e-5,9.683700121751369e-5,9.679129863555204e-8,8.539544184190893e-8,1.1102087812221631e-7 +Bls12_381_G1_scalarMul/19/12,9.692797909332935e-5,9.688504471413373e-5,9.696349914564806e-5,1.325631830135413e-7,1.1764407319586148e-7,1.525926127949346e-7 +Bls12_381_G1_scalarMul/20/12,9.707428577433074e-5,9.705291972236465e-5,9.709749481998267e-5,7.800817804402426e-8,6.610688746610116e-8,9.617340594521871e-8 +Bls12_381_G1_scalarMul/21/12,9.712873614380899e-5,9.710283181405318e-5,9.71503624325419e-5,7.651686520374482e-8,5.599802238473534e-8,1.0879218625859093e-7 +Bls12_381_G1_scalarMul/22/12,9.703391956934781e-5,9.699994616812886e-5,9.706305529362974e-5,1.0350473202374323e-7,8.8632648661222e-8,1.2012117676409606e-7 +Bls12_381_G1_scalarMul/23/12,9.734254273757547e-5,9.731489501117381e-5,9.736833005830091e-5,8.918181622936606e-8,7.522030023504182e-8,1.0573730797087047e-7 +Bls12_381_G1_scalarMul/24/12,9.742428257651504e-5,9.739835694087932e-5,9.744491487892714e-5,7.996556594452835e-8,6.788916615520893e-8,9.491422033165915e-8 +Bls12_381_G1_scalarMul/25/12,9.74428268015384e-5,9.741792647918774e-5,9.746504013467006e-5,8.139404028218293e-8,6.904855564916052e-8,9.74676717661499e-8 +Bls12_381_G1_scalarMul/26/12,9.73553088769349e-5,9.73306137809582e-5,9.738054742042188e-5,8.552181454651935e-8,7.269293299783632e-8,9.896457778046823e-8 +Bls12_381_G1_scalarMul/27/12,9.761346458900461e-5,9.75756281694592e-5,9.764429718650598e-5,1.1257082396927841e-7,9.25198291641681e-8,1.4309653064542067e-7 +Bls12_381_G1_scalarMul/28/12,9.766952880738879e-5,9.76463559908826e-5,9.768980616479859e-5,6.89828482943374e-8,5.607669354538648e-8,8.479526859804526e-8 +Bls12_381_G1_scalarMul/29/12,9.760577451487443e-5,9.756199388373812e-5,9.765607009781654e-5,1.561435199042008e-7,1.396738494824152e-7,1.7512193594856226e-7 +Bls12_381_G1_scalarMul/30/12,9.79784728909673e-5,9.795727269832124e-5,9.800010442650543e-5,6.953669454650912e-8,5.6988436952585336e-8,8.747062419080136e-8 +Bls12_381_G1_scalarMul/31/12,9.763805533882596e-5,9.760075806340355e-5,9.768007377699485e-5,1.3246371258935925e-7,1.1465740351821143e-7,1.581641692658562e-7 +Bls12_381_G1_scalarMul/32/12,9.818791797007299e-5,9.81649166238867e-5,9.821141553425598e-5,7.69173118891398e-8,6.331954144268039e-8,9.410237424887012e-8 +Bls12_381_G1_scalarMul/33/12,9.808592110428134e-5,9.806777666838107e-5,9.810249959432038e-5,5.936785990888673e-8,5.111246792381776e-8,6.981810986166767e-8 +Bls12_381_G1_scalarMul/34/12,9.793581702361054e-5,9.789840849673906e-5,9.796854520057579e-5,1.1141599133534311e-7,9.919647350955921e-8,1.287273516508954e-7 +Bls12_381_G1_scalarMul/35/12,9.814866158651438e-5,9.812196391075418e-5,9.817720872198448e-5,9.995965006393379e-8,8.346412570599136e-8,1.21847203144821e-7 +Bls12_381_G1_scalarMul/36/12,9.823008621214964e-5,9.81910361081651e-5,9.826551988144393e-5,1.2655333957949033e-7,1.1023040740415455e-7,1.5386058443273873e-7 +Bls12_381_G1_scalarMul/37/12,9.8253557330658e-5,9.822281517178199e-5,9.82850943019245e-5,1.0718429921341008e-7,9.099172029361249e-8,1.2704297662424798e-7 +Bls12_381_G1_scalarMul/38/12,9.839827259089372e-5,9.838335423717502e-5,9.841263998099502e-5,4.836097453989832e-8,4.026328141927047e-8,5.891235963948887e-8 +Bls12_381_G1_scalarMul/39/12,9.841879851236206e-5,9.839552280294615e-5,9.844130690633546e-5,7.71154604844484e-8,6.327803539530984e-8,9.654567537088547e-8 +Bls12_381_G1_scalarMul/40/12,9.837824605553112e-5,9.834568796814192e-5,9.84065150915235e-5,1.048371409868064e-7,8.191533561378613e-8,1.3487487832502497e-7 +Bls12_381_G1_scalarMul/41/12,9.86695842006425e-5,9.86412582009501e-5,9.869915953956815e-5,9.714108577046739e-8,8.04049859252075e-8,1.2396849766419955e-7 +Bls12_381_G1_scalarMul/42/12,9.871414489130363e-5,9.868484699828575e-5,9.873909316854099e-5,8.994328549692185e-8,7.287466583451699e-8,1.1647374190397883e-7 +Bls12_381_G1_scalarMul/43/12,9.873286261265962e-5,9.871600427024734e-5,9.874624511463897e-5,4.92570901420296e-8,4.0760611630611915e-8,6.103831171905971e-8 +Bls12_381_G1_scalarMul/44/12,9.881449686984351e-5,9.878890841509113e-5,9.884448827556303e-5,9.274722197132488e-8,7.526200094579018e-8,1.3682835021064967e-7 +Bls12_381_G1_scalarMul/45/12,9.903064184196183e-5,9.90001302614457e-5,9.905889676947591e-5,1.0299182943064144e-7,8.784562841223528e-8,1.289648912391012e-7 +Bls12_381_G1_scalarMul/46/12,9.904000656192944e-5,9.902187953579549e-5,9.90596210673833e-5,6.23312154252261e-8,5.23587993033566e-8,7.612933955213074e-8 +Bls12_381_G1_scalarMul/47/12,9.924034823994773e-5,9.920994849753872e-5,9.92749447831142e-5,1.1039929245083486e-7,9.421778421581215e-8,1.340560784720896e-7 +Bls12_381_G1_scalarMul/48/12,9.916156871682868e-5,9.91362861390738e-5,9.918927866430332e-5,9.213744419585398e-8,7.513793888089307e-8,1.1438280100504488e-7 +Bls12_381_G1_scalarMul/49/12,9.947546475493403e-5,9.944990669300493e-5,9.949831546821806e-5,8.287023124312105e-8,6.654299064877871e-8,1.0610648911531048e-7 +Bls12_381_G1_scalarMul/50/12,9.910261486778752e-5,9.906078799213892e-5,9.913637366708159e-5,1.230498593405944e-7,1.0043680666332442e-7,1.5861566631628465e-7 +Bls12_381_G1_scalarMul/51/12,9.957254106970156e-5,9.954459391065944e-5,9.959366542510295e-5,8.226262670285987e-8,7.025723473092292e-8,9.9824237469551e-8 +Bls12_381_G1_scalarMul/52/12,9.969744321379548e-5,9.966327358134212e-5,9.97236361118315e-5,1.0282699921893723e-7,8.74014805168447e-8,1.2691389370157301e-7 +Bls12_381_G1_scalarMul/53/12,9.963123315819523e-5,9.959549174281521e-5,9.966390067674225e-5,1.1218529953075374e-7,9.324649588938789e-8,1.3323453828101862e-7 +Bls12_381_G1_scalarMul/54/12,9.961285512413202e-5,9.958449227868498e-5,9.963963555344097e-5,8.771259012241129e-8,7.473437990982612e-8,1.0685487619142021e-7 +Bls12_381_G1_scalarMul/55/12,9.984467269613785e-5,9.97918297241376e-5,9.98932956406588e-5,1.705680629476565e-7,1.4340886671837277e-7,2.022197129987418e-7 +Bls12_381_G1_scalarMul/56/12,9.999504965247959e-5,9.99690318507442e-5,1.0001819659125645e-4,8.396312897993297e-8,6.977094901047229e-8,1.0606062672695632e-7 +Bls12_381_G1_scalarMul/57/12,9.987610007377005e-5,9.983751056818032e-5,9.991593035543677e-5,1.3375052294211277e-7,1.1410325128923384e-7,1.6953247406644196e-7 +Bls12_381_G1_scalarMul/58/12,1.000347308429944e-4,1.0001090276357871e-4,1.0005782894076486e-4,8.122729332929836e-8,6.76287731209052e-8,1.0248471868493454e-7 +Bls12_381_G1_scalarMul/59/12,1.0036703199476531e-4,1.0031432557870439e-4,1.0041125070368666e-4,1.584709464517731e-7,1.2441854405344242e-7,1.9326459630771735e-7 +Bls12_381_G1_scalarMul/60/12,1.0019221034832686e-4,1.0015576394961377e-4,1.0022873332230677e-4,1.2104300973552658e-7,1.025031613620826e-7,1.5196715396002383e-7 +Bls12_381_G1_scalarMul/61/12,1.0010266763950383e-4,1.0005177504797106e-4,1.0015296000608934e-4,1.7851636904092167e-7,1.5366725964729012e-7,2.1585164616601907e-7 +Bls12_381_G1_scalarMul/62/12,1.0042787303060216e-4,1.0038123983741451e-4,1.0046721234976935e-4,1.4651050496927807e-7,1.2199836552544943e-7,1.820733320719286e-7 +Bls12_381_G1_scalarMul/63/12,1.0050337702023102e-4,1.0047406591894297e-4,1.0053425323237489e-4,1.0152994425970158e-7,8.448468148419728e-8,1.2495045186751337e-7 +Bls12_381_G1_scalarMul/64/12,1.0042782876230484e-4,1.0036619273828792e-4,1.0048607821961411e-4,1.9874335578295248e-7,1.5606233340672402e-7,2.4541986241752505e-7 +Bls12_381_G1_scalarMul/65/12,1.0038654184148456e-4,1.0033968916291826e-4,1.00427473130689e-4,1.5160165239725447e-7,1.2950943172012094e-7,1.7861121723172614e-7 +Bls12_381_G1_scalarMul/66/12,1.0040336225798941e-4,1.0035641574233333e-4,1.0045722678151133e-4,1.6499273350027305e-7,1.4246147121673104e-7,2.037832607066916e-7 +Bls12_381_G1_scalarMul/67/12,1.0042529497598521e-4,1.0035435735012919e-4,1.0049188909786995e-4,2.2973416374054507e-7,2.0645605633186875e-7,2.6019200500249157e-7 +Bls12_381_G1_scalarMul/68/12,1.0091863341601693e-4,1.0088554772388798e-4,1.0094384181329674e-4,9.553822140369806e-8,7.952557892734362e-8,1.1493609164230006e-7 +Bls12_381_G1_scalarMul/69/12,1.0098857729779227e-4,1.0095215877234899e-4,1.0102406989971209e-4,1.2621526694885852e-7,1.0625069281119801e-7,1.512970255307995e-7 +Bls12_381_G1_scalarMul/70/12,1.0119789513650233e-4,1.0113760762723137e-4,1.0125589695236853e-4,1.9404959286329558e-7,1.6868397727615548e-7,2.3004656682990465e-7 +Bls12_381_G1_scalarMul/71/12,1.0060944165171822e-4,1.0058422085073543e-4,1.0063648515494542e-4,9.013654503751709e-8,7.671872599272291e-8,1.0961772653313193e-7 +Bls12_381_G1_scalarMul/72/12,1.0149850430351982e-4,1.0146661856561571e-4,1.0153864882787806e-4,1.2165589657611166e-7,1.0344876958927208e-7,1.4865086007623465e-7 +Bls12_381_G1_scalarMul/73/12,1.0131715528216939e-4,1.0128467743133782e-4,1.0134908243422825e-4,1.0472230509170382e-7,8.681815047531372e-8,1.263042092033009e-7 +Bls12_381_G1_scalarMul/74/12,1.0161006155347317e-4,1.0158605381750418e-4,1.0163505631285337e-4,8.331756510561985e-8,7.143123472071776e-8,1.0463989208300906e-7 +Bls12_381_G1_scalarMul/75/12,1.0144054372092705e-4,1.0140513600994764e-4,1.0147672782420337e-4,1.2263612386284166e-7,1.0454329302083638e-7,1.481476792576034e-7 +Bls12_381_G1_scalarMul/76/12,1.018001128432303e-4,1.0176748880424407e-4,1.0182963551882972e-4,1.0984013189400379e-7,9.170958012008086e-8,1.3092443904073018e-7 +Bls12_381_G1_scalarMul/77/12,1.0205676143534521e-4,1.0202745912765077e-4,1.0208658419962638e-4,1.0170198382029553e-7,8.495838205273478e-8,1.2799082499447642e-7 +Bls12_381_G1_scalarMul/78/12,1.0177993573370552e-4,1.0175161024021034e-4,1.018111371415936e-4,1.0373159502472528e-7,8.432760341841743e-8,1.2573485701533547e-7 +Bls12_381_G1_scalarMul/79/12,1.0255295267277907e-4,1.0251691664647218e-4,1.0257938492569784e-4,1.037520535414847e-7,7.988183724720871e-8,1.45490521783588e-7 +Bls12_381_G1_scalarMul/80/12,1.0210133121238101e-4,1.0207355318363866e-4,1.021345390381682e-4,1.0518005631847793e-7,8.304046757207844e-8,1.418831144220915e-7 +Bls12_381_G1_scalarMul/81/12,1.026294000149352e-4,1.026019151179643e-4,1.0265716555994782e-4,9.65617972313015e-8,7.959833191048516e-8,1.1875184954220875e-7 +Bls12_381_G1_scalarMul/82/12,1.0258983629454122e-4,1.0252284386426645e-4,1.0265150389224427e-4,2.071575176342942e-7,1.5817073215249695e-7,2.670536015805362e-7 +Bls12_381_G1_scalarMul/83/12,1.0251961999307737e-4,1.0248117811021868e-4,1.0255356186530285e-4,1.2419601520465672e-7,9.831055962536248e-8,1.6147767829785748e-7 +Bls12_381_G1_scalarMul/84/12,1.025556824980414e-4,1.0249397747276927e-4,1.0260651518597012e-4,1.885397561779849e-7,1.5588086420150723e-7,2.416210725270509e-7 +Bls12_381_G1_scalarMul/85/12,1.0261440852131437e-4,1.0254928622034603e-4,1.0266692613436593e-4,1.9226203213152157e-7,1.5985079929936697e-7,2.398608967608709e-7 +Bls12_381_G1_scalarMul/86/12,1.0242866356801683e-4,1.0239523542706495e-4,1.0246042517973924e-4,1.139963607697541e-7,9.336176763420079e-8,1.368943250974207e-7 +Bls12_381_G1_scalarMul/87/12,1.0310531661229711e-4,1.0307479355551715e-4,1.0313386774404618e-4,9.979562350277762e-8,8.238521202760142e-8,1.3241055462924956e-7 +Bls12_381_G1_scalarMul/88/12,1.0305035889175751e-4,1.0300310046409261e-4,1.0308432233358089e-4,1.3502259066188668e-7,1.1064910978930208e-7,1.726953049578412e-7 +Bls12_381_G1_scalarMul/89/12,1.0344246771527657e-4,1.0339634206385837e-4,1.0349289722956613e-4,1.5946811030423884e-7,1.3056304175488025e-7,2.1856759911232274e-7 +Bls12_381_G1_scalarMul/90/12,1.0273183309260452e-4,1.0268367970857903e-4,1.0279874751017598e-4,1.8531794968999298e-7,1.5062369126359036e-7,2.3583281143042519e-7 +Bls12_381_G1_scalarMul/91/12,1.0379597916382456e-4,1.0375805191746378e-4,1.0383198641651705e-4,1.2498232679766754e-7,1.0394554680698754e-7,1.5363948258992588e-7 +Bls12_381_G1_scalarMul/92/12,1.0337429474827536e-4,1.0331319712348459e-4,1.034272386905834e-4,1.9159194046868422e-7,1.6636108792507638e-7,2.2383266191119938e-7 +Bls12_381_G1_scalarMul/93/12,1.0382158306648501e-4,1.0375661153002572e-4,1.0386793824325025e-4,1.7950637129789923e-7,1.469480823947516e-7,2.219229704724255e-7 +Bls12_381_G1_scalarMul/94/12,1.0376166016685552e-4,1.0369711856248186e-4,1.0382393695557965e-4,2.1123264902778212e-7,1.7209498226346088e-7,2.661607765338529e-7 +Bls12_381_G1_scalarMul/95/12,1.0407051914368225e-4,1.0402356425021828e-4,1.0411137658098404e-4,1.4844915729566997e-7,1.1696699906841307e-7,1.9244662517902607e-7 +Bls12_381_G1_scalarMul/96/12,1.0362848815667061e-4,1.0357479009253974e-4,1.0369191831918343e-4,1.9216690021091357e-7,1.5972372504463958e-7,2.439185703942437e-7 +Bls12_381_G1_scalarMul/97/12,1.043779699593805e-4,1.043406053508929e-4,1.0441644230508448e-4,1.2581578194663724e-7,1.0238104959741323e-7,1.5877266321665526e-7 +Bls12_381_G1_scalarMul/98/12,1.0386201427932131e-4,1.0382575346751974e-4,1.0388993822613438e-4,1.0814937930961193e-7,8.205925399967219e-8,1.4997562811792188e-7 +Bls12_381_G1_scalarMul/99/12,1.0467655107746704e-4,1.0463021975569601e-4,1.0473307043661023e-4,1.6626687003394765e-7,1.391448546598276e-7,2.350414778731875e-7 +Bls12_381_G1_scalarMul/100/12,1.0447201329786753e-4,1.0442693716599808e-4,1.0451519344967312e-4,1.5486877631056925e-7,1.3207949396393725e-7,1.8671013896747395e-7 +Bls12_381_G1_neg/12,8.156429112467117e-7,8.143538619098072e-7,8.1701053569787e-7,4.469860899853362e-9,3.66499679806696e-9,5.62516349251556e-9 +Bls12_381_G1_neg/12,8.147753796875493e-7,8.134222787546951e-7,8.158149849941972e-7,3.930923071063901e-9,2.9915375867553444e-9,6.083820056405962e-9 +Bls12_381_G1_neg/12,8.157367508101365e-7,8.146029765211237e-7,8.173708582599511e-7,4.556478345591401e-9,3.4869869408566983e-9,5.9267744370051845e-9 +Bls12_381_G1_neg/12,8.092872192752368e-7,8.081109031481842e-7,8.104617550190949e-7,4.062030042661404e-9,3.4396323278581877e-9,5.1565299368042244e-9 +Bls12_381_G1_neg/12,8.085859921225597e-7,8.074113979830365e-7,8.097282573914455e-7,3.84777259466278e-9,3.0684715582652184e-9,4.828230574687568e-9 +Bls12_381_G1_neg/12,8.126148294782814e-7,8.112881142030427e-7,8.143453294476961e-7,4.9161724626146734e-9,4.0008942440973615e-9,6.444012072311858e-9 +Bls12_381_G1_neg/12,8.086947058046564e-7,8.076443891060352e-7,8.097475245640472e-7,3.598447400226824e-9,2.992856548572586e-9,4.666131465211499e-9 +Bls12_381_G1_neg/12,8.083724737705443e-7,8.074066901894512e-7,8.094509621863866e-7,3.4703064091894156e-9,2.7912842959420778e-9,4.479077993712481e-9 +Bls12_381_G1_neg/12,8.075586418967489e-7,8.062922770725522e-7,8.090981670753198e-7,4.484562757912428e-9,3.8059830473380284e-9,5.570515482894312e-9 +Bls12_381_G1_neg/12,8.161037694179728e-7,8.151028163924571e-7,8.169670419648616e-7,3.2457018031373656e-9,2.6387056722981797e-9,4.036370968015135e-9 +Bls12_381_G1_neg/12,8.084926488415436e-7,8.072735200309898e-7,8.096553087304893e-7,4.158420354386256e-9,3.410951106964798e-9,4.9919728826333155e-9 +Bls12_381_G1_neg/12,8.063324816839714e-7,8.052646468118519e-7,8.073124827762746e-7,3.3905602446677907e-9,2.7409122172451244e-9,5.057743348261691e-9 +Bls12_381_G1_neg/12,8.049219256891195e-7,8.039010820095588e-7,8.060279885906941e-7,3.6874920656991906e-9,3.1563683194185606e-9,4.318536125358409e-9 +Bls12_381_G1_neg/12,8.102281033156488e-7,8.092677408230598e-7,8.111883706632709e-7,3.193013687913031e-9,2.4569395918175268e-9,4.595539572808663e-9 +Bls12_381_G1_neg/12,8.117540780206479e-7,8.107570768945128e-7,8.126091807332974e-7,3.0549843916503027e-9,2.398109912449507e-9,3.999422325245733e-9 +Bls12_381_G1_neg/12,8.050682393251835e-7,8.040834539218492e-7,8.060562684440218e-7,3.3552224694744094e-9,2.726525794758651e-9,4.187369499804362e-9 +Bls12_381_G1_neg/12,8.119834861467007e-7,8.112329722438545e-7,8.127539873350899e-7,2.6819730985140293e-9,2.247470586205829e-9,3.3163126348481623e-9 +Bls12_381_G1_neg/12,8.047649064752403e-7,8.036252786112113e-7,8.058252588705237e-7,3.7802015461906185e-9,3.092785231187033e-9,4.734062666191977e-9 +Bls12_381_G1_neg/12,8.047475821912469e-7,8.033843401899458e-7,8.061514968477302e-7,4.552293519366623e-9,3.775205697336947e-9,5.4734341593480465e-9 +Bls12_381_G1_neg/12,8.075098461113549e-7,8.062930438933347e-7,8.087741851923101e-7,4.248137226396042e-9,3.577844858502652e-9,5.499527394536028e-9 +Bls12_381_G1_neg/12,8.104708990807595e-7,8.09470737564487e-7,8.115227266346574e-7,3.526300023784762e-9,2.955809606792336e-9,4.4056892740620695e-9 +Bls12_381_G1_neg/12,8.01962022361313e-7,8.008117504774414e-7,8.028884877901919e-7,3.5950294909017155e-9,2.7088862856293207e-9,5.3154673880092635e-9 +Bls12_381_G1_neg/12,8.059237716811338e-7,8.049009099571425e-7,8.069699160835925e-7,3.5791330078664867e-9,2.8698675867434598e-9,4.379488563392151e-9 +Bls12_381_G1_neg/12,8.060854499563242e-7,8.05138666192045e-7,8.068979606200782e-7,2.9911365941027993e-9,2.49512213063514e-9,3.7060783072317443e-9 +Bls12_381_G1_neg/12,8.073281181203186e-7,8.062574822185033e-7,8.083139157320164e-7,3.5835101787316456e-9,2.9891721562681726e-9,4.7936436687803975e-9 +Bls12_381_G1_neg/12,8.09123943946975e-7,8.077848885801442e-7,8.105846753255342e-7,4.535405792773423e-9,3.838849078211799e-9,5.48783542215094e-9 +Bls12_381_G1_neg/12,8.037511305431643e-7,8.02680646587e-7,8.048040621583691e-7,3.576721851861246e-9,2.8663670866216e-9,4.82458145476068e-9 +Bls12_381_G1_neg/12,8.035376652840513e-7,8.02302863342228e-7,8.04693911379332e-7,4.049608494213355e-9,3.2618518537045516e-9,5.194143841671602e-9 +Bls12_381_G1_neg/12,8.069279766133775e-7,8.059342366190057e-7,8.079785960007994e-7,3.3376943091765684e-9,2.7479810592236435e-9,4.009862473497961e-9 +Bls12_381_G1_neg/12,8.027933679877021e-7,8.017083313139702e-7,8.038701742602284e-7,3.665458422907671e-9,3.0055789991084655e-9,4.468643183851589e-9 +Bls12_381_G1_neg/12,8.020013891365182e-7,8.009133778678686e-7,8.031397499971327e-7,3.7900021606036665e-9,3.2576728498860663e-9,4.503123887149168e-9 +Bls12_381_G1_neg/12,8.062680392771589e-7,8.052719813188062e-7,8.071523644117138e-7,3.3442366772893913e-9,2.7156952963578698e-9,4.339351531128788e-9 +Bls12_381_G1_neg/12,8.055751654222172e-7,8.0464449945453e-7,8.068832934941208e-7,3.6351715154245974e-9,3.005718228578814e-9,4.631220517384793e-9 +Bls12_381_G1_neg/12,8.063016359649882e-7,8.051807997125427e-7,8.072073800205581e-7,3.362571275951304e-9,2.7576398790162476e-9,4.159309895380105e-9 +Bls12_381_G1_neg/12,8.10600635401639e-7,8.09577137023651e-7,8.115230280503346e-7,3.304257640952373e-9,2.7646554259829073e-9,4.002569575596954e-9 +Bls12_381_G1_neg/12,8.059704909367524e-7,8.050754089478926e-7,8.068003135793771e-7,3.0150024273913092e-9,2.4143220551905284e-9,4.115155586381239e-9 +Bls12_381_G1_neg/12,8.031169111599483e-7,8.022314887790545e-7,8.040464355966796e-7,3.0633483840303106e-9,2.5977270162335756e-9,3.761979293815092e-9 +Bls12_381_G1_neg/12,8.139633033395573e-7,8.128675468467645e-7,8.152356909967944e-7,4.143487695387396e-9,3.3918253020456834e-9,4.991561056598513e-9 +Bls12_381_G1_neg/12,8.043096192495809e-7,8.031161215208884e-7,8.053991013270609e-7,3.8450785392634215e-9,3.2305735911503783e-9,4.518662670525976e-9 +Bls12_381_G1_neg/12,8.037020300461705e-7,8.023913301519914e-7,8.049968326338809e-7,4.0697378155007205e-9,3.2839625529430907e-9,5.115083086428086e-9 +Bls12_381_G1_neg/12,8.069543517288452e-7,8.059931699932127e-7,8.078978620313471e-7,3.2837322110344803e-9,2.684974261621645e-9,4.430504248393944e-9 +Bls12_381_G1_neg/12,8.020206360486893e-7,8.011520173557398e-7,8.030684907898195e-7,3.4922153921984704e-9,2.898213209855185e-9,4.199299923747784e-9 +Bls12_381_G1_neg/12,8.064341081506055e-7,8.055443467719617e-7,8.073386842694343e-7,3.1266217328878027e-9,2.7572168455503634e-9,3.6741311490852164e-9 +Bls12_381_G1_neg/12,8.028804541051878e-7,8.020290839589454e-7,8.037164806260307e-7,3.0785620447447458e-9,2.483199772554332e-9,4.0265072561695815e-9 +Bls12_381_G1_neg/12,8.022127383653136e-7,8.015110329417131e-7,8.030457186154755e-7,2.5308791324606385e-9,2.081047452059302e-9,3.1496022084923468e-9 +Bls12_381_G1_neg/12,8.014493655976052e-7,8.006081211766025e-7,8.023593938843248e-7,2.8400616052833977e-9,2.420428504111562e-9,3.4451930739181254e-9 +Bls12_381_G1_neg/12,8.054358096708815e-7,8.046377093556299e-7,8.063078988400002e-7,2.982506622530298e-9,2.473617451491514e-9,3.801247955119191e-9 +Bls12_381_G1_neg/12,8.0329453989074e-7,8.021445484180233e-7,8.044724712858995e-7,3.799898082162646e-9,3.2556021486349875e-9,4.550937480867396e-9 +Bls12_381_G1_neg/12,8.059931234056185e-7,8.043075348500734e-7,8.079294985689286e-7,6.2984533526606555e-9,5.140052831392479e-9,7.404689547612846e-9 +Bls12_381_G1_neg/12,8.131920758035396e-7,8.118059392693072e-7,8.147309781493613e-7,4.726998818549158e-9,3.691795116587195e-9,6.00635581678624e-9 +Bls12_381_G1_neg/12,8.020970847093548e-7,8.010843392639773e-7,8.031608963254554e-7,3.4813213024558154e-9,2.780636377134572e-9,4.510778374987493e-9 +Bls12_381_G1_neg/12,8.047231391707578e-7,8.036265131054756e-7,8.056288423092486e-7,3.3665276988340145e-9,2.6483274237769304e-9,4.441307810700429e-9 +Bls12_381_G1_neg/12,8.017771909628779e-7,8.010038635032045e-7,8.028829187822496e-7,3.1680528255319885e-9,2.5066343130035532e-9,4.061075574044017e-9 +Bls12_381_G1_neg/12,8.037142403197725e-7,8.024986309867986e-7,8.048051630215218e-7,3.9030343895439925e-9,3.218641170096993e-9,5.179097039532651e-9 +Bls12_381_G1_neg/12,8.066156026228225e-7,8.054890157859804e-7,8.07575092287921e-7,3.6845520685197983e-9,2.9675375606081702e-9,4.699338744118903e-9 +Bls12_381_G1_neg/12,8.034608821182607e-7,8.022911367992128e-7,8.04747658401546e-7,4.163974191627908e-9,3.276922114144558e-9,5.873125668006375e-9 +Bls12_381_G1_neg/12,8.028459378094503e-7,8.018434789454814e-7,8.040029940141722e-7,3.6522592810255204e-9,2.9042896415903637e-9,4.9218966391184e-9 +Bls12_381_G1_neg/12,8.039184073461939e-7,8.028135381125409e-7,8.048664475159808e-7,3.417637444179153e-9,2.765316445858142e-9,4.342882762880639e-9 +Bls12_381_G1_neg/12,8.031621250911204e-7,8.021293631375503e-7,8.042820348767802e-7,3.6470163092211813e-9,2.932017404243053e-9,5.006481462856355e-9 +Bls12_381_G1_neg/12,8.044148348818888e-7,8.030439141661009e-7,8.059557185533871e-7,4.9521980363613415e-9,4.1128943149535275e-9,6.53647264557368e-9 +Bls12_381_G1_neg/12,8.033768178942615e-7,8.024545728729036e-7,8.042876284194189e-7,3.028753462693153e-9,2.5587765925251446e-9,3.750477941547944e-9 +Bls12_381_G1_neg/12,8.033472472098114e-7,8.020534186485424e-7,8.045809688549847e-7,4.162070335838831e-9,3.40367745755527e-9,5.3858153081925276e-9 +Bls12_381_G1_neg/12,8.049501435663526e-7,8.040011877229509e-7,8.058961432118948e-7,3.2413799493838503e-9,2.7003281897931096e-9,4.102065855856918e-9 +Bls12_381_G1_neg/12,8.071793372983143e-7,8.059704483169754e-7,8.08325399510016e-7,4.0714552679389965e-9,3.407602713046799e-9,4.886344514001532e-9 +Bls12_381_G1_neg/12,8.024343370305967e-7,8.014636979189437e-7,8.035652744142789e-7,3.5898835528603226e-9,2.7406908148922572e-9,4.701336893410733e-9 +Bls12_381_G1_neg/12,8.044979988780821e-7,8.03417784740802e-7,8.054121955416905e-7,3.233964336894018e-9,2.759855155591585e-9,3.829261488599915e-9 +Bls12_381_G1_neg/12,8.086862307599475e-7,8.072338896228134e-7,8.097940372447765e-7,3.995699010485687e-9,2.9537382042817338e-9,5.856922553849088e-9 +Bls12_381_G1_neg/12,8.058623494262236e-7,8.047618036469942e-7,8.067943388393323e-7,3.4771487979788575e-9,2.738770828883859e-9,4.53545851887896e-9 +Bls12_381_G1_neg/12,8.05971569717647e-7,8.050427075731058e-7,8.068067155359285e-7,3.0199384951121233e-9,2.5129000043759967e-9,4.021272544298499e-9 +Bls12_381_G1_neg/12,8.049603017940571e-7,8.037243876981872e-7,8.06279413355196e-7,4.174654395503428e-9,3.2979127870491097e-9,5.177415315951527e-9 +Bls12_381_G1_neg/12,8.020040017893906e-7,8.008061353837678e-7,8.030481218006523e-7,3.6451703428055096e-9,3.2415065504553473e-9,4.241237530682478e-9 +Bls12_381_G1_neg/12,8.049353113115838e-7,8.037397551315228e-7,8.060887387874016e-7,3.875953869089032e-9,3.3576854217078435e-9,4.563560824623275e-9 +Bls12_381_G1_neg/12,8.062365032321555e-7,8.05212293131392e-7,8.075294862828107e-7,3.898275344802008e-9,2.9117186172095844e-9,5.966382579845051e-9 +Bls12_381_G1_neg/12,8.06304423332636e-7,8.052748707242756e-7,8.07384242735452e-7,3.380501831547729e-9,2.7533975515165782e-9,4.123390517991006e-9 +Bls12_381_G1_neg/12,8.04219566679635e-7,8.030624490457788e-7,8.053263777935739e-7,3.942352961666166e-9,3.346513210070417e-9,4.8753134881558395e-9 +Bls12_381_G1_neg/12,8.07242552992206e-7,8.060221828913909e-7,8.084610779253189e-7,4.115834993444525e-9,3.2630306267794783e-9,5.298470830010898e-9 +Bls12_381_G1_neg/12,8.04647224995321e-7,8.036155962530183e-7,8.056796022704918e-7,3.469149849995349e-9,2.569137445859534e-9,5.252653392315032e-9 +Bls12_381_G1_neg/12,8.045204460632942e-7,8.032826770459516e-7,8.057706586549864e-7,4.181835397089962e-9,3.3972879930832122e-9,5.55096084284098e-9 +Bls12_381_G1_neg/12,8.05537490597907e-7,8.044766042975391e-7,8.06835175682738e-7,3.978630440323218e-9,3.0917517479210254e-9,5.59087068166657e-9 +Bls12_381_G1_neg/12,8.063974239095082e-7,8.049611704960333e-7,8.075661161683496e-7,4.558323135587891e-9,3.7089958058818487e-9,5.880191491302308e-9 +Bls12_381_G1_neg/12,8.061708591503289e-7,8.051374588161141e-7,8.07358293174304e-7,3.768899658899708e-9,2.978006436874597e-9,5.076528587289163e-9 +Bls12_381_G1_neg/12,8.028331738994922e-7,8.016594123829507e-7,8.042222549820398e-7,4.400489366488907e-9,3.5180433955116248e-9,6.036812074705287e-9 +Bls12_381_G1_neg/12,8.071785077008526e-7,8.060584009254785e-7,8.082318668706684e-7,3.778371876779299e-9,3.230268549373753e-9,4.564921045832655e-9 +Bls12_381_G1_neg/12,8.061590348838152e-7,8.050546094210041e-7,8.073209706112896e-7,3.896361883093372e-9,3.2442409861521188e-9,4.756021857992874e-9 +Bls12_381_G1_neg/12,8.020586548079648e-7,8.01118386690691e-7,8.03013826438463e-7,3.274022152788546e-9,2.718542657938107e-9,4.261324090932932e-9 +Bls12_381_G1_neg/12,8.044508047500618e-7,8.03535055684396e-7,8.054261259804667e-7,3.262421377492543e-9,2.7172677996404666e-9,4.036490591861028e-9 +Bls12_381_G1_neg/12,8.019695784957924e-7,8.00854986733008e-7,8.032843208080386e-7,4.063526835340791e-9,3.4778002856009124e-9,5.153561249204693e-9 +Bls12_381_G1_neg/12,8.018095420584255e-7,8.007866898358467e-7,8.029664169699124e-7,3.5809779069548104e-9,2.7115034518732285e-9,5.625292115123069e-9 +Bls12_381_G1_neg/12,8.049828260366784e-7,8.038943899365214e-7,8.060933908196234e-7,3.4739635738881466e-9,2.9351011570219435e-9,4.407592658545226e-9 +Bls12_381_G1_neg/12,8.042898940966579e-7,8.033341935890598e-7,8.05142439943667e-7,3.161725798468417e-9,2.67908656646756e-9,3.764629567067553e-9 +Bls12_381_G1_neg/12,8.060034965101089e-7,8.051005147745098e-7,8.071091440449212e-7,3.3164654220256835e-9,2.7435996192050884e-9,4.603812565148266e-9 +Bls12_381_G1_neg/12,8.05677014602663e-7,8.046127063070828e-7,8.067240937516318e-7,3.456879885730165e-9,2.9101976522387104e-9,4.27304950808498e-9 +Bls12_381_G1_neg/12,8.038536516276675e-7,8.022519268902628e-7,8.051850976802963e-7,5.1822652024430124e-9,4.351720654603373e-9,7.155492314497197e-9 +Bls12_381_G1_neg/12,8.04867139645409e-7,8.039023570618475e-7,8.058720945547456e-7,3.387700157924779e-9,2.8331491688981964e-9,4.0807881070616654e-9 +Bls12_381_G1_neg/12,8.027509636420336e-7,8.01823043542642e-7,8.038272284169047e-7,3.2108598120259332e-9,2.671644030185697e-9,3.959229355769428e-9 +Bls12_381_G1_neg/12,8.056185286593767e-7,8.043953913624395e-7,8.069455400950301e-7,4.283704179459562e-9,3.331056349798117e-9,5.612415637725784e-9 +Bls12_381_G1_neg/12,8.057440517741585e-7,8.046430187471466e-7,8.066925017589198e-7,3.4935913692858803e-9,2.8657664966072888e-9,4.312107217976934e-9 +Bls12_381_G1_neg/12,8.03891818762255e-7,8.029210153708733e-7,8.048984989245393e-7,3.3176263722715563e-9,2.6875124956293463e-9,4.2183807343999575e-9 +Bls12_381_G1_neg/12,8.076371931765139e-7,8.066750376740059e-7,8.086129654265686e-7,3.2128662764971605e-9,2.6182665877622306e-9,4.262377249629794e-9 +Bls12_381_G1_neg/12,8.066345121726489e-7,8.058454337244793e-7,8.076366579825099e-7,2.8058433275374474e-9,2.2247638734977466e-9,4.09252728898841e-9 +Bls12_381_G1_equal/12/12,1.154927805768159e-6,1.1530712214572588e-6,1.156636441644464e-6,5.960326246418537e-9,4.9280569704222095e-9,7.231846692683086e-9 +Bls12_381_G1_equal/12/12,1.1676208910200003e-6,1.1658322109153755e-6,1.169625803947254e-6,6.4249067005207496e-9,5.2420765979179826e-9,7.960372286584895e-9 +Bls12_381_G1_equal/12/12,1.1647859263235956e-6,1.1628152867200975e-6,1.1671924088808726e-6,6.923073352223601e-9,5.6735937948143316e-9,8.569111045429865e-9 +Bls12_381_G1_equal/12/12,1.164640202667436e-6,1.1628282010888987e-6,1.1665339615258103e-6,6.4898245239086465e-9,5.329641642236749e-9,8.31519763555442e-9 +Bls12_381_G1_equal/12/12,1.1619068394249066e-6,1.1599616496639875e-6,1.163905927919886e-6,6.642190382432468e-9,5.434009141636086e-9,8.35453634471334e-9 +Bls12_381_G1_equal/12/12,1.1529500156796201e-6,1.1508623520143958e-6,1.155708497124328e-6,7.96030525642092e-9,6.228696129394223e-9,1.0459240177815628e-8 +Bls12_381_G1_equal/12/12,1.1622223663312937e-6,1.1606659466970087e-6,1.1637210957332382e-6,5.291101441433484e-9,4.4077127797370826e-9,6.376396795715426e-9 +Bls12_381_G1_equal/12/12,1.1684500487549683e-6,1.1667163145300149e-6,1.1705111214630065e-6,6.380275964029377e-9,5.129088841160425e-9,7.785419907965082e-9 +Bls12_381_G1_equal/12/12,1.1587121647277687e-6,1.156633344124109e-6,1.1610652767527087e-6,7.198661797729005e-9,5.709843505424956e-9,9.244237898295531e-9 +Bls12_381_G1_equal/12/12,1.1578031588162568e-6,1.1559764678803706e-6,1.160003549559926e-6,6.615614707063821e-9,5.398775996299203e-9,9.739468317162073e-9 +Bls12_381_G1_equal/12/12,1.1678986558530212e-6,1.1657032818433135e-6,1.1702150203136517e-6,7.37102172927301e-9,5.8473363498472105e-9,1.0484296996143087e-8 +Bls12_381_G1_equal/12/12,1.1613407258103385e-6,1.1590788026406149e-6,1.1638739346465924e-6,7.802055085271876e-9,6.253635028640755e-9,1.0069815917315156e-8 +Bls12_381_G1_equal/12/12,1.1686020376704814e-6,1.1664062364455981e-6,1.170749886457434e-6,7.197240643740192e-9,5.803075952595671e-9,9.050872834202279e-9 +Bls12_381_G1_equal/12/12,1.1626205145442961e-6,1.159899689947674e-6,1.1656171295303973e-6,9.917889976523108e-9,8.172218915006291e-9,1.224594384371182e-8 +Bls12_381_G1_equal/12/12,1.1698912288719014e-6,1.1672198697540105e-6,1.172375709984483e-6,8.733072356074196e-9,7.1820424160632326e-9,1.0845550809421044e-8 +Bls12_381_G1_equal/12/12,1.173245335169279e-6,1.1703687521636089e-6,1.1758786413359987e-6,9.45482053872988e-9,7.82194913792976e-9,1.1791974195475233e-8 +Bls12_381_G1_equal/12/12,1.16648044708409e-6,1.1643371122200144e-6,1.168386132398626e-6,6.936234324831964e-9,6.034718593474387e-9,8.079955697217491e-9 +Bls12_381_G1_equal/12/12,1.1640454729938085e-6,1.1620080734425328e-6,1.1665227444552037e-6,7.922188299730783e-9,6.628272513810838e-9,9.571238996137365e-9 +Bls12_381_G1_equal/12/12,1.1656401919847117e-6,1.1633756312071787e-6,1.1675356323946798e-6,6.5254083617829165e-9,5.455664003384555e-9,7.944422911516464e-9 +Bls12_381_G1_equal/12/12,1.16065275114402e-6,1.158230448725281e-6,1.1629052822226886e-6,7.734910812515028e-9,6.557861789157681e-9,9.769108526146957e-9 +Bls12_381_G1_equal/12/12,1.169978289353373e-6,1.1673394244415745e-6,1.1722139886154051e-6,8.23911741864144e-9,6.710875915219986e-9,1.0360751554071807e-8 +Bls12_381_G1_equal/12/12,1.1641501165843196e-6,1.1626468263803747e-6,1.1658005963529963e-6,5.367187929806985e-9,4.3274205226865744e-9,6.723218609386528e-9 +Bls12_381_G1_equal/12/12,1.1662695253884155e-6,1.1633643785631282e-6,1.1688058268052714e-6,8.629718774788403e-9,7.120032116858898e-9,1.1155548667144423e-8 +Bls12_381_G1_equal/12/12,1.166978422142725e-6,1.1646569508219052e-6,1.1693198571898992e-6,7.886256449264903e-9,6.500438342784101e-9,1.0051408889014133e-8 +Bls12_381_G1_equal/12/12,1.1682921365759788e-6,1.1659127696312638e-6,1.1706214114606058e-6,7.631106669449227e-9,6.291659817214332e-9,9.432861282692698e-9 +Bls12_381_G1_equal/12/12,1.1511313190266075e-6,1.148832176112509e-6,1.1534741982989574e-6,7.729882578245495e-9,6.500070901332456e-9,9.938235881111117e-9 +Bls12_381_G1_equal/12/12,1.1642678606664137e-6,1.1620337254959466e-6,1.166612320638814e-6,7.434241520956724e-9,6.286030755879255e-9,9.284427284515288e-9 +Bls12_381_G1_equal/12/12,1.1588852476407834e-6,1.1558039802139775e-6,1.1612058740091305e-6,8.9482807672132e-9,7.495093242627904e-9,1.117296125445184e-8 +Bls12_381_G1_equal/12/12,1.1688947722847412e-6,1.166613879547576e-6,1.1713052320040815e-6,8.02714650032916e-9,6.66093494696639e-9,9.799883081953545e-9 +Bls12_381_G1_equal/12/12,1.1602937921606106e-6,1.1581808689786386e-6,1.1635089376491136e-6,8.64292693188286e-9,6.863584567293903e-9,1.2376566544080577e-8 +Bls12_381_G1_equal/12/12,1.1610370883870825e-6,1.1587781690626433e-6,1.1636253899843483e-6,8.122389093446915e-9,6.816844889787719e-9,1.011479879138313e-8 +Bls12_381_G1_equal/12/12,1.1631641858086055e-6,1.1609130285812662e-6,1.1656191378591127e-6,7.989311661720993e-9,6.691330359230364e-9,1.0025803255400656e-8 +Bls12_381_G1_equal/12/12,1.1598742016157726e-6,1.1576755125300332e-6,1.1623299969103394e-6,7.862708786912877e-9,6.3507644367701836e-9,9.958456169891872e-9 +Bls12_381_G1_equal/12/12,1.1628680193952576e-6,1.160047814725434e-6,1.1653369430833266e-6,9.321520723162081e-9,7.801705968147323e-9,1.2330085382813898e-8 +Bls12_381_G1_equal/12/12,1.1696781735314036e-6,1.1674504102127837e-6,1.1722500611341154e-6,8.027663588916385e-9,6.923030582715563e-9,9.816902693908649e-9 +Bls12_381_G1_equal/12/12,1.1760573723937407e-6,1.1740547583601763e-6,1.1780155187055896e-6,6.6005752449186875e-9,5.643988639052101e-9,8.043821973338634e-9 +Bls12_381_G1_equal/12/12,1.1705479078132174e-6,1.1678037057685986e-6,1.1736002674562307e-6,9.475199923214794e-9,7.375232116389576e-9,1.2612108807698349e-8 +Bls12_381_G1_equal/12/12,1.162878822385545e-6,1.1606461335673896e-6,1.1651270377097757e-6,7.181568293338433e-9,5.6708720249782825e-9,9.739951029241285e-9 +Bls12_381_G1_equal/12/12,1.167781405681273e-6,1.1654022759327772e-6,1.1700270888315537e-6,7.77716375288873e-9,6.270454966965426e-9,1.0514600526274726e-8 +Bls12_381_G1_equal/12/12,1.1723986306685177e-6,1.170370999513716e-6,1.1745523096384098e-6,7.0368054794105634e-9,6.009157446193197e-9,8.940938927977378e-9 +Bls12_381_G1_equal/12/12,1.1726827121611637e-6,1.1707511662698462e-6,1.175293699917737e-6,7.464930766513413e-9,5.976316332766813e-9,9.380846815367109e-9 +Bls12_381_G1_equal/12/12,1.1609466852418608e-6,1.1581053894583445e-6,1.16382375000014e-6,9.364684860966341e-9,7.804855121420028e-9,1.1207205091175043e-8 +Bls12_381_G1_equal/12/12,1.1615609751962192e-6,1.1590914916106656e-6,1.1648182981101108e-6,9.769775535538485e-9,7.6157266141978e-9,1.2481615455285566e-8 +Bls12_381_G1_equal/12/12,1.1654592565148829e-6,1.1638630343969878e-6,1.1674017301227427e-6,6.006510240508135e-9,4.7618478219691116e-9,8.317767270970797e-9 +Bls12_381_G1_equal/12/12,1.1667087321502773e-6,1.1645473546345105e-6,1.1688242062681622e-6,7.017491333584e-9,5.4980863365752045e-9,9.528993974968645e-9 +Bls12_381_G1_equal/12/12,1.1620325279001978e-6,1.1600911866826473e-6,1.163711061665499e-6,5.9431372993054245e-9,4.885315696199619e-9,7.436588885250192e-9 +Bls12_381_G1_equal/12/12,1.1649879500192988e-6,1.1625277118973155e-6,1.167202100356403e-6,7.853597523984326e-9,6.675497067815562e-9,1.0127645115295598e-8 +Bls12_381_G1_equal/12/12,1.1658838838276128e-6,1.1638902437743176e-6,1.1679555738860636e-6,6.841567589006306e-9,5.63931216550458e-9,8.910102690244093e-9 +Bls12_381_G1_equal/12/12,1.1618325300242924e-6,1.1592747694873551e-6,1.1646307935738477e-6,8.625384085687346e-9,6.6353785565713555e-9,1.1856763397647822e-8 +Bls12_381_G1_equal/12/12,1.1707297888547095e-6,1.1687509865079064e-6,1.1725964922616508e-6,6.543092823871322e-9,5.53890468915535e-9,8.112521411944532e-9 +Bls12_381_G1_equal/12/12,1.1586602336686021e-6,1.156435756206676e-6,1.1615358826780602e-6,8.352024770968975e-9,7.034897455747533e-9,1.0069057067271144e-8 +Bls12_381_G1_equal/12/12,1.1631945804453242e-6,1.1610133933564755e-6,1.1656035090990309e-6,7.313226797020486e-9,5.966190444636404e-9,9.178065477380724e-9 +Bls12_381_G1_equal/12/12,1.1703418489039515e-6,1.1685838071466946e-6,1.1720915932740616e-6,6.1914616071941955e-9,4.967778756500408e-9,7.543702969653342e-9 +Bls12_381_G1_equal/12/12,1.1686825005532059e-6,1.1665066294921844e-6,1.170762355669256e-6,7.591262976203457e-9,6.292534122375086e-9,9.380720755761787e-9 +Bls12_381_G1_equal/12/12,1.1653979135840953e-6,1.1630751386008267e-6,1.167952180544567e-6,8.32869844922727e-9,6.981240653827434e-9,1.0120308609371246e-8 +Bls12_381_G1_equal/12/12,1.1607946738050676e-6,1.158092895751898e-6,1.1635853314004494e-6,9.345872018301517e-9,7.53044114294033e-9,1.2699440309246398e-8 +Bls12_381_G1_equal/12/12,1.1693071990794796e-6,1.167737774673308e-6,1.1708625941411167e-6,5.401897919881394e-9,4.419561906703655e-9,7.246793555229654e-9 +Bls12_381_G1_equal/12/12,1.16181569885516e-6,1.1592107247860519e-6,1.1651312828738564e-6,9.43832740669913e-9,7.61387753554038e-9,1.1614848144350034e-8 +Bls12_381_G1_equal/12/12,1.162102567553476e-6,1.1599007616978345e-6,1.1650626327520524e-6,8.509273763005235e-9,6.822272931962736e-9,1.0678918873977392e-8 +Bls12_381_G1_equal/12/12,1.16588930082007e-6,1.1636941876995382e-6,1.1679803988396e-6,7.226423228547577e-9,6.209968042377277e-9,8.461391088524108e-9 +Bls12_381_G1_equal/12/12,1.1689502777984013e-6,1.1668240543687007e-6,1.1713064935523716e-6,7.546858207850039e-9,6.269985726632893e-9,9.42438048207385e-9 +Bls12_381_G1_equal/12/12,1.1646324931550977e-6,1.163037020598373e-6,1.166622263377801e-6,6.190891856412206e-9,4.939720507401432e-9,8.453329282322982e-9 +Bls12_381_G1_equal/12/12,1.1672280694150638e-6,1.1653406104882417e-6,1.1689378355684327e-6,5.978914438211458e-9,4.8045932504236745e-9,7.783297639569973e-9 +Bls12_381_G1_equal/12/12,1.160346367412557e-6,1.1578481785266235e-6,1.1634540650234496e-6,9.538638100467098e-9,7.92020378466093e-9,1.1452477555886493e-8 +Bls12_381_G1_equal/12/12,1.1704246266988467e-6,1.1685031076700402e-6,1.172512900559581e-6,6.827478490841802e-9,5.613149055937062e-9,8.450629949194491e-9 +Bls12_381_G1_equal/12/12,1.1657136267184851e-6,1.1638045450215164e-6,1.1677341307313778e-6,6.992138828313147e-9,5.982896813552912e-9,8.826172673347871e-9 +Bls12_381_G1_equal/12/12,1.1728559825702942e-6,1.17009442154606e-6,1.1757598494016907e-6,9.551568317610356e-9,8.344197792843538e-9,1.1086454003717781e-8 +Bls12_381_G1_equal/12/12,1.1608449052314055e-6,1.1579425912947903e-6,1.1640316218240814e-6,9.775152165409292e-9,8.095011129874148e-9,1.2018517177037096e-8 +Bls12_381_G1_equal/12/12,1.1730897956567406e-6,1.1704153608698394e-6,1.1759306242376518e-6,9.419372939376095e-9,7.52457332078602e-9,1.2397859008522598e-8 +Bls12_381_G1_equal/12/12,1.168171239705685e-6,1.1659378650480418e-6,1.1705819453986092e-6,7.64213402087281e-9,6.37485234262489e-9,9.834795910626433e-9 +Bls12_381_G1_equal/12/12,1.1642564964491417e-6,1.162753282183223e-6,1.1660931326372026e-6,5.832672661914752e-9,4.73478251662877e-9,7.28946432454763e-9 +Bls12_381_G1_equal/12/12,1.1641392940557558e-6,1.1615568306710141e-6,1.1660847966503384e-6,7.838808817939106e-9,6.491795208250302e-9,1.0691907157085907e-8 +Bls12_381_G1_equal/12/12,1.162738949511105e-6,1.1608385710217353e-6,1.164666743526607e-6,6.356478015665818e-9,5.263486774921314e-9,7.718247084594068e-9 +Bls12_381_G1_equal/12/12,1.1665288033467047e-6,1.1634184524549602e-6,1.1691954695903281e-6,9.052529352399163e-9,7.31580469619972e-9,1.1675390354163718e-8 +Bls12_381_G1_equal/12/12,1.1574770931949452e-6,1.1552228902027574e-6,1.1596208806827403e-6,7.55963979170936e-9,6.019786600049276e-9,9.806072722441041e-9 +Bls12_381_G1_equal/12/12,1.1638433520667685e-6,1.1617351355076888e-6,1.1661902832567295e-6,7.579298526885384e-9,6.187609789927892e-9,9.262253336304832e-9 +Bls12_381_G1_equal/12/12,1.1649984846696923e-6,1.1630972419442427e-6,1.1671888836209582e-6,6.838015868942815e-9,5.6296550855007934e-9,9.097613282259814e-9 +Bls12_381_G1_equal/12/12,1.156779799114941e-6,1.1543376214598333e-6,1.1595183494998801e-6,8.862973328863719e-9,7.332457638281974e-9,1.0579347130541761e-8 +Bls12_381_G1_equal/12/12,1.1675035673218094e-6,1.1655654785452936e-6,1.16973890214319e-6,7.073203513135024e-9,5.766050503650985e-9,8.474068839991674e-9 +Bls12_381_G1_equal/12/12,1.159113945135997e-6,1.1564068166999e-6,1.1617673653112102e-6,8.52768445872633e-9,7.330354567188256e-9,1.0105354852505191e-8 +Bls12_381_G1_equal/12/12,1.159329833192062e-6,1.1572108562007658e-6,1.161580522108958e-6,7.468489744082225e-9,6.512474206942642e-9,8.784268408480296e-9 +Bls12_381_G1_equal/12/12,1.1672172325088072e-6,1.165200520805376e-6,1.1695794030010003e-6,7.051447160160514e-9,6.022271088309803e-9,8.456469824498567e-9 +Bls12_381_G1_equal/12/12,1.1625762088988997e-6,1.1600871314704302e-6,1.165451145157099e-6,8.372727313515245e-9,6.722511708067096e-9,1.0597714470227568e-8 +Bls12_381_G1_equal/12/12,1.1702353749280987e-6,1.1679127556542881e-6,1.172301476776012e-6,7.613069597764022e-9,6.275180349202931e-9,1.0131849920776042e-8 +Bls12_381_G1_equal/12/12,1.163160397200432e-6,1.1608962852517074e-6,1.165657443952629e-6,7.730279341753485e-9,5.651505479962739e-9,1.2805719216889133e-8 +Bls12_381_G1_equal/12/12,1.1630952521857802e-6,1.1613725113209335e-6,1.1650905606838964e-6,6.380453667680167e-9,5.289711749610165e-9,8.247739205720568e-9 +Bls12_381_G1_equal/12/12,1.1652726765719178e-6,1.1630793820866325e-6,1.1681433352908091e-6,8.28085296759646e-9,6.208735729383866e-9,1.2642395912862757e-8 +Bls12_381_G1_equal/12/12,1.155875341016596e-6,1.1532274539853276e-6,1.1591142769616104e-6,9.566432714192873e-9,7.521332588017111e-9,1.2883394300983187e-8 +Bls12_381_G1_equal/12/12,1.1635224340312056e-6,1.1610428573628432e-6,1.1667799994109768e-6,9.592263466000468e-9,7.65241011200933e-9,1.468198041877802e-8 +Bls12_381_G1_equal/12/12,1.1654013014049923e-6,1.1634267279097647e-6,1.1674565403071455e-6,6.6170849709485785e-9,5.5775091093485275e-9,8.116586365621602e-9 +Bls12_381_G1_equal/12/12,1.1633605478093003e-6,1.1607068106900632e-6,1.165576621029649e-6,8.193354344783864e-9,6.848133359499523e-9,9.945989364760731e-9 +Bls12_381_G1_equal/12/12,1.1689513056232655e-6,1.1660963903335975e-6,1.1723234435747684e-6,1.0767779494970514e-8,8.906691364578057e-9,1.3464981051995978e-8 +Bls12_381_G1_equal/12/12,1.167638365606414e-6,1.1655915086259e-6,1.1707144326092493e-6,8.589155216731715e-9,5.88616652793942e-9,1.230532763280239e-8 +Bls12_381_G1_equal/12/12,1.1709088262360714e-6,1.168406446927834e-6,1.1732717560863862e-6,8.060414095915813e-9,6.940806353760589e-9,9.612217175902409e-9 +Bls12_381_G1_equal/12/12,1.1597891480748162e-6,1.1579674529350855e-6,1.1619625386030655e-6,6.862755464806439e-9,5.299243068409849e-9,9.810043885882617e-9 +Bls12_381_G1_equal/12/12,1.1685676954225925e-6,1.1663637253917203e-6,1.1708282080267496e-6,7.2971499032945294e-9,5.9664633217550725e-9,9.017787194506217e-9 +Bls12_381_G1_equal/12/12,1.1519400434505229e-6,1.1504300177155507e-6,1.1537326802459983e-6,5.568251425350194e-9,4.7759205718441835e-9,6.9660291086104625e-9 +Bls12_381_G1_equal/12/12,1.1514899664957842e-6,1.1495216630354175e-6,1.1537526679385026e-6,7.343788111049826e-9,6.158500908142109e-9,9.016109851826907e-9 +Bls12_381_G1_equal/12/12,1.1597651146930559e-6,1.15825642982986e-6,1.1614274985117098e-6,5.076694922475621e-9,4.133563749572142e-9,6.330294733466383e-9 +Bls12_381_G1_equal/12/12,1.1632693745829944e-6,1.1612443694460966e-6,1.1655462221212484e-6,7.226626305922521e-9,5.865888151278706e-9,1.0088489917216848e-8 +Bls12_381_G1_hashToGroup/341,7.478688107261439e-5,7.477526088802013e-5,7.479874718264946e-5,3.894698713759035e-8,3.152661007210192e-8,5.2550865294653015e-8 +Bls12_381_G1_hashToGroup/320,7.431497475163856e-5,7.430455505908122e-5,7.43268819796814e-5,3.6302977400941855e-8,2.920663628600685e-8,4.7435862478044694e-8 +Bls12_381_G1_hashToGroup/41,6.778623598855542e-5,6.777871037510763e-5,6.779354694781875e-5,2.5798636874943597e-8,2.145177335090308e-8,3.2043248415674805e-8 +Bls12_381_G1_hashToGroup/316,7.39408645134623e-5,7.392479391149158e-5,7.395987707086903e-5,6.146058918929355e-8,5.40347554950643e-8,7.064521056298019e-8 +Bls12_381_G1_hashToGroup/361,7.510117329340047e-5,7.508815423675033e-5,7.511479814097388e-5,4.857257962285861e-8,4.0053507159064503e-8,6.075953374022104e-8 +Bls12_381_G1_hashToGroup/301,7.383340617889631e-5,7.38230789504494e-5,7.384244990784448e-5,3.405706547345474e-8,2.85722231447911e-8,4.619832521949446e-8 +Bls12_381_G1_hashToGroup/252,7.273469362121748e-5,7.272010349986876e-5,7.27488395642246e-5,4.687190349408472e-8,4.1175849452644923e-8,5.686440294983542e-8 +Bls12_381_G1_hashToGroup/302,7.384046761787072e-5,7.382994228090017e-5,7.385169255918686e-5,3.6603438125649914e-8,3.0539562805930204e-8,4.4470999187230464e-8 +Bls12_381_G1_hashToGroup/285,7.344503456564348e-5,7.34303991700494e-5,7.345650408011109e-5,4.4133154741926804e-8,3.549625842584495e-8,5.72534462781022e-8 +Bls12_381_G1_hashToGroup/170,7.072312067997019e-5,7.071340254354941e-5,7.073414172041206e-5,3.589306871612596e-8,2.939496958330914e-8,4.5887961439432975e-8 +Bls12_381_G1_hashToGroup/161,7.054995374039637e-5,7.053915773006806e-5,7.055968964975262e-5,3.3582709053004986e-8,2.642913199904048e-8,4.410252660173796e-8 +Bls12_381_G1_hashToGroup/364,7.523154895822978e-5,7.521635258400932e-5,7.524487687965988e-5,4.877180228979344e-8,3.946987856450821e-8,6.198039306077676e-8 +Bls12_381_G1_hashToGroup/25,6.746650178695241e-5,6.745640895879523e-5,6.747510522926335e-5,3.133186045952993e-8,2.5257933467003644e-8,3.9603194321478666e-8 +Bls12_381_G1_hashToGroup/8,6.718754224732666e-5,6.717635468727393e-5,6.719774586270046e-5,3.3528423352959867e-8,2.8269823612387434e-8,4.1222312139386e-8 +Bls12_381_G1_hashToGroup/96,6.929278744533757e-5,6.928095463167522e-5,6.93053476255201e-5,4.1699273622011974e-8,3.5903737642722917e-8,4.9429972949551606e-8 +Bls12_381_G1_hashToGroup/347,7.492857817059573e-5,7.491437408120471e-5,7.494261442125106e-5,4.8279892742316234e-8,3.9279278776853766e-8,6.095477545430155e-8 +Bls12_381_G1_hashToGroup/25,6.748573076595855e-5,6.747772796139486e-5,6.749464667750271e-5,2.925670217462824e-8,2.328661715459499e-8,4.2093050002758794e-8 +Bls12_381_G1_hashToGroup/360,7.508896244932875e-5,7.50732012625767e-5,7.510211693260492e-5,4.7902446182887904e-8,3.7818452275959887e-8,6.51907440165729e-8 +Bls12_381_G1_hashToGroup/299,7.37893507951569e-5,7.376658980097444e-5,7.381210768392244e-5,7.98722302047326e-8,6.698938689268498e-8,9.710467232623766e-8 +Bls12_381_G1_hashToGroup/106,6.926617531134481e-5,6.925707669056504e-5,6.927658292312083e-5,3.054093180863946e-8,2.5226085349815155e-8,3.747828540486534e-8 +Bls12_381_G1_hashToGroup/59,6.816988684179132e-5,6.815667066332841e-5,6.818457504963681e-5,4.577392292059013e-8,3.8347467228799493e-8,5.696897649460442e-8 +Bls12_381_G1_hashToGroup/318,7.404057790712365e-5,7.402171082936905e-5,7.405533514980008e-5,5.479234988360297e-8,4.443846299894265e-8,7.194346972566871e-8 +Bls12_381_G1_hashToGroup/32,6.77107559799762e-5,6.770273773242463e-5,6.772198816515984e-5,3.1428842780095645e-8,2.54011423190396e-8,3.949957700329341e-8 +Bls12_381_G1_hashToGroup/111,6.94856130461817e-5,6.947703614683467e-5,6.949772463268353e-5,3.22515137093038e-8,2.5810898665629495e-8,4.547790977322323e-8 +Bls12_381_G1_hashToGroup/226,7.193429358933227e-5,7.192403324040209e-5,7.19447108673989e-5,3.5208680721102036e-8,3.017432728899318e-8,4.0574199050373344e-8 +Bls12_381_G1_hashToGroup/118,6.944790716141012e-5,6.944022250323596e-5,6.945792393162244e-5,3.019203319057681e-8,2.3919941241940753e-8,3.911063749646863e-8 +Bls12_381_G1_hashToGroup/370,7.520075288947936e-5,7.518584002216436e-5,7.521648806684449e-5,5.209172360729497e-8,4.58670189752077e-8,5.983807013484508e-8 +Bls12_381_G1_hashToGroup/303,7.377640548596199e-5,7.376147894654344e-5,7.379149920194553e-5,4.940635724668137e-8,4.231123286698074e-8,5.8224790533590324e-8 +Bls12_381_G1_hashToGroup/57,6.812077106411847e-5,6.811130433507633e-5,6.812951363680642e-5,3.08654811340411e-8,2.588546129776885e-8,3.747504661460811e-8 +Bls12_381_G1_hashToGroup/336,7.465049174863992e-5,7.464014110854484e-5,7.466284544463829e-5,3.994596040501427e-8,3.0829575900499585e-8,4.9849502026073586e-8 +Bls12_381_G1_hashToGroup/178,7.089865943592282e-5,7.088721509126963e-5,7.091136005517467e-5,4.277154079180878e-8,3.6825046204096065e-8,4.9754764837288166e-8 +Bls12_381_G1_hashToGroup/23,6.727754242400014e-5,6.726774930916875e-5,6.728640434734373e-5,3.101988087465654e-8,2.5670259400546764e-8,4.016392276339897e-8 +Bls12_381_G1_hashToGroup/153,7.026284396687642e-5,7.02529838849379e-5,7.02710711937194e-5,2.9553349925789755e-8,2.5201208504002158e-8,3.642034419317332e-8 +Bls12_381_G1_hashToGroup/194,7.12480985283083e-5,7.123807448767975e-5,7.125712314220901e-5,3.214772090878608e-8,2.495334312257467e-8,4.198747032710956e-8 +Bls12_381_G1_hashToGroup/249,7.269117075888796e-5,7.267353417449911e-5,7.270907489540842e-5,5.99359686479252e-8,4.672735430364673e-8,8.017111840274478e-8 +Bls12_381_G1_hashToGroup/306,7.396455221755186e-5,7.395177141503746e-5,7.397685221474665e-5,4.2502808580700694e-8,3.44154572447447e-8,5.584012246090287e-8 +Bls12_381_G1_hashToGroup/369,7.535505024663606e-5,7.533594665915751e-5,7.537118328994267e-5,6.265839080036247e-8,5.2494558548775824e-8,7.541452198658662e-8 +Bls12_381_G1_hashToGroup/51,6.793370264215541e-5,6.791878063099634e-5,6.794610747859409e-5,4.684071592695502e-8,3.6865690463761406e-8,6.148936275232028e-8 +Bls12_381_G1_hashToGroup/178,7.083224455385705e-5,7.082005007724051e-5,7.08430294905465e-5,4.0375386763021414e-8,3.460961762207956e-8,4.7767148680921575e-8 +Bls12_381_G1_hashToGroup/358,7.502106204475312e-5,7.50109106021973e-5,7.503375000353532e-5,3.7526961855239816e-8,3.0658829248042235e-8,5.3402105049476956e-8 +Bls12_381_G1_hashToGroup/16,6.725578261689621e-5,6.724618300676916e-5,6.726462874853544e-5,3.091392380536304e-8,2.575615201716793e-8,3.826463451208514e-8 +Bls12_381_G1_hashToGroup/177,7.07815208512785e-5,7.075922897922617e-5,7.08016654715307e-5,7.55704842518691e-8,6.890757211361438e-8,8.281317764324899e-8 +Bls12_381_G1_hashToGroup/315,7.41541623674564e-5,7.413296531662058e-5,7.417222782781215e-5,6.420125567752117e-8,5.1657921966432256e-8,8.366844313388756e-8 +Bls12_381_G1_hashToGroup/300,7.380787300591938e-5,7.379171857409714e-5,7.382162767784725e-5,5.194136625510015e-8,4.423500169601833e-8,6.427762156931049e-8 +Bls12_381_G1_hashToGroup/49,6.794441264984246e-5,6.7933385476354e-5,6.79558365419261e-5,3.7686385463509906e-8,3.2233292048408014e-8,4.581097718054128e-8 +Bls12_381_G1_hashToGroup/374,7.528653877987073e-5,7.52770334186605e-5,7.529661347677367e-5,3.5706539166423815e-8,2.931676110520602e-8,4.297546274223092e-8 +Bls12_381_G1_hashToGroup/133,6.975565974345146e-5,6.974628277984712e-5,6.976737947852588e-5,3.4543164416364074e-8,2.7727055639314513e-8,4.742872189820117e-8 +Bls12_381_G1_hashToGroup/31,6.768365396593077e-5,6.767512182212601e-5,6.769567020068189e-5,3.300174693688858e-8,2.593409941572785e-8,4.2668490817083754e-8 +Bls12_381_G1_hashToGroup/354,7.498222572257703e-5,7.496741675407892e-5,7.49923380086389e-5,4.152176985509426e-8,3.0923101247315284e-8,5.982691156683883e-8 +Bls12_381_G1_hashToGroup/161,7.052379766375489e-5,7.051246841450821e-5,7.053529697870686e-5,3.6365977327413636e-8,2.874748631403283e-8,4.577869604145039e-8 +Bls12_381_G1_hashToGroup/200,7.147247135171579e-5,7.146378891004874e-5,7.14818984521327e-5,3.0713516054250506e-8,2.5924083759094375e-8,3.911125489932147e-8 +Bls12_381_G1_hashToGroup/159,7.033178309232474e-5,7.0321108832108e-5,7.034481909674539e-5,3.9385391772967196e-8,3.1448401619685284e-8,5.000146953637151e-8 +Bls12_381_G1_hashToGroup/281,7.342784986444608e-5,7.341276250711331e-5,7.344189826827845e-5,4.8348703923265416e-8,4.0249483821527995e-8,5.990634864481451e-8 +Bls12_381_G1_hashToGroup/99,6.920485700191634e-5,6.919547757205648e-5,6.92140644661419e-5,3.1572078230780656e-8,2.6127354231432397e-8,4.092423551367727e-8 +Bls12_381_G1_hashToGroup/342,7.477249804380049e-5,7.476054252452203e-5,7.478574050161038e-5,4.182001531786371e-8,3.2871411370479213e-8,5.3569003927414083e-8 +Bls12_381_G1_hashToGroup/303,7.383039427898403e-5,7.381692882977924e-5,7.384198076493597e-5,4.385312961628997e-8,3.6814139337395546e-8,5.1823872444807904e-8 +Bls12_381_G1_hashToGroup/305,7.397893971528448e-5,7.396701282475888e-5,7.399211158148469e-5,4.147031709453382e-8,3.338665334224711e-8,5.2131100519172994e-8 +Bls12_381_G1_hashToGroup/231,7.225131943815432e-5,7.22390770691611e-5,7.226325255145402e-5,4.127814652082983e-8,3.471364990023569e-8,5.050496014599397e-8 +Bls12_381_G1_hashToGroup/33,6.76042434385358e-5,6.759706546234083e-5,6.76124988970323e-5,2.6607139321935964e-8,2.1147462614624212e-8,3.600867580540578e-8 +Bls12_381_G1_hashToGroup/71,6.852675882389321e-5,6.851571433192889e-5,6.853822786812675e-5,4.012464450354607e-8,3.301804898621277e-8,4.825979874031285e-8 +Bls12_381_G1_hashToGroup/76,6.852336941831097e-5,6.851348326004538e-5,6.853315571048489e-5,3.3725667316458137e-8,2.5457914852054084e-8,4.834174577981261e-8 +Bls12_381_G1_hashToGroup/177,7.100310919688669e-5,7.099083589994712e-5,7.101936777038711e-5,4.7377902569976846e-8,3.87036963998955e-8,6.221653617905611e-8 +Bls12_381_G1_hashToGroup/189,7.107200255091881e-5,7.105946607682698e-5,7.108121910066982e-5,3.795970623904427e-8,2.7178714577989653e-8,5.537262056429934e-8 +Bls12_381_G1_hashToGroup/345,7.479752461761387e-5,7.477988568808204e-5,7.48133657392106e-5,5.773972177430472e-8,4.7040380579244366e-8,7.241176463890332e-8 +Bls12_381_G1_hashToGroup/71,6.833680169237795e-5,6.83267108684314e-5,6.83469677693556e-5,3.404531866582195e-8,2.853827585883727e-8,4.1196545228658747e-8 +Bls12_381_G1_hashToGroup/308,7.400979565983232e-5,7.39842410255699e-5,7.40336265293304e-5,8.531782771426123e-8,6.764296232537182e-8,1.104950953917309e-7 +Bls12_381_G1_hashToGroup/101,6.91988039745288e-5,6.918903676282224e-5,6.92080945723641e-5,3.203628971192435e-8,2.7282765473222552e-8,3.989736803524946e-8 +Bls12_381_G1_hashToGroup/86,6.877018519580533e-5,6.874997416598954e-5,6.87909489498844e-5,6.575893476535492e-8,5.59817267612481e-8,7.86183996982649e-8 +Bls12_381_G1_hashToGroup/89,6.900766520383304e-5,6.89909166977384e-5,6.902390885019571e-5,5.3303170931280186e-8,4.7144575389452153e-8,6.292905686488659e-8 +Bls12_381_G1_hashToGroup/150,7.01514247403273e-5,7.013981644726478e-5,7.016335095671585e-5,3.8710305298107146e-8,3.202782842365898e-8,4.7654241118431086e-8 +Bls12_381_G1_hashToGroup/54,6.794501822314906e-5,6.793502647192278e-5,6.795808907310805e-5,3.947438608666088e-8,2.7769720191369872e-8,6.920548838781677e-8 +Bls12_381_G1_hashToGroup/114,6.944517186845582e-5,6.943049885090774e-5,6.945888166895414e-5,4.756387251989963e-8,3.9863398581712144e-8,5.595465584385781e-8 +Bls12_381_G1_hashToGroup/22,6.727968948663871e-5,6.727220206454346e-5,6.728704646229858e-5,2.645592263364219e-8,2.2077809088513186e-8,3.270121786278782e-8 +Bls12_381_G1_hashToGroup/93,6.903984908192753e-5,6.903026987841086e-5,6.904954938363193e-5,3.410506570179241e-8,2.8825195003070466e-8,4.230501246752117e-8 +Bls12_381_G1_hashToGroup/187,7.104093036277583e-5,7.103056520988854e-5,7.105113880253928e-5,3.697255742860804e-8,3.059846508865079e-8,4.889846457795237e-8 +Bls12_381_G1_hashToGroup/152,7.030635927333573e-5,7.029487609740391e-5,7.031729406441878e-5,3.8486056515775305e-8,3.144275990132399e-8,4.8847235636944185e-8 +Bls12_381_G1_hashToGroup/304,7.40046357431773e-5,7.399087875282718e-5,7.401673943076689e-5,4.42653361737533e-8,3.789535187419799e-8,5.318657053953234e-8 +Bls12_381_G1_hashToGroup/375,7.556047581210856e-5,7.554610759613133e-5,7.557455897539642e-5,4.730963054733233e-8,4.0349829369956306e-8,5.8433203468741415e-8 +Bls12_381_G1_hashToGroup/161,7.05107779215429e-5,7.05014275808129e-5,7.051868083270071e-5,2.8366278536613653e-8,2.4324644296350054e-8,3.4732451125059264e-8 +Bls12_381_G1_hashToGroup/268,7.306650259975029e-5,7.304836300664492e-5,7.308808107220199e-5,6.927975894904562e-8,5.9331115311974024e-8,8.178356418870134e-8 +Bls12_381_G1_hashToGroup/51,6.800617179535972e-5,6.799843568909626e-5,6.801485675635343e-5,2.7536252555528405e-8,2.257849327190699e-8,3.5901023941498815e-8 +Bls12_381_G1_hashToGroup/249,7.255095916326411e-5,7.254002255818432e-5,7.256375094602732e-5,4.145708263691449e-8,3.509335270013609e-8,5.5284062333620834e-8 +Bls12_381_G1_hashToGroup/246,7.257999610744444e-5,7.256898702650961e-5,7.259046297589832e-5,3.697735748344955e-8,2.8976382279804665e-8,4.836208091487764e-8 +Bls12_381_G1_hashToGroup/240,7.238985537823153e-5,7.238104324092439e-5,7.239948659940498e-5,3.295955141262393e-8,2.7957499713302373e-8,4.0531700924543905e-8 +Bls12_381_G1_hashToGroup/205,7.13329546662667e-5,7.131966383671203e-5,7.134558268805368e-5,4.428522712259411e-8,3.93301733967241e-8,5.132539903507742e-8 +Bls12_381_G1_hashToGroup/185,7.100213153506583e-5,7.099398543762163e-5,7.101099563965259e-5,2.9119170898923826e-8,2.4943902624198054e-8,3.3820265575348006e-8 +Bls12_381_G1_hashToGroup/139,6.995408210257092e-5,6.99453280529521e-5,6.996357521339796e-5,2.822069877027705e-8,2.3715811351492767e-8,3.388293498674541e-8 +Bls12_381_G1_hashToGroup/328,7.439724154696061e-5,7.438450797275122e-5,7.441191588567401e-5,4.648081314025978e-8,3.894407576504042e-8,5.9189101275770056e-8 +Bls12_381_G1_hashToGroup/115,6.951482474207564e-5,6.950440664848567e-5,6.952443590346645e-5,3.1574433440641817e-8,2.6200832336186156e-8,4.23858429004404e-8 +Bls12_381_G1_hashToGroup/167,7.072066114457016e-5,7.071165912643759e-5,7.073617498336942e-5,4.037687795192011e-8,2.7884950704422144e-8,6.611104886900893e-8 +Bls12_381_G1_hashToGroup/115,6.947600102008347e-5,6.946468415422115e-5,6.948571464225277e-5,3.5378569966428574e-8,2.760820020541098e-8,4.9051845039741404e-8 +Bls12_381_G1_hashToGroup/183,7.1060674666014e-5,7.105156963335993e-5,7.10700079337273e-5,3.201062302288878e-8,2.701835284781149e-8,3.9024227385144666e-8 +Bls12_381_G1_hashToGroup/81,6.877434762161163e-5,6.876635100719306e-5,6.878177594961694e-5,2.677592793333678e-8,2.194014734190223e-8,3.5385343678612525e-8 +Bls12_381_G1_hashToGroup/169,7.06903243910791e-5,7.067965147394683e-5,7.070561831252407e-5,4.215638328692333e-8,3.338999206236389e-8,6.031585497958746e-8 +Bls12_381_G1_hashToGroup/140,6.995925657261594e-5,6.995118444270734e-5,6.996702719517048e-5,2.5958029664101034e-8,2.0484520060037715e-8,3.358550815231365e-8 +Bls12_381_G1_hashToGroup/105,6.927729300486429e-5,6.926658168340271e-5,6.928563439548314e-5,3.026236289129043e-8,2.6067683177273296e-8,3.59309261151431e-8 +Bls12_381_G1_hashToGroup/364,7.527586336938476e-5,7.526120036289699e-5,7.529221001097311e-5,5.324284511884942e-8,3.983976237650234e-8,7.201190353926733e-8 +Bls12_381_G1_hashToGroup/280,7.348472560419473e-5,7.34721131925886e-5,7.349466425761179e-5,3.467331167703354e-8,2.8692170385418597e-8,4.518607304891225e-8 +Bls12_381_G1_hashToGroup/143,6.993817901539063e-5,6.99308092669389e-5,6.994521598411084e-5,2.416005673521151e-8,2.012392695395113e-8,2.8707288420290472e-8 +Bls12_381_G1_hashToGroup/182,7.086677069751695e-5,7.0856906808173e-5,7.087828326397808e-5,3.4891345260019645e-8,2.9546884948362793e-8,4.2071842824716075e-8 +Bls12_381_G1_compress/12,3.9549157093255505e-6,3.947676917598216e-6,3.961587664262556e-6,2.320005136903635e-8,1.9803422350838788e-8,2.788019296650126e-8 +Bls12_381_G1_compress/12,3.936434508035851e-6,3.931327899112562e-6,3.941650079960879e-6,1.7266299568868297e-8,1.4295271534427972e-8,2.1330271107962118e-8 +Bls12_381_G1_compress/12,3.927487295625831e-6,3.921042730570157e-6,3.9336887691072305e-6,2.012327243040549e-8,1.6981116417144902e-8,2.397314494257625e-8 +Bls12_381_G1_compress/12,3.924811807198966e-6,3.920522206675208e-6,3.929527548031897e-6,1.534580039956633e-8,1.3323756371968044e-8,1.8049641510795917e-8 +Bls12_381_G1_compress/12,3.91922195932604e-6,3.913260504035194e-6,3.925464822248662e-6,2.0767772489120523e-8,1.7881128872776367e-8,2.420656857371166e-8 +Bls12_381_G1_compress/12,3.931131998106913e-6,3.924487685947975e-6,3.937689690232639e-6,2.201145505019857e-8,1.883006763026782e-8,2.5938107505570512e-8 +Bls12_381_G1_compress/12,3.9099949880235635e-6,3.905272203078295e-6,3.915623679787102e-6,1.7460346911919013e-8,1.3961403461344845e-8,2.0893531748355522e-8 +Bls12_381_G1_compress/12,3.900148405431966e-6,3.8961938158477455e-6,3.90432614162574e-6,1.3547828029438066e-8,1.121051745037773e-8,1.6355828489906293e-8 +Bls12_381_G1_compress/12,3.889731043752542e-6,3.885865330733713e-6,3.893941899224867e-6,1.3218504758549561e-8,1.101869934510678e-8,1.579701557294207e-8 +Bls12_381_G1_compress/12,3.8999250087947835e-6,3.893829633725397e-6,3.906651511669542e-6,2.1844289559836116e-8,1.918974590524139e-8,2.5252519166305493e-8 +Bls12_381_G1_compress/12,3.9108679742522475e-6,3.904942074739857e-6,3.917043190723774e-6,2.057801535723936e-8,1.7592971341628797e-8,2.3836381747657885e-8 +Bls12_381_G1_compress/12,3.908368897102355e-6,3.903232312874261e-6,3.913814588659387e-6,1.882487008471149e-8,1.5868492779845e-8,2.2185774467545787e-8 +Bls12_381_G1_compress/12,3.899843340497259e-6,3.893419022678216e-6,3.9089705582906055e-6,2.5248655293600945e-8,2.0158827222533737e-8,3.4259917702702795e-8 +Bls12_381_G1_compress/12,3.8845617925581595e-6,3.881515335795681e-6,3.8879467648011495e-6,1.0958248413361833e-8,9.103277810775379e-9,1.3752573569708084e-8 +Bls12_381_G1_compress/12,3.902663162982263e-6,3.897435567516497e-6,3.9077651596808066e-6,1.71548010175602e-8,1.4713989679936503e-8,2.0448541875290472e-8 +Bls12_381_G1_compress/12,3.934154354449029e-6,3.929001695164978e-6,3.939430398420306e-6,1.7328773504873257e-8,1.4228538113943459e-8,2.2326195445820526e-8 +Bls12_381_G1_compress/12,3.901144969821033e-6,3.893006003957782e-6,3.912038281682425e-6,3.176257888080976e-8,2.5487830601121824e-8,3.837626990630775e-8 +Bls12_381_G1_compress/12,3.871914984871946e-6,3.8694996988770835e-6,3.874629053595641e-6,8.277929829254692e-9,6.705423392711509e-9,1.0443363459583017e-8 +Bls12_381_G1_compress/12,3.874399431970777e-6,3.871488220501477e-6,3.87883327677655e-6,1.241824301306655e-8,9.876547890813793e-9,1.5833468340552985e-8 +Bls12_381_G1_compress/12,3.876000915639374e-6,3.873187486878368e-6,3.879007972704374e-6,9.415439819240826e-9,7.46122110887416e-9,1.1954207511424463e-8 +Bls12_381_G1_compress/12,3.896472947968677e-6,3.888956121196135e-6,3.905561142526375e-6,2.7605325722015502e-8,2.2662015215799838e-8,3.243367821787731e-8 +Bls12_381_G1_compress/12,3.872276444060193e-6,3.8683243561476155e-6,3.877685030108639e-6,1.5696753256392508e-8,1.2712175115375143e-8,1.958420651176522e-8 +Bls12_381_G1_compress/12,3.876559060963924e-6,3.872316712893163e-6,3.882190398879497e-6,1.6007485627496802e-8,1.3189404965853471e-8,1.957678244531557e-8 +Bls12_381_G1_compress/12,3.907807115289114e-6,3.902577805907918e-6,3.915553813968196e-6,2.053085406031287e-8,1.5030293618502995e-8,2.830747389576376e-8 +Bls12_381_G1_compress/12,3.9301565018075686e-6,3.922110353256497e-6,3.93694889845041e-6,2.3753679873337607e-8,1.9577736860789282e-8,3.0045562904967264e-8 +Bls12_381_G1_compress/12,3.927489823405232e-6,3.921807058939715e-6,3.933614389119792e-6,1.9199175028200207e-8,1.5416605149734783e-8,2.3975783650094332e-8 +Bls12_381_G1_compress/12,3.945129512214308e-6,3.936237494113533e-6,3.953921132002057e-6,3.0207236228039384e-8,2.671849266398947e-8,3.407507847575199e-8 +Bls12_381_G1_compress/12,3.93756089832407e-6,3.93067955339101e-6,3.943604209887541e-6,2.184206143762504e-8,1.7943986552073024e-8,2.8025748942869198e-8 +Bls12_381_G1_compress/12,3.908717587921362e-6,3.905861632603939e-6,3.911929442658399e-6,9.93622832544501e-9,8.50647340044101e-9,1.3034052524519132e-8 +Bls12_381_G1_compress/12,3.898785641570736e-6,3.893603688630324e-6,3.90679230561755e-6,2.0980000838688243e-8,1.6331278743415074e-8,2.794841973099078e-8 +Bls12_381_G1_compress/12,3.902771107481311e-6,3.897593188101071e-6,3.908208115307581e-6,1.8225424727611435e-8,1.5725703681583953e-8,2.2218180580701776e-8 +Bls12_381_G1_compress/12,3.896660631417565e-6,3.8919075569781315e-6,3.901200377312837e-6,1.5149013042235567e-8,1.2893182022998324e-8,1.7533320518085292e-8 +Bls12_381_G1_compress/12,3.904723942039089e-6,3.89629251524167e-6,3.914436488038929e-6,2.861447763295749e-8,2.5160595602144578e-8,3.299776557749857e-8 +Bls12_381_G1_compress/12,3.887098519781451e-6,3.883007080642907e-6,3.891387823632285e-6,1.497367509929817e-8,1.2720348050273643e-8,1.74603102866836e-8 +Bls12_381_G1_compress/12,3.885476871112796e-6,3.879229521945102e-6,3.892246400264865e-6,2.1578932249258644e-8,1.8893113743610974e-8,2.5489457468651545e-8 +Bls12_381_G1_compress/12,3.8946722512641874e-6,3.889025457806651e-6,3.90082372408397e-6,1.883144041510017e-8,1.5992491344065203e-8,2.2101516120682286e-8 +Bls12_381_G1_compress/12,3.888197854175965e-6,3.88456300139404e-6,3.892552787901213e-6,1.388882073631895e-8,1.1475884617563749e-8,1.6752690148725273e-8 +Bls12_381_G1_compress/12,3.867403686224504e-6,3.864577521515981e-6,3.87215640320224e-6,1.1291641294074777e-8,7.975726380049903e-9,1.6363146214495473e-8 +Bls12_381_G1_compress/12,3.898927411451196e-6,3.892215259536858e-6,3.906514856873456e-6,2.3465637074260282e-8,1.9019345275239992e-8,2.941839873652122e-8 +Bls12_381_G1_compress/12,3.9116257842833345e-6,3.904981764225418e-6,3.918212084614012e-6,2.196502159190335e-8,1.933994075084256e-8,2.5586759173521057e-8 +Bls12_381_G1_compress/12,3.88905872051794e-6,3.883698945312549e-6,3.8957406264649055e-6,2.009736245433624e-8,1.548976352161066e-8,2.6456034254387284e-8 +Bls12_381_G1_compress/12,3.903717846988461e-6,3.8979980584382076e-6,3.910515075559945e-6,2.084411717647678e-8,1.7304875663815838e-8,2.439766550837912e-8 +Bls12_381_G1_compress/12,3.882187630878936e-6,3.878150011939472e-6,3.886811900732911e-6,1.3678164385498278e-8,1.1813446933468695e-8,1.5598029835605362e-8 +Bls12_381_G1_compress/12,3.909440768376255e-6,3.903845465375364e-6,3.91533027797881e-6,1.937699182180279e-8,1.5982238370440972e-8,2.3954339510199843e-8 +Bls12_381_G1_compress/12,3.885934899242778e-6,3.881344022009895e-6,3.890238888192565e-6,1.427753190791854e-8,1.186602510815633e-8,1.740979637309073e-8 +Bls12_381_G1_compress/12,3.886088198149454e-6,3.8815107262633436e-6,3.8914015862181535e-6,1.5831461692470388e-8,1.33283616457956e-8,1.8527258304332328e-8 +Bls12_381_G1_compress/12,3.8883827257967885e-6,3.884778670499108e-6,3.892691318137894e-6,1.3552625990327903e-8,1.101998466205337e-8,1.645549443240197e-8 +Bls12_381_G1_compress/12,3.901762488051319e-6,3.893934186589295e-6,3.9093785005776135e-6,2.664691535640626e-8,2.2780667017534777e-8,3.1579429433166246e-8 +Bls12_381_G1_compress/12,3.908967341103592e-6,3.899898270936778e-6,3.920767884467645e-6,3.338982865760416e-8,2.6939786073651486e-8,4.0904777162659906e-8 +Bls12_381_G1_compress/12,3.875536623943855e-6,3.871896710715937e-6,3.87912981069308e-6,1.23736075908689e-8,1.0671939779375966e-8,1.4636230262495793e-8 +Bls12_381_G1_compress/12,3.881662807031259e-6,3.876899834907561e-6,3.887230472718541e-6,1.7289129122692122e-8,1.4991155440866314e-8,2.1378256680892246e-8 +Bls12_381_G1_compress/12,3.900660687384114e-6,3.893131471607854e-6,3.9089082045919325e-6,2.5155381742084273e-8,2.1684867630438512e-8,2.966408250171666e-8 +Bls12_381_G1_compress/12,3.876350611655146e-6,3.871033620115955e-6,3.882051159899483e-6,1.8002164817195855e-8,1.4977527890351792e-8,2.1045444975976958e-8 +Bls12_381_G1_compress/12,3.895566320611204e-6,3.8894977660888465e-6,3.903132492781072e-6,2.1974155209220568e-8,1.798605993786189e-8,2.6416009365137377e-8 +Bls12_381_G1_compress/12,3.901543526342381e-6,3.896485620262216e-6,3.906722466088924e-6,1.830535244323427e-8,1.58477989275475e-8,2.1220625329692045e-8 +Bls12_381_G1_compress/12,3.8957854287691365e-6,3.890707651453925e-6,3.902031099980516e-6,1.8600625327092326e-8,1.5518354645207288e-8,2.237005164759747e-8 +Bls12_381_G1_compress/12,3.891729926657667e-6,3.886947533807566e-6,3.897208818896811e-6,1.800615219263194e-8,1.4935682407026258e-8,2.2759390560482407e-8 +Bls12_381_G1_compress/12,3.877774740650281e-6,3.8743758249204284e-6,3.881742602168374e-6,1.1883492524606307e-8,9.729504080528813e-9,1.5272882763625784e-8 +Bls12_381_G1_compress/12,3.895054432681735e-6,3.890675643922204e-6,3.900544621445559e-6,1.7028929356893306e-8,1.4364937072707566e-8,2.019330536675104e-8 +Bls12_381_G1_compress/12,3.8792633433329305e-6,3.875682311542368e-6,3.884520059568856e-6,1.4026608155342002e-8,1.1489772721736723e-8,1.941141823551386e-8 +Bls12_381_G1_compress/12,3.90529406757628e-6,3.898989576486287e-6,3.912580007300571e-6,2.267148502451486e-8,1.938148989378582e-8,2.851410702490418e-8 +Bls12_381_G1_compress/12,3.880176047697725e-6,3.876178886596593e-6,3.886913713037323e-6,1.7362132209158143e-8,1.0764243053187984e-8,2.396548374894385e-8 +Bls12_381_G1_compress/12,3.9165104074080664e-6,3.909725777487875e-6,3.924562532389473e-6,2.409821552801111e-8,2.0369736943539644e-8,3.073088221952867e-8 +Bls12_381_G1_compress/12,3.9106812088664166e-6,3.903479374559505e-6,3.919430641542551e-6,2.7768527193271862e-8,2.3463163013928436e-8,3.3365118484535026e-8 +Bls12_381_G1_compress/12,3.90616510621277e-6,3.900590567668744e-6,3.912453805077189e-6,1.896838928941146e-8,1.6701077771930106e-8,2.1829869958573775e-8 +Bls12_381_G1_compress/12,3.911113940706238e-6,3.904837701320386e-6,3.917954104410189e-6,2.169357468172776e-8,1.8429897072172227e-8,2.6226673198179166e-8 +Bls12_381_G1_compress/12,3.90354362403435e-6,3.896999067534222e-6,3.9111850705219105e-6,2.298930457790253e-8,1.9994232751489485e-8,2.7852425169410706e-8 +Bls12_381_G1_compress/12,3.893204641056772e-6,3.8896362054446965e-6,3.897472790904346e-6,1.3374052298203868e-8,1.118778828067157e-8,1.6740854706524442e-8 +Bls12_381_G1_compress/12,3.8969063173059354e-6,3.891411131781321e-6,3.902620312413993e-6,1.9762103631868865e-8,1.6018800362604195e-8,2.4510061191856035e-8 +Bls12_381_G1_compress/12,3.905704474971512e-6,3.900326814360902e-6,3.912098220507394e-6,2.045588048697493e-8,1.691099683180948e-8,2.629891868500381e-8 +Bls12_381_G1_compress/12,3.903513179047892e-6,3.8955706910874275e-6,3.911864728351677e-6,2.779180552567965e-8,2.3221731046405542e-8,3.472027064878576e-8 +Bls12_381_G1_compress/12,3.889234555545694e-6,3.884908683599055e-6,3.893984710826459e-6,1.5578956077880798e-8,1.2948114278464758e-8,1.892106060867837e-8 +Bls12_381_G1_compress/12,3.906274508691355e-6,3.9001295434657125e-6,3.912753051391948e-6,2.213611165838694e-8,1.86312739375636e-8,2.9118161972437497e-8 +Bls12_381_G1_compress/12,3.891516504501433e-6,3.885289666628505e-6,3.900043043086218e-6,2.420298789713668e-8,2.043467176183665e-8,2.9228470497929257e-8 +Bls12_381_G1_compress/12,3.9064488576693865e-6,3.899663815949035e-6,3.913796912103099e-6,2.3470643172566493e-8,2.0390542287932886e-8,2.804033074651085e-8 +Bls12_381_G1_compress/12,3.898567007575662e-6,3.893474961707468e-6,3.904368083882628e-6,1.7990904980702424e-8,1.5007841171510745e-8,2.2851070827318156e-8 +Bls12_381_G1_compress/12,3.9027835110378464e-6,3.897885587787968e-6,3.908507867081663e-6,1.7550024398128368e-8,1.4894344994872124e-8,2.0668957325718894e-8 +Bls12_381_G1_compress/12,3.908869029523858e-6,3.9028619234104285e-6,3.9153093724775565e-6,2.1188427931829496e-8,1.7901197670176977e-8,2.5072150664816188e-8 +Bls12_381_G1_compress/12,3.899696931297749e-6,3.893844466782006e-6,3.906729959294365e-6,2.207821769073066e-8,1.8887169789260175e-8,2.7925161190413237e-8 +Bls12_381_G1_compress/12,3.909492972731417e-6,3.9031170528079165e-6,3.9177562149384615e-6,2.420216868142595e-8,1.8679857562859147e-8,3.059984904675034e-8 +Bls12_381_G1_compress/12,3.908430110397152e-6,3.903159643756423e-6,3.914947821454567e-6,2.074359132356131e-8,1.7364933189511114e-8,2.41485318961023e-8 +Bls12_381_G1_compress/12,3.9133452168027196e-6,3.907837031308352e-6,3.9199827671218385e-6,1.9839134142979224e-8,1.6279559738409938e-8,2.4777073263343934e-8 +Bls12_381_G1_compress/12,3.908723211927049e-6,3.903546929362381e-6,3.914263126501796e-6,1.816885014481711e-8,1.4849563569289028e-8,2.2067078272158783e-8 +Bls12_381_G1_compress/12,3.898964508809763e-6,3.895686157880288e-6,3.903624448481443e-6,1.304239896676081e-8,1.0503399363068728e-8,1.7782296373455227e-8 +Bls12_381_G1_compress/12,3.906377195957515e-6,3.898105306059065e-6,3.916584818155812e-6,3.006340665572216e-8,2.526414794169671e-8,3.968785284075519e-8 +Bls12_381_G1_compress/12,3.914414102508761e-6,3.907141877584105e-6,3.922571106894486e-6,2.561750661142647e-8,2.094797110652619e-8,3.1506016056938716e-8 +Bls12_381_G1_compress/12,3.922518772076275e-6,3.917908437380941e-6,3.927474966475525e-6,1.594666618567153e-8,1.3472611649159864e-8,1.9282973718378932e-8 +Bls12_381_G1_compress/12,3.878427356368283e-6,3.875234012489161e-6,3.882538284716889e-6,1.2026582296525148e-8,1.0360257117679153e-8,1.4269717441909831e-8 +Bls12_381_G1_compress/12,3.8920874226192445e-6,3.888848965706081e-6,3.896586218047837e-6,1.217394634715951e-8,1.0239863201014812e-8,1.5010381188954878e-8 +Bls12_381_G1_compress/12,3.911809428521024e-6,3.905767834191782e-6,3.918085406074319e-6,2.1012373370086168e-8,1.8028896249253036e-8,2.7308445339884234e-8 +Bls12_381_G1_compress/12,3.894287707035879e-6,3.889023948287113e-6,3.900140437242593e-6,1.9051131010775915e-8,1.6218881413307357e-8,2.2823301213227652e-8 +Bls12_381_G1_compress/12,3.909527823383782e-6,3.902061497509477e-6,3.9171057319809835e-6,2.4893301302987318e-8,2.1647173126742093e-8,3.0545437159201586e-8 +Bls12_381_G1_compress/12,3.911624831380349e-6,3.903856003085575e-6,3.919617165147115e-6,2.4832357713792717e-8,2.161715171365041e-8,3.026685479391569e-8 +Bls12_381_G1_compress/12,3.892877705328308e-6,3.888447935418496e-6,3.8975627509050525e-6,1.5106934537187603e-8,1.2277768481787569e-8,1.9174431656474428e-8 +Bls12_381_G1_compress/12,3.881894303522449e-6,3.876888965186652e-6,3.887938870284967e-6,1.7528009443181015e-8,1.5027183671788502e-8,2.0795748551730298e-8 +Bls12_381_G1_compress/12,3.87804671415887e-6,3.874525339958388e-6,3.882396314478733e-6,1.2557393902516337e-8,1.0167426423189424e-8,1.5879848006695314e-8 +Bls12_381_G1_compress/12,3.900797139138505e-6,3.894072546702121e-6,3.908575510446134e-6,2.5394898000580152e-8,2.1383202188738987e-8,3.0910123210861043e-8 +Bls12_381_G1_compress/12,3.8804372083214435e-6,3.87655096826506e-6,3.886197422993833e-6,1.591422560677666e-8,1.1969955680102066e-8,2.0981903220078106e-8 +Bls12_381_G1_compress/12,3.9361497408091095e-6,3.928915885042463e-6,3.943671312034155e-6,2.505149264459052e-8,2.181769880248871e-8,2.8777213011104207e-8 +Bls12_381_G1_compress/12,3.9083307966203125e-6,3.9039821894361244e-6,3.912960271102937e-6,1.551795092011281e-8,1.2901675200905378e-8,1.9160050524684362e-8 +Bls12_381_G1_uncompress/6,1.712023229638935e-5,1.71121661220122e-5,1.713017655337288e-5,2.9508686402317233e-8,2.5150617660861463e-8,3.452126316695715e-8 +Bls12_381_G1_uncompress/6,1.7114231134050724e-5,1.710322645830276e-5,1.7122820117856252e-5,3.111554534038556e-8,2.3459519053149407e-8,4.380488697044862e-8 +Bls12_381_G1_uncompress/6,1.711927356891616e-5,1.7111353537109062e-5,1.7126140000058128e-5,2.5519646798881122e-8,2.068646113087727e-8,3.271639945240962e-8 +Bls12_381_G1_uncompress/6,1.7103692896927604e-5,1.7088498441128395e-5,1.7116899374271976e-5,4.959249904390784e-8,4.156398643108884e-8,5.7410455961739716e-8 +Bls12_381_G1_uncompress/6,1.7100299956124455e-5,1.7085560066451007e-5,1.7115718308080806e-5,4.814744974206165e-8,4.008355208673855e-8,6.043082369343313e-8 +Bls12_381_G1_uncompress/6,1.709675315452215e-5,1.708983199274206e-5,1.7103352888404427e-5,2.276421868971117e-8,2.0174287166580015e-8,2.645816233716599e-8 +Bls12_381_G1_uncompress/6,1.7057343508313194e-5,1.7046647772966895e-5,1.7069323379382048e-5,4.0362981784717567e-8,3.451837290684527e-8,4.7152067409491675e-8 +Bls12_381_G1_uncompress/6,1.7068801370306983e-5,1.7060151740364817e-5,1.7080945863670772e-5,3.4211430270653846e-8,2.993011104868623e-8,3.94836786688001e-8 +Bls12_381_G1_uncompress/6,1.7053459336729705e-5,1.7046147399097108e-5,1.7060660852991863e-5,2.5133371048005523e-8,2.0434842934586842e-8,3.247669418633543e-8 +Bls12_381_G1_uncompress/6,1.7107749366045894e-5,1.7093075318947585e-5,1.712231707847778e-5,4.786760329092636e-8,4.2378614422994716e-8,5.559796439846019e-8 +Bls12_381_G1_uncompress/6,1.716435641582037e-5,1.7155939372912865e-5,1.7172161733255824e-5,2.8412566101993707e-8,2.4305582915462805e-8,3.367020042103641e-8 +Bls12_381_G1_uncompress/6,1.7096083892611364e-5,1.708864761191245e-5,1.7104629905474197e-5,2.552103105085417e-8,2.0180758699421e-8,3.49258093250224e-8 +Bls12_381_G1_uncompress/6,1.7141876483032004e-5,1.7132480586626926e-5,1.714933199478317e-5,2.7495747547121734e-8,2.139373398066386e-8,3.6982060983581023e-8 +Bls12_381_G1_uncompress/6,1.7125147619786633e-5,1.711674006642009e-5,1.713326208163519e-5,2.625214456557354e-8,2.202103830653205e-8,3.212045731738375e-8 +Bls12_381_G1_uncompress/6,1.709152098483849e-5,1.708471958439118e-5,1.7100116250219868e-5,2.4969739371626627e-8,2.1277980238708344e-8,3.0602120867796766e-8 +Bls12_381_G1_uncompress/6,1.7125781555355067e-5,1.7119350701117804e-5,1.713171343821519e-5,2.1323846334304135e-8,1.7528228546293353e-8,2.652273370028743e-8 +Bls12_381_G1_uncompress/6,1.7107259160458468e-5,1.7098409830397e-5,1.7117062872857242e-5,3.129554661801761e-8,2.710082596510227e-8,3.6891798501821896e-8 +Bls12_381_G1_uncompress/6,1.7085656712772216e-5,1.7077237509215433e-5,1.7093076429285163e-5,2.7009314128663317e-8,2.2273233848946483e-8,3.3311842262835055e-8 +Bls12_381_G1_uncompress/6,1.7127917823555246e-5,1.7120750870475608e-5,1.7133051561492465e-5,2.0209200980948334e-8,1.5931333160700787e-8,2.570857192986297e-8 +Bls12_381_G1_uncompress/6,1.7140056902397604e-5,1.7129439647386423e-5,1.71472579943256e-5,2.72539743181014e-8,2.2555905275213028e-8,3.372190886170673e-8 +Bls12_381_G1_uncompress/6,1.709195351460723e-5,1.7081788136712947e-5,1.7102494190406282e-5,3.390597968726163e-8,2.9131240974118503e-8,4.047665928268274e-8 +Bls12_381_G1_uncompress/6,1.7159326601263876e-5,1.7151139539237345e-5,1.7168604375011387e-5,2.7720823565396978e-8,2.3500589543372725e-8,3.3307797254935994e-8 +Bls12_381_G1_uncompress/6,1.711609727810575e-5,1.7107840475262935e-5,1.7124397738427e-5,2.860428543075434e-8,2.3775545507667233e-8,3.4763606962621233e-8 +Bls12_381_G1_uncompress/6,1.7100570815015984e-5,1.7090567102160046e-5,1.7110504242189423e-5,3.3694271545623394e-8,2.8898824381632924e-8,4.0484305575494396e-8 +Bls12_381_G1_uncompress/6,1.7133825532425114e-5,1.7123976023511475e-5,1.7143871793294437e-5,3.277316457180051e-8,2.8152553932333526e-8,3.824851458931475e-8 +Bls12_381_G1_uncompress/6,1.7140235655071993e-5,1.7132450303879073e-5,1.7148453329895082e-5,2.7381567713650594e-8,2.285499007587778e-8,3.410136030947276e-8 +Bls12_381_G1_uncompress/6,1.7124160377529095e-5,1.7115050806915605e-5,1.7131499265461807e-5,2.6559950474075412e-8,2.178710335987988e-8,3.2708752885810604e-8 +Bls12_381_G1_uncompress/6,1.7109586620111318e-5,1.7095143347933338e-5,1.7120351446326385e-5,4.0638168993692795e-8,3.257031383935096e-8,4.973797921104769e-8 +Bls12_381_G1_uncompress/6,1.7114203114755686e-5,1.7106428624280215e-5,1.7120404124432214e-5,2.208794562728037e-8,1.8137406651878786e-8,2.6613205292878973e-8 +Bls12_381_G1_uncompress/6,1.7122714399954466e-5,1.7114813190802042e-5,1.712950027758429e-5,2.4896530728878955e-8,1.9796017983498468e-8,3.262518206126006e-8 +Bls12_381_G1_uncompress/6,1.7136648304105657e-5,1.7129338923769585e-5,1.7143708140224446e-5,2.4477625692401172e-8,2.0055224257072304e-8,2.940191635464628e-8 +Bls12_381_G1_uncompress/6,1.7115234560114737e-5,1.710503905500859e-5,1.7123390573220154e-5,3.087453347119886e-8,2.3401475229869487e-8,4.1880415407127834e-8 +Bls12_381_G1_uncompress/6,1.7103839667405063e-5,1.7093322805090388e-5,1.7113985376558263e-5,3.662067589106588e-8,3.202339744328521e-8,4.233412962595256e-8 +Bls12_381_G1_uncompress/6,1.7151490917795394e-5,1.714485893327797e-5,1.7158091994500143e-5,2.1998658756964004e-8,1.8952599398992182e-8,2.66631700532429e-8 +Bls12_381_G1_uncompress/6,1.7133995991105234e-5,1.7123938054250124e-5,1.7142784515946322e-5,3.161570690035045e-8,2.4076247889810936e-8,4.155417631736595e-8 +Bls12_381_G1_uncompress/6,1.712558535029878e-5,1.711795062486556e-5,1.7133833649113605e-5,2.682690563408442e-8,2.3040984356619822e-8,3.2135968324536115e-8 +Bls12_381_G1_uncompress/6,1.7073225903017935e-5,1.7066407339594135e-5,1.707994276896017e-5,2.30898334459552e-8,1.9051502495141534e-8,2.773566554941148e-8 +Bls12_381_G1_uncompress/6,1.711742423264318e-5,1.7105123426943135e-5,1.7127581496872295e-5,3.708753815527571e-8,3.113069642445687e-8,4.862566467671895e-8 +Bls12_381_G1_uncompress/6,1.71239203573801e-5,1.711549943624173e-5,1.7130937702290135e-5,2.5190439795897218e-8,1.987237208378103e-8,3.166843750836372e-8 +Bls12_381_G1_uncompress/6,1.7127172753330837e-5,1.7119044896641777e-5,1.7135788993730048e-5,3.0233395848047885e-8,2.5417319863326864e-8,3.6153141808154533e-8 +Bls12_381_G1_uncompress/6,1.7117337129433723e-5,1.7106541318646576e-5,1.7126065059574446e-5,3.2485408751493144e-8,2.6012514629815186e-8,4.05950719192761e-8 +Bls12_381_G1_uncompress/6,1.713289820512391e-5,1.7125264396036348e-5,1.7140298322789993e-5,2.5921845173824974e-8,2.1153655033019046e-8,3.2237623035189987e-8 +Bls12_381_G1_uncompress/6,1.7127664587025918e-5,1.7114995389645253e-5,1.7138080160488715e-5,3.765123652989428e-8,3.046372131047604e-8,4.582156964295876e-8 +Bls12_381_G1_uncompress/6,1.7158369380935324e-5,1.7150216388735645e-5,1.7165921430419316e-5,2.5240267231645993e-8,2.061898316543902e-8,3.1880656574123454e-8 +Bls12_381_G1_uncompress/6,1.7147050558774903e-5,1.713660705768755e-5,1.715473200916941e-5,3.1876355396901565e-8,2.5171528610124973e-8,4.48473703469184e-8 +Bls12_381_G1_uncompress/6,1.71594151513952e-5,1.7149757514246556e-5,1.7166528337656148e-5,2.726197178145025e-8,2.2328452142490117e-8,3.467093879185366e-8 +Bls12_381_G1_uncompress/6,1.7068718313517564e-5,1.7059887875160462e-5,1.7077902941721293e-5,2.8262502227811715e-8,2.424613110348864e-8,3.309382680419165e-8 +Bls12_381_G1_uncompress/6,1.7108364979171427e-5,1.709486277519819e-5,1.7120265828792764e-5,4.137164135165701e-8,3.5268359439733476e-8,4.848359140067094e-8 +Bls12_381_G1_uncompress/6,1.709340112727829e-5,1.7079784460220076e-5,1.710787954502077e-5,4.67633280743815e-8,4.110264256973581e-8,5.4923294696482776e-8 +Bls12_381_G1_uncompress/6,1.714292918442856e-5,1.713482960909942e-5,1.715148854204808e-5,2.8495548221116297e-8,2.406678792854939e-8,3.3821665177634064e-8 +Bls12_381_G1_uncompress/6,1.7171486710709464e-5,1.716193753761393e-5,1.718120156613989e-5,3.2961687112450496e-8,2.7986835040982926e-8,3.9646937476642235e-8 +Bls12_381_G1_uncompress/6,1.7118527425920258e-5,1.710907201771309e-5,1.712853302708392e-5,3.3142884262822654e-8,2.7967265815230083e-8,4.00467509177621e-8 +Bls12_381_G1_uncompress/6,1.7118804111292666e-5,1.7103332438005115e-5,1.713448030265682e-5,5.1595228668592506e-8,4.5671603578319794e-8,5.989876691947566e-8 +Bls12_381_G1_uncompress/6,1.70753235030362e-5,1.7067748815395834e-5,1.7082930289935055e-5,2.521611416602987e-8,2.0338044207133428e-8,3.4009236945412243e-8 +Bls12_381_G1_uncompress/6,1.7057571011499666e-5,1.7045731246053557e-5,1.7067636768782544e-5,3.860396251796194e-8,3.144386956203389e-8,4.81495823352035e-8 +Bls12_381_G1_uncompress/6,1.7068048540788546e-5,1.7054655904035694e-5,1.7084735371749277e-5,4.7738532994083655e-8,4.170665390541203e-8,5.531394198118101e-8 +Bls12_381_G1_uncompress/6,1.7112977465356565e-5,1.7093578740172922e-5,1.713028699709788e-5,6.083738360554742e-8,5.3812920245443177e-8,6.83344575193499e-8 +Bls12_381_G1_uncompress/6,1.716620018145009e-5,1.71572637890153e-5,1.717528956341328e-5,2.995113658121489e-8,2.205000609693022e-8,4.3319865829282664e-8 +Bls12_381_G1_uncompress/6,1.7087888862979843e-5,1.7079705540222752e-5,1.7096473198693652e-5,2.767479367996969e-8,2.336394391685901e-8,3.5833750498845755e-8 +Bls12_381_G1_uncompress/6,1.709936933832666e-5,1.708948328752687e-5,1.7112169814865306e-5,3.8221243978406245e-8,3.131425217342741e-8,4.7847348487100176e-8 +Bls12_381_G1_uncompress/6,1.709298846455118e-5,1.707698060938295e-5,1.710819711378953e-5,5.223400957164313e-8,4.5655368807531095e-8,6.208939655283666e-8 +Bls12_381_G1_uncompress/6,1.7095115504559362e-5,1.7079355344650003e-5,1.7108111670323863e-5,4.53353634853495e-8,3.795292689182322e-8,5.414765139295471e-8 +Bls12_381_G1_uncompress/6,1.709940313415679e-5,1.7084309244196823e-5,1.7114040425512986e-5,4.751984472764172e-8,4.0881684614023276e-8,5.636877376443938e-8 +Bls12_381_G1_uncompress/6,1.709224745218729e-5,1.7084044979166456e-5,1.710324250974874e-5,3.240610540498666e-8,2.6467795202822284e-8,3.91233508164778e-8 +Bls12_381_G1_uncompress/6,1.7125410936611165e-5,1.7116120425175362e-5,1.713568162477269e-5,3.082760296534529e-8,2.7023366910295738e-8,3.4890652604846646e-8 +Bls12_381_G1_uncompress/6,1.7093678494100148e-5,1.708646602816739e-5,1.710079674870868e-5,2.3850234900490864e-8,1.9119120107229093e-8,3.009007485915149e-8 +Bls12_381_G1_uncompress/6,1.7057617961222595e-5,1.7041456166995553e-5,1.7074906443318194e-5,5.3318832489194775e-8,4.5245764848243646e-8,6.306884974816091e-8 +Bls12_381_G1_uncompress/6,1.712298721314158e-5,1.7114254052144013e-5,1.7130237827581126e-5,2.6364999602411107e-8,2.1355810968537976e-8,3.402631480856051e-8 +Bls12_381_G1_uncompress/6,1.712265239371013e-5,1.711508011568633e-5,1.7129650002970148e-5,2.403812547582303e-8,2.018717605367956e-8,2.8549395287615123e-8 +Bls12_381_G1_uncompress/6,1.7078180599332277e-5,1.706184314441667e-5,1.709515903986511e-5,5.567541772979792e-8,5.084178280249392e-8,6.124083943716876e-8 +Bls12_381_G1_uncompress/6,1.711962144220666e-5,1.710963754077005e-5,1.7130120926529248e-5,3.437771731610542e-8,2.9581805552525597e-8,4.194296738360399e-8 +Bls12_381_G1_uncompress/6,1.7104082799009278e-5,1.7092972536115796e-5,1.7113067932830768e-5,3.287136160525254e-8,2.3958233551159865e-8,4.5099814041802956e-8 +Bls12_381_G1_uncompress/6,1.7077800220310682e-5,1.7064592082815855e-5,1.708852487410081e-5,3.986634127848663e-8,3.354960026839091e-8,4.7570164334898306e-8 +Bls12_381_G1_uncompress/6,1.7056691426835638e-5,1.704432516665078e-5,1.70720477345032e-5,4.668609292891123e-8,4.050959181401233e-8,5.4453670780470676e-8 +Bls12_381_G1_uncompress/6,1.71425773698004e-5,1.7135388781079373e-5,1.7150667676839994e-5,2.4800793686668122e-8,2.0763560061233622e-8,2.9510223920947314e-8 +Bls12_381_G1_uncompress/6,1.7119625351324038e-5,1.7112117355556416e-5,1.712599806193477e-5,2.3516409235034707e-8,1.8377400622707767e-8,2.9532910852820573e-8 +Bls12_381_G1_uncompress/6,1.7120239314851148e-5,1.7112173971184272e-5,1.712876873169982e-5,2.7547552456305575e-8,2.356656627704718e-8,3.273120010455352e-8 +Bls12_381_G1_uncompress/6,1.7063393769600384e-5,1.7056824490210047e-5,1.7071439689040287e-5,2.4655369269053964e-8,2.0515192132292693e-8,3.037036030589421e-8 +Bls12_381_G1_uncompress/6,1.710529555393269e-5,1.7096939914601205e-5,1.71125699099552e-5,2.7012479186563187e-8,2.2925497956260213e-8,3.312641831231935e-8 +Bls12_381_G1_uncompress/6,1.7113029562453116e-5,1.710254276284479e-5,1.7121702108454744e-5,3.146330036174399e-8,2.507727331034072e-8,3.771803757895528e-8 +Bls12_381_G1_uncompress/6,1.711942601459109e-5,1.711259127288076e-5,1.712740943162864e-5,2.518047351037016e-8,2.1350479438105643e-8,2.999626537100693e-8 +Bls12_381_G1_uncompress/6,1.70926095655135e-5,1.708260258243675e-5,1.710308564676178e-5,3.4334630601088134e-8,2.9534602111635596e-8,3.9989247931252676e-8 +Bls12_381_G1_uncompress/6,1.7090886060291142e-5,1.7080117259542394e-5,1.710227879023785e-5,3.857282159396099e-8,3.420059968130426e-8,4.303148882024523e-8 +Bls12_381_G1_uncompress/6,1.7062933917092905e-5,1.7044944969056633e-5,1.708021176005134e-5,5.9032342053455394e-8,5.327412221126018e-8,6.49607076128665e-8 +Bls12_381_G1_uncompress/6,1.710262244472679e-5,1.7093335193400973e-5,1.71139394311166e-5,3.527230438725412e-8,3.0712583131600115e-8,4.1463510875052925e-8 +Bls12_381_G1_uncompress/6,1.7109869354425997e-5,1.7102173478972374e-5,1.7116687751668238e-5,2.5084980273468398e-8,2.0669307077226594e-8,3.19185689025205e-8 +Bls12_381_G1_uncompress/6,1.7140153261598045e-5,1.7130995305767688e-5,1.7148979937265938e-5,3.027153640120805e-8,2.529896515465444e-8,3.7683474982234725e-8 +Bls12_381_G1_uncompress/6,1.709200898022248e-5,1.7075807133605874e-5,1.710841714507266e-5,5.534226802112388e-8,4.836951123110504e-8,6.394089597979805e-8 +Bls12_381_G1_uncompress/6,1.7097149857048997e-5,1.708136845197218e-5,1.7111072917178486e-5,5.196190268164002e-8,4.478328112955103e-8,5.938118005036418e-8 +Bls12_381_G1_uncompress/6,1.7079106050854815e-5,1.706728657679209e-5,1.7093295150623004e-5,4.497656581091099e-8,3.855884764359697e-8,5.437302539749117e-8 +Bls12_381_G1_uncompress/6,1.7104096006243253e-5,1.709392317883762e-5,1.7114112744913343e-5,3.395599661937652e-8,2.971287029702423e-8,4.0264877538529725e-8 +Bls12_381_G1_uncompress/6,1.7128737646215546e-5,1.712314076767315e-5,1.7134274670718962e-5,1.7901283179146003e-8,1.496916649061788e-8,2.0924757225870162e-8 +Bls12_381_G1_uncompress/6,1.7142774856053916e-5,1.7136952630630504e-5,1.714931613279447e-5,2.0776511921247146e-8,1.627115362835247e-8,2.596061973561991e-8 +Bls12_381_G1_uncompress/6,1.712549977089302e-5,1.711902580615495e-5,1.713086385139637e-5,2.0695696949815427e-8,1.6652032289755293e-8,2.6805840728734344e-8 +Bls12_381_G1_uncompress/6,1.7129296880307367e-5,1.7120484327503882e-5,1.7139862218183325e-5,2.985700330119061e-8,2.5731821946012867e-8,3.698954522126931e-8 +Bls12_381_G1_uncompress/6,1.715318319268842e-5,1.714622381090515e-5,1.7159286569176303e-5,2.0739527933627584e-8,1.720995884452763e-8,2.6467913701082508e-8 +Bls12_381_G1_uncompress/6,1.714313982464461e-5,1.7134138043378292e-5,1.7151574572731596e-5,2.878792281843967e-8,2.4327601392649438e-8,3.5452425646785596e-8 +Bls12_381_G1_uncompress/6,1.712479420412138e-5,1.7118749565617353e-5,1.7130357816455377e-5,1.98972362527866e-8,1.663345869379208e-8,2.403778361413281e-8 +Bls12_381_G1_uncompress/6,1.7112409824687124e-5,1.7101788030566248e-5,1.712341137516919e-5,3.494704132918239e-8,2.953498638953407e-8,4.24825028898834e-8 +Bls12_381_G1_uncompress/6,1.712326427267663e-5,1.7115730116412944e-5,1.7130265715868762e-5,2.54670818497915e-8,2.1924068986933832e-8,3.009395305258765e-8 +Bls12_381_G2_add/24/24,2.9736981706737405e-6,2.9716760001678138e-6,2.975331157254871e-6,6.145107280148123e-9,5.299280364484907e-9,7.1249632708576974e-9 +Bls12_381_G2_add/24/24,2.965395541160648e-6,2.963731406057037e-6,2.967556963010331e-6,6.3286734879747544e-9,4.336512761706596e-9,8.817107987783714e-9 +Bls12_381_G2_add/24/24,2.9826922405991636e-6,2.9794254543609233e-6,2.9872027767312697e-6,1.2743926187597561e-8,1.022535642294928e-8,1.7166472836544245e-8 +Bls12_381_G2_add/24/24,2.996040070883064e-6,2.991046551307815e-6,3.0031655962546385e-6,1.9111735163051712e-8,1.3665680507730657e-8,3.0589922879158643e-8 +Bls12_381_G2_add/24/24,2.9981767761868203e-6,2.9955400734709854e-6,3.0010130213911957e-6,9.106605240691018e-9,7.3067606374374735e-9,1.1261063065459857e-8 +Bls12_381_G2_add/24/24,2.9976802739865647e-6,2.99426879919372e-6,3.001814073181945e-6,1.2225447552180858e-8,1.041605890645705e-8,1.4292169855872238e-8 +Bls12_381_G2_add/24/24,3.0048897080811455e-6,2.9999857095511087e-6,3.0113262065394857e-6,1.8927757700123706e-8,1.501055645346002e-8,2.462373867311562e-8 +Bls12_381_G2_add/24/24,3.003447134931309e-6,2.9988575128478866e-6,3.0090494534519484e-6,1.6578166347660707e-8,1.3920128557201776e-8,2.031872659517852e-8 +Bls12_381_G2_add/24/24,2.9931146994403015e-6,2.9899400759318745e-6,2.9966542553865518e-6,1.136863774649936e-8,9.3498566956391e-9,1.4998952869709914e-8 +Bls12_381_G2_add/24/24,2.9864540605061436e-6,2.983750979668347e-6,2.9915225245366276e-6,1.2202040784610125e-8,6.642894160593401e-9,2.307766402376294e-8 +Bls12_381_G2_add/24/24,2.9954673725139997e-6,2.9931275311200595e-6,2.9975753059307533e-6,7.585518587514507e-9,6.361747296459133e-9,1.0137879953488408e-8 +Bls12_381_G2_add/24/24,2.9950888521607534e-6,2.9922302081816308e-6,2.9985422364717966e-6,1.066901632275759e-8,8.980944142983152e-9,1.3981256363291422e-8 +Bls12_381_G2_add/24/24,2.994930214196684e-6,2.9921397641855777e-6,2.9980806770202172e-6,9.855817300576537e-9,8.265513528463248e-9,1.2162169800815507e-8 +Bls12_381_G2_add/24/24,2.993214488250455e-6,2.989825548361213e-6,2.9968343076294953e-6,1.1586230738359044e-8,9.808087162196286e-9,1.4538675494261732e-8 +Bls12_381_G2_add/24/24,2.9920805016499034e-6,2.9887314702510456e-6,2.9962396989781126e-6,1.3023836525809743e-8,1.1371590094072382e-8,1.4841120068572549e-8 +Bls12_381_G2_add/24/24,3.0128737341371247e-6,3.0085456624766482e-6,3.0181602958562447e-6,1.5726602460668812e-8,1.2922362063824638e-8,2.1031124496371436e-8 +Bls12_381_G2_add/24/24,3.0061228563296464e-6,3.0025085442688124e-6,3.009680269635195e-6,1.1679138591107305e-8,9.74304165815699e-9,1.4526479213859095e-8 +Bls12_381_G2_add/24/24,3.0189719756047505e-6,3.0138192475772287e-6,3.024175398280872e-6,1.7168595550046917e-8,1.4321520462521714e-8,2.1179836195587325e-8 +Bls12_381_G2_add/24/24,3.0115603469832693e-6,3.0069808457079332e-6,3.0164144479407157e-6,1.6469302581513467e-8,1.4467435570440742e-8,1.9325201119093058e-8 +Bls12_381_G2_add/24/24,2.99916675745492e-6,2.9949131913368112e-6,3.0047197349461727e-6,1.65738762439195e-8,1.3348487510508065e-8,2.0724737772820646e-8 +Bls12_381_G2_add/24/24,2.9954468424076537e-6,2.993386379338436e-6,2.998972990836257e-6,8.525074074850284e-9,5.370324212717063e-9,1.5435739415222307e-8 +Bls12_381_G2_add/24/24,2.9988998098465974e-6,2.9947922463051793e-6,3.003234465393133e-6,1.465281181901602e-8,1.2890866708143168e-8,1.6806624146272782e-8 +Bls12_381_G2_add/24/24,2.99695489802467e-6,2.994999270860969e-6,2.999385222707441e-6,7.525781273454764e-9,5.972109239449063e-9,9.791099622398838e-9 +Bls12_381_G2_add/24/24,2.9758271165568823e-6,2.9736647660460145e-6,2.9794831888701163e-6,9.542565374063987e-9,7.03734689863349e-9,1.4208195361736994e-8 +Bls12_381_G2_add/24/24,2.9732085874034355e-6,2.9717995450142784e-6,2.9746879785596227e-6,4.705089482910448e-9,3.850427008856147e-9,6.058938436998029e-9 +Bls12_381_G2_add/24/24,2.9713956007541932e-6,2.968339131091318e-6,2.9752557359637327e-6,1.0847186042215924e-8,8.801022713649022e-9,1.346099850618887e-8 +Bls12_381_G2_add/24/24,2.9873398078724938e-6,2.984487152871663e-6,2.990332810826241e-6,1.014610085596078e-8,8.41693557680634e-9,1.2864003152743745e-8 +Bls12_381_G2_add/24/24,2.9665851425673416e-6,2.96497463453452e-6,2.96899324820456e-6,6.255226681691412e-9,4.421612353854316e-9,8.740441317934544e-9 +Bls12_381_G2_add/24/24,2.9722163502279e-6,2.9693179844205503e-6,2.975592723830148e-6,1.0228317887064261e-8,8.774249435685086e-9,1.1829689144215071e-8 +Bls12_381_G2_add/24/24,2.9642920478641513e-6,2.9627028713969747e-6,2.9661518477883746e-6,5.7071497546952955e-9,4.2910208084452065e-9,7.23861629597547e-9 +Bls12_381_G2_add/24/24,2.96624198133428e-6,2.964635199892315e-6,2.968305390198584e-6,5.993423117501809e-9,4.84234741972244e-9,7.457227220168763e-9 +Bls12_381_G2_add/24/24,2.967317736519224e-6,2.9645098390243555e-6,2.970337348167128e-6,9.62457973017012e-9,7.869341778388069e-9,1.1601429153736086e-8 +Bls12_381_G2_add/24/24,2.9862689848883964e-6,2.982348533740768e-6,2.991888981203686e-6,1.6699041798349245e-8,1.2932768901149427e-8,2.1108182065824837e-8 +Bls12_381_G2_add/24/24,2.984666689094835e-6,2.9815837098241995e-6,2.988322758963694e-6,1.1183553219612041e-8,9.16402137665989e-9,1.4277640498118217e-8 +Bls12_381_G2_add/24/24,2.9641679704875306e-6,2.962450706401357e-6,2.9656914646984856e-6,5.2107034141902305e-9,4.3970899211999874e-9,6.385226632495168e-9 +Bls12_381_G2_add/24/24,2.9813592707120335e-6,2.979986821723005e-6,2.9835495193228966e-6,5.673827430929151e-9,3.7949541254553655e-9,9.832104580821958e-9 +Bls12_381_G2_add/24/24,2.960652189042733e-6,2.9584518275896103e-6,2.9628040171917177e-6,7.1352595661136825e-9,5.8708437403221605e-9,8.713595676229474e-9 +Bls12_381_G2_add/24/24,2.976950025045189e-6,2.974267243881352e-6,2.97959596150526e-6,9.102388256106727e-9,7.713790857676692e-9,1.11197815626677e-8 +Bls12_381_G2_add/24/24,2.9903302162157595e-6,2.984768975762052e-6,2.995901027383356e-6,1.8945969686065416e-8,1.6095774793447742e-8,2.2610840713068005e-8 +Bls12_381_G2_add/24/24,2.9777629680493545e-6,2.9747259196406425e-6,2.9809617198372257e-6,1.0981826035327677e-8,9.087843006989846e-9,1.3613658786818916e-8 +Bls12_381_G2_add/24/24,2.9617153454417675e-6,2.9607711541898902e-6,2.9633639103295335e-6,4.027072898819152e-9,3.1313942978731913e-9,5.378582759246573e-9 +Bls12_381_G2_add/24/24,2.962010051912228e-6,2.9605652309544087e-6,2.9637076254100606e-6,5.658967251121892e-9,4.6162015483259266e-9,7.128754666533964e-9 +Bls12_381_G2_add/24/24,2.9689183042980044e-6,2.966949891930587e-6,2.971095652678785e-6,6.9189703288893005e-9,6.003714932160578e-9,8.063962705223669e-9 +Bls12_381_G2_add/24/24,2.970761680847673e-6,2.9677100491800296e-6,2.9742236916715014e-6,1.104972223445603e-8,8.389435354526354e-9,1.4363254818493199e-8 +Bls12_381_G2_add/24/24,2.9729226388576117e-6,2.9700479552093683e-6,2.976609125147672e-6,1.047036242664836e-8,9.010779262714431e-9,1.2395868264852462e-8 +Bls12_381_G2_add/24/24,2.9798799850779785e-6,2.976661263031548e-6,2.9840510631865603e-6,1.2760019689614628e-8,1.1085087206271648e-8,1.5114212268740175e-8 +Bls12_381_G2_add/24/24,2.991560408969297e-6,2.9884541135770837e-6,2.994673465863695e-6,9.971826357775809e-9,8.357322807270908e-9,1.2569069396124013e-8 +Bls12_381_G2_add/24/24,2.992428569591032e-6,2.9891328252830185e-6,2.995503857970626e-6,1.0992605618658375e-8,9.019992709248556e-9,1.3610273719885763e-8 +Bls12_381_G2_add/24/24,2.9718293197184646e-6,2.9697681889434983e-6,2.97399826363775e-6,7.379786519294263e-9,6.240058485145007e-9,8.903819607430405e-9 +Bls12_381_G2_add/24/24,2.978496265913044e-6,2.9762740737736105e-6,2.9809188963820865e-6,7.71589305622927e-9,6.710236020987497e-9,9.212591315697064e-9 +Bls12_381_G2_add/24/24,2.9956615328253758e-6,2.990612024780774e-6,3.00224843117442e-6,1.9225929012407855e-8,1.6759457104279707e-8,2.218086992857043e-8 +Bls12_381_G2_add/24/24,2.9843851279611754e-6,2.980754138288062e-6,2.9878909247690372e-6,1.2222879546381595e-8,1.0377645481683265e-8,1.4871490714446516e-8 +Bls12_381_G2_add/24/24,2.9771695065305757e-6,2.9753766073861385e-6,2.979034384982816e-6,6.197050685134806e-9,5.335311669405187e-9,7.653795445846131e-9 +Bls12_381_G2_add/24/24,2.966108640430942e-6,2.963687233285959e-6,2.9699200338737406e-6,9.668934076478219e-9,7.272596003461466e-9,1.3876229523687212e-8 +Bls12_381_G2_add/24/24,2.982210792747347e-6,2.979080747918216e-6,2.9852265191236706e-6,1.0198378103507358e-8,8.699246930074557e-9,1.2401379730893728e-8 +Bls12_381_G2_add/24/24,2.975570217933518e-6,2.9732933960869168e-6,2.9782387549591313e-6,8.258017242371355e-9,6.83974860891381e-9,1.076891573944192e-8 +Bls12_381_G2_add/24/24,2.9669746628475716e-6,2.96532217894863e-6,2.9686700017381536e-6,5.626431543910323e-9,4.7727912642220045e-9,6.637434439952253e-9 +Bls12_381_G2_add/24/24,2.9703600127152263e-6,2.9678270084679284e-6,2.973151303424015e-6,9.361949855828534e-9,8.308522131289058e-9,1.0897603864300416e-8 +Bls12_381_G2_add/24/24,2.9650034577196694e-6,2.9630277675701166e-6,2.967647579045956e-6,7.866658498916412e-9,5.7134197435311716e-9,1.1446283767071182e-8 +Bls12_381_G2_add/24/24,2.9655520092221237e-6,2.9636345590773112e-6,2.968097048929716e-6,7.537364040026124e-9,6.24099117467127e-9,9.68741502453154e-9 +Bls12_381_G2_add/24/24,2.969814431540186e-6,2.966475119030686e-6,2.974101752494418e-6,1.356943902756866e-8,1.1037578993425453e-8,1.819343633725957e-8 +Bls12_381_G2_add/24/24,2.9829751187816257e-6,2.9796676904226016e-6,2.9877881202363553e-6,1.3262756650615803e-8,1.0202621159233153e-8,1.7463677032844695e-8 +Bls12_381_G2_add/24/24,2.9679822285451577e-6,2.9654660672615e-6,2.9717514820159374e-6,1.0276289973781713e-8,8.61949916392009e-9,1.495484641943045e-8 +Bls12_381_G2_add/24/24,2.968848996134051e-6,2.967015392735438e-6,2.971637031870424e-6,7.256664367690842e-9,5.316095367611942e-9,1.0187885184111122e-8 +Bls12_381_G2_add/24/24,2.978962620896699e-6,2.977070183514771e-6,2.9814091986396967e-6,7.3566277297694665e-9,5.3827397469543275e-9,1.0221480515151701e-8 +Bls12_381_G2_add/24/24,2.9671395174717775e-6,2.96384766300661e-6,2.9712268455286124e-6,1.21576426302195e-8,8.989651361166934e-9,1.5795384475528433e-8 +Bls12_381_G2_add/24/24,2.980480158008924e-6,2.9772076247953845e-6,2.9847220490668748e-6,1.2166690079594226e-8,9.490467915531257e-9,1.5834017763561116e-8 +Bls12_381_G2_add/24/24,2.983517773881959e-6,2.9802422860452885e-6,2.9868828469451206e-6,1.1447942320514664e-8,9.696206266448314e-9,1.368455569537546e-8 +Bls12_381_G2_add/24/24,2.977621727122436e-6,2.9743592126299737e-6,2.9827569899436885e-6,1.4504911504719705e-8,1.1042140874519647e-8,2.053487602412959e-8 +Bls12_381_G2_add/24/24,2.970137723254097e-6,2.968632454075611e-6,2.9721301369489144e-6,5.697731699579294e-9,4.7380027499727204e-9,7.599162490782979e-9 +Bls12_381_G2_add/24/24,2.971437084131608e-6,2.9690820417336335e-6,2.973752006647907e-6,7.821759857516563e-9,6.8868622249267385e-9,8.973075505795475e-9 +Bls12_381_G2_add/24/24,2.965136562692404e-6,2.9621167587119032e-6,2.9684704808541515e-6,1.0874986683665028e-8,8.806210930272697e-9,1.3666892120375954e-8 +Bls12_381_G2_add/24/24,2.969803087922576e-6,2.968582209748004e-6,2.9712618480207463e-6,4.467892838231034e-9,3.7509642542597164e-9,5.525182459186645e-9 +Bls12_381_G2_add/24/24,2.968187609169012e-6,2.9661269786487918e-6,2.970649078669895e-6,6.996737307222719e-9,5.717898443207775e-9,9.773399644961881e-9 +Bls12_381_G2_add/24/24,2.9771510138071658e-6,2.974952708211487e-6,2.9798313069752717e-6,7.993956336270816e-9,6.474689298256303e-9,1.0808509238183028e-8 +Bls12_381_G2_add/24/24,2.9677279657132535e-6,2.96606101095544e-6,2.9696560087326304e-6,6.002292315155562e-9,4.280092063460099e-9,8.474816315277037e-9 +Bls12_381_G2_add/24/24,2.9738001131607915e-6,2.9713314532087025e-6,2.9772590526372334e-6,1.017333723488978e-8,7.947087168175683e-9,1.3627146960964264e-8 +Bls12_381_G2_add/24/24,2.985465810677689e-6,2.981279798637102e-6,2.9905291037593703e-6,1.5429081912910933e-8,1.2812777218258709e-8,1.8381476362686647e-8 +Bls12_381_G2_add/24/24,2.968158877273843e-6,2.9661688689291352e-6,2.971460134460359e-6,8.363386591980594e-9,6.461658486910413e-9,1.1232955882507679e-8 +Bls12_381_G2_add/24/24,2.965236203483182e-6,2.964176543953746e-6,2.966498467902771e-6,4.060610472487798e-9,3.403605243093423e-9,5.1242784708260664e-9 +Bls12_381_G2_add/24/24,2.9708428144131802e-6,2.968481625378859e-6,2.9737871276841267e-6,8.760785968330756e-9,7.70162407369857e-9,9.978464692717691e-9 +Bls12_381_G2_add/24/24,2.960545095271833e-6,2.9585125668753202e-6,2.963553265068112e-6,8.203225381968687e-9,5.322531381655525e-9,1.1873663977799806e-8 +Bls12_381_G2_add/24/24,2.965279812996982e-6,2.9643902070140985e-6,2.9662913171220765e-6,3.2902270692345747e-9,2.6224843512023545e-9,4.609919287883117e-9 +Bls12_381_G2_add/24/24,2.973032209579164e-6,2.9710249765922276e-6,2.9752560340602445e-6,7.122967699757253e-9,6.18251550044571e-9,8.501671439155112e-9 +Bls12_381_G2_add/24/24,2.9847190748937556e-6,2.981290156975423e-6,2.9896638572275283e-6,1.4379172706270704e-8,1.0774915577782179e-8,1.9584218176767804e-8 +Bls12_381_G2_add/24/24,2.9855023448811884e-6,2.9825467307627135e-6,2.988569200293861e-6,9.790600431604265e-9,8.220498285151741e-9,1.2081775959932757e-8 +Bls12_381_G2_add/24/24,2.979605712186007e-6,2.9762494115851606e-6,2.98378087364283e-6,1.2801894432341068e-8,1.0791262049283081e-8,1.6313857317746365e-8 +Bls12_381_G2_add/24/24,2.9697923197866964e-6,2.9684884185748005e-6,2.971340695752832e-6,4.920684085140328e-9,3.94064835323322e-9,6.042031437670031e-9 +Bls12_381_G2_add/24/24,2.9682918489840017e-6,2.966246492939156e-6,2.970403602218778e-6,7.198118239144779e-9,5.915167283891528e-9,9.33778798360744e-9 +Bls12_381_G2_add/24/24,2.985014190642852e-6,2.981640430817733e-6,2.9889853896442032e-6,1.2592502335801154e-8,1.0461901643796793e-8,1.5242949794101782e-8 +Bls12_381_G2_add/24/24,2.9662790809695954e-6,2.964057524168995e-6,2.9686914971067478e-6,7.999071135687181e-9,6.53809184044408e-9,9.675385304748727e-9 +Bls12_381_G2_add/24/24,2.9696860960404167e-6,2.9672555039525648e-6,2.9721238971257353e-6,8.378552901674078e-9,7.145423704306949e-9,1.06953400241143e-8 +Bls12_381_G2_add/24/24,2.966619684139894e-6,2.9631542063584842e-6,2.9707792231822338e-6,1.257563253498069e-8,9.88691256682825e-9,1.6218851185595007e-8 +Bls12_381_G2_add/24/24,2.9653907089816178e-6,2.962421726743613e-6,2.968137435133781e-6,9.373634953936551e-9,7.959592896496108e-9,1.1660694306622718e-8 +Bls12_381_G2_add/24/24,2.96724589929977e-6,2.9656302325730326e-6,2.9691472154849314e-6,5.920542852700727e-9,5.016255326648512e-9,7.1618399997910105e-9 +Bls12_381_G2_add/24/24,2.9834305660515392e-6,2.980898622461043e-6,2.986477574400522e-6,8.962962418089444e-9,7.574122965731838e-9,1.0966447540653908e-8 +Bls12_381_G2_add/24/24,2.9762920355923265e-6,2.974764345513103e-6,2.977685127156865e-6,4.8940118379327496e-9,4.028168563907869e-9,6.0033467282314656e-9 +Bls12_381_G2_add/24/24,2.985377179028412e-6,2.9827030405750344e-6,2.9884453739785892e-6,1.0083923998851222e-8,8.742518135975421e-9,1.1650455135093218e-8 +Bls12_381_G2_add/24/24,2.9859922627215158e-6,2.9836963404630134e-6,2.988485720042837e-6,7.930198672599208e-9,6.690224109750543e-9,9.654545273811156e-9 +Bls12_381_G2_add/24/24,2.9678256561707323e-6,2.96517399477992e-6,2.970948555062641e-6,9.833360053802266e-9,8.061738918583692e-9,1.2180027756756797e-8 +Bls12_381_G2_scalarMul/1/24,1.9032961940100863e-4,1.902970754341285e-4,1.90365373916414e-4,1.0953427256182402e-7,9.215122408555527e-8,1.3480970860003666e-7 +Bls12_381_G2_scalarMul/2/24,1.9065501491058017e-4,1.9063507705976813e-4,1.9067351610397922e-4,6.902883827391691e-8,5.320784290418282e-8,9.41641019125264e-8 +Bls12_381_G2_scalarMul/3/24,1.9117931465798368e-4,1.9115600171500067e-4,1.9120469110711066e-4,7.80849787118616e-8,6.060445376742951e-8,1.1177253819544527e-7 +Bls12_381_G2_scalarMul/4/24,1.9148604504118735e-4,1.9144750287599315e-4,1.9152546052027906e-4,1.2913711074217424e-7,1.0917505689195388e-7,1.5496075627543865e-7 +Bls12_381_G2_scalarMul/5/24,1.916914464741647e-4,1.9166418652386336e-4,1.9171887364006482e-4,8.716253954381015e-8,6.931752728170215e-8,1.0719416548770617e-7 +Bls12_381_G2_scalarMul/6/24,1.917812123379205e-4,1.9174009328834095e-4,1.918221150751938e-4,1.363875409651994e-7,1.0957279069860971e-7,1.6906288409751608e-7 +Bls12_381_G2_scalarMul/7/24,1.918731503427578e-4,1.9184380780327861e-4,1.9190155572418506e-4,9.6606281461622e-8,7.94911142117535e-8,1.2561721808579348e-7 +Bls12_381_G2_scalarMul/8/24,1.9206898021945508e-4,1.9204234506015356e-4,1.9209187701800043e-4,8.294588970933231e-8,6.558177127217265e-8,1.1128072978913066e-7 +Bls12_381_G2_scalarMul/9/24,1.92171225316066e-4,1.9214677699775032e-4,1.921972234606312e-4,8.781619843754846e-8,7.281047771255565e-8,1.215691091335416e-7 +Bls12_381_G2_scalarMul/10/24,1.9211321335483979e-4,1.9208899883375188e-4,1.9213434174124454e-4,7.466588525122683e-8,6.31204562388303e-8,9.028864548287685e-8 +Bls12_381_G2_scalarMul/11/24,1.9212684255056866e-4,1.9210524662127088e-4,1.9215000619095284e-4,8.005989798683718e-8,6.994674778157471e-8,9.488014969231632e-8 +Bls12_381_G2_scalarMul/12/24,1.9220871828413844e-4,1.921817967557458e-4,1.922356156674873e-4,9.34679830897946e-8,7.391130577738967e-8,1.2327846870478737e-7 +Bls12_381_G2_scalarMul/13/24,1.9216640943096926e-4,1.9210823544445663e-4,1.9221946347244034e-4,1.8939839960295795e-7,1.6484014741626501e-7,2.2877456066633806e-7 +Bls12_381_G2_scalarMul/14/24,1.922359761928417e-4,1.9218996990050531e-4,1.9227453503330426e-4,1.4038412727167825e-7,1.1299132110720099e-7,1.775522641488016e-7 +Bls12_381_G2_scalarMul/15/24,1.9226153949587557e-4,1.922370800097808e-4,1.9229532068530344e-4,9.782999011330016e-8,7.66848641586872e-8,1.314730505023173e-7 +Bls12_381_G2_scalarMul/16/24,1.9246820435905347e-4,1.9243847649236018e-4,1.9249656262832932e-4,1.0098046389037627e-7,8.041962707092735e-8,1.3221385753907666e-7 +Bls12_381_G2_scalarMul/17/24,1.9246732895781608e-4,1.9243102663959723e-4,1.9251215182879112e-4,1.329674935022201e-7,1.041520466431177e-7,2.005088906470905e-7 +Bls12_381_G2_scalarMul/18/24,1.9255430400498855e-4,1.9252903475707725e-4,1.9257994634634627e-4,9.071692971906488e-8,7.397668203663364e-8,1.2072171616994365e-7 +Bls12_381_G2_scalarMul/19/24,1.9266430984328362e-4,1.9263502808833933e-4,1.9268903270463003e-4,9.35030067567347e-8,7.152210986106002e-8,1.4512134661969283e-7 +Bls12_381_G2_scalarMul/20/24,1.9271723173289163e-4,1.926885379285281e-4,1.9274729944822737e-4,1.0052622232661375e-7,7.930748317476022e-8,1.316453908006608e-7 +Bls12_381_G2_scalarMul/21/24,1.927597214231244e-4,1.9273623422412883e-4,1.9278492730110213e-4,8.051259987598608e-8,6.454615033409567e-8,1.0474058579401086e-7 +Bls12_381_G2_scalarMul/22/24,1.927418452478408e-4,1.9271582664769603e-4,1.9276154115472894e-4,7.598818315145974e-8,5.997440095377039e-8,9.612845842256025e-8 +Bls12_381_G2_scalarMul/23/24,1.9291500652625598e-4,1.9288698648766998e-4,1.929494516700063e-4,1.0068213329944186e-7,8.172478411106617e-8,1.314716346211375e-7 +Bls12_381_G2_scalarMul/24/24,1.9302182679164148e-4,1.929954248200882e-4,1.9305244297987105e-4,9.316424784468583e-8,7.44177712801765e-8,1.1895590568761466e-7 +Bls12_381_G2_scalarMul/25/24,1.9296064525211448e-4,1.9293393197971812e-4,1.9298594681441423e-4,8.697694219650107e-8,7.497277798993673e-8,1.0659943762345213e-7 +Bls12_381_G2_scalarMul/26/24,1.9298291193321307e-4,1.929468499159653e-4,1.9302165365203634e-4,1.3040264342873238e-7,1.1585043941278772e-7,1.5541782821288564e-7 +Bls12_381_G2_scalarMul/27/24,1.9318661707803925e-4,1.9315471613968088e-4,1.9321059806674267e-4,9.380750179968087e-8,7.032127268633643e-8,1.314115598044666e-7 +Bls12_381_G2_scalarMul/28/24,1.9314709345414315e-4,1.9311289899288087e-4,1.9317752463317764e-4,1.1829164899572587e-7,9.947356539419729e-8,1.4569248067122194e-7 +Bls12_381_G2_scalarMul/29/24,1.9321486602087273e-4,1.9316416612496546e-4,1.9326214107805577e-4,1.625088847970139e-7,1.4482919887858038e-7,1.90785677051313e-7 +Bls12_381_G2_scalarMul/30/24,1.9335157397145223e-4,1.9329401828845454e-4,1.9342134221057272e-4,2.2203978433703217e-7,1.9126731322547325e-7,2.580543560666212e-7 +Bls12_381_G2_scalarMul/31/24,1.9346923516404664e-4,1.9344557396152988e-4,1.9349426167429215e-4,8.300340989831228e-8,6.942905211408766e-8,1.0269449321443041e-7 +Bls12_381_G2_scalarMul/32/24,1.9358716592614124e-4,1.935527291843043e-4,1.9362759506047408e-4,1.3167687059896288e-7,1.0335656761249771e-7,1.6347219231237477e-7 +Bls12_381_G2_scalarMul/33/24,1.934240998647194e-4,1.9336104150767663e-4,1.9348617755170886e-4,2.0753402012418665e-7,1.909504421872294e-7,2.27876412860199e-7 +Bls12_381_G2_scalarMul/34/24,1.934271799979965e-4,1.9337630424993093e-4,1.934671447098504e-4,1.5253455209438197e-7,1.2055521239859895e-7,1.9156311806832375e-7 +Bls12_381_G2_scalarMul/35/24,1.937131716853273e-4,1.9365999491386256e-4,1.937480392070652e-4,1.477428155660961e-7,1.16873635961233e-7,1.9465323934966958e-7 +Bls12_381_G2_scalarMul/36/24,1.937458238586694e-4,1.937113552501438e-4,1.937789380552052e-4,1.1379228799845682e-7,9.34898740916985e-8,1.3958860408327563e-7 +Bls12_381_G2_scalarMul/37/24,1.9383881517437152e-4,1.938054203366415e-4,1.938740322275885e-4,1.1311988401708431e-7,9.135067261392483e-8,1.4660015193196152e-7 +Bls12_381_G2_scalarMul/38/24,1.9391406502541558e-4,1.9387706777399577e-4,1.9394865664902654e-4,1.1995076991625785e-7,1.0168686776124848e-7,1.4466245072882256e-7 +Bls12_381_G2_scalarMul/39/24,1.937700234698548e-4,1.9372654340990087e-4,1.938138052181463e-4,1.480768502934024e-7,1.218654349962624e-7,1.7905870910560512e-7 +Bls12_381_G2_scalarMul/40/24,1.9392582762600097e-4,1.938956139390761e-4,1.9395628119057116e-4,1.0418897494107408e-7,8.638739801351426e-8,1.381144441362998e-7 +Bls12_381_G2_scalarMul/41/24,1.9419976798993555e-4,1.9415845129992402e-4,1.942378953057657e-4,1.3075097805162563e-7,1.0383023870412928e-7,1.6431154947012645e-7 +Bls12_381_G2_scalarMul/42/24,1.942228154681602e-4,1.941787080540328e-4,1.942625154714126e-4,1.381648311346227e-7,1.0846396240617614e-7,1.8449348710625295e-7 +Bls12_381_G2_scalarMul/43/24,1.9434019570718658e-4,1.9430812911370066e-4,1.943701345067494e-4,1.0557631713895976e-7,8.796492481676738e-8,1.2745425409204566e-7 +Bls12_381_G2_scalarMul/44/24,1.9417478400177716e-4,1.941340756802799e-4,1.9421234157244546e-4,1.3918297373695412e-7,1.1645956605379022e-7,1.7084116838079675e-7 +Bls12_381_G2_scalarMul/45/24,1.944261021282793e-4,1.9439353061868948e-4,1.9445569442699557e-4,1.0548457418641518e-7,8.829550791937731e-8,1.2743116289202925e-7 +Bls12_381_G2_scalarMul/46/24,1.9443003452631735e-4,1.9440307403172387e-4,1.9445827722791128e-4,9.096846440219663e-8,7.377755370175465e-8,1.1294805658134312e-7 +Bls12_381_G2_scalarMul/47/24,1.9470135805678185e-4,1.946729885483534e-4,1.9472993388786573e-4,9.844212637334415e-8,8.213649677702714e-8,1.2077058355336682e-7 +Bls12_381_G2_scalarMul/48/24,1.9454132060859274e-4,1.9449510527365155e-4,1.9459162436910374e-4,1.5604489359184318e-7,1.3511736993765718e-7,1.8262008719267837e-7 +Bls12_381_G2_scalarMul/49/24,1.947361608694395e-4,1.9469613055529588e-4,1.9477047001656653e-4,1.2018389562597882e-7,9.88398566617902e-8,1.5169946747081822e-7 +Bls12_381_G2_scalarMul/50/24,1.9448069284996297e-4,1.9444680136913964e-4,1.9451275268752907e-4,1.1405526390951928e-7,9.748060120822695e-8,1.417458746233421e-7 +Bls12_381_G2_scalarMul/51/24,1.9497638156446676e-4,1.9493606156912398e-4,1.9501083607033665e-4,1.199157912089787e-7,1.0302595599998991e-7,1.446320072847695e-7 +Bls12_381_G2_scalarMul/52/24,1.949933079651072e-4,1.94947649152017e-4,1.9504899874829394e-4,1.627510752605169e-7,1.401915282591761e-7,1.9575634153868637e-7 +Bls12_381_G2_scalarMul/53/24,1.951785896332873e-4,1.951408787642232e-4,1.9521487263801724e-4,1.261956794379281e-7,1.0457006236433911e-7,1.6276820027460507e-7 +Bls12_381_G2_scalarMul/54/24,1.950816215659596e-4,1.950273981880541e-4,1.9511947971253082e-4,1.5461541722441316e-7,1.1753141290023021e-7,2.0304717591781735e-7 +Bls12_381_G2_scalarMul/55/24,1.95325951116632e-4,1.9529045022733193e-4,1.9536659132075908e-4,1.2290227546841887e-7,9.639517034344042e-8,1.6265893308404938e-7 +Bls12_381_G2_scalarMul/56/24,1.9539390413788845e-4,1.9534734693566855e-4,1.9545297939188886e-4,1.6964300710397658e-7,1.334732108487209e-7,2.2337537237569487e-7 +Bls12_381_G2_scalarMul/57/24,1.954245694426507e-4,1.9538661863522289e-4,1.9546134098285755e-4,1.2472382335479642e-7,1.0403780519285238e-7,1.5050423817789153e-7 +Bls12_381_G2_scalarMul/58/24,1.9528279943020714e-4,1.9522691318669022e-4,1.953330660311934e-4,1.7975054015466118e-7,1.4473128030622008e-7,2.2249550106679696e-7 +Bls12_381_G2_scalarMul/59/24,1.9583494433455316e-4,1.9578711752483475e-4,1.9588394805777643e-4,1.645459336993004e-7,1.3197834061648528e-7,2.3075810141021057e-7 +Bls12_381_G2_scalarMul/60/24,1.9570802964879045e-4,1.9565202819090752e-4,1.9574997776882839e-4,1.521814384296767e-7,1.1830552589420249e-7,2.0380376038218623e-7 +Bls12_381_G2_scalarMul/61/24,1.9576500580363002e-4,1.9573355488997717e-4,1.95800643750594e-4,1.0786127297349449e-7,9.165504202564267e-8,1.3015793514433494e-7 +Bls12_381_G2_scalarMul/62/24,1.9599770032473256e-4,1.9596624113842306e-4,1.960332899653824e-4,1.1773734814496681e-7,9.517403657244383e-8,1.5001448531943147e-7 +Bls12_381_G2_scalarMul/63/24,1.961226252351421e-4,1.9609297045006176e-4,1.961523184191991e-4,9.914053734212212e-8,8.496844828450262e-8,1.1753789013317011e-7 +Bls12_381_G2_scalarMul/64/24,1.9583445326972257e-4,1.957772524739501e-4,1.9588951877737838e-4,1.8661886703587926e-7,1.5740501760637e-7,2.510315349287144e-7 +Bls12_381_G2_scalarMul/65/24,1.961052256380373e-4,1.9605982127696357e-4,1.9614639571053507e-4,1.4445999655925427e-7,1.2017325033953563e-7,1.8260532833678494e-7 +Bls12_381_G2_scalarMul/66/24,1.9635889937128802e-4,1.9631484358440836e-4,1.9639795504182339e-4,1.3941026791049093e-7,1.124002465913192e-7,1.829194874880786e-7 +Bls12_381_G2_scalarMul/67/24,1.9623164634516814e-4,1.9618085448383954e-4,1.9631111549399207e-4,2.0556646892091434e-7,1.385554276832636e-7,3.360238141801525e-7 +Bls12_381_G2_scalarMul/68/24,1.9649896502263136e-4,1.964622791519786e-4,1.9654602084172247e-4,1.444767535739334e-7,1.1635180886216561e-7,1.8930957596441794e-7 +Bls12_381_G2_scalarMul/69/24,1.9660491835491608e-4,1.9657343621971437e-4,1.9663935627955298e-4,1.0929702291901325e-7,8.781082663393748e-8,1.411391947823243e-7 +Bls12_381_G2_scalarMul/70/24,1.967827776082398e-4,1.967285619315735e-4,1.9682676833063166e-4,1.7155361156228254e-7,1.4669642059455479e-7,2.081431599023043e-7 +Bls12_381_G2_scalarMul/71/24,1.9627138206384948e-4,1.9623932881707723e-4,1.963076078740601e-4,1.1810037275094704e-7,9.337971042026297e-8,1.536056545926484e-7 +Bls12_381_G2_scalarMul/72/24,1.9717841190746425e-4,1.9713477470808375e-4,1.9722248927910496e-4,1.4469900808757587e-7,1.238118511393734e-7,1.701471990965112e-7 +Bls12_381_G2_scalarMul/73/24,1.9669189919210663e-4,1.9662906868893223e-4,1.9675369266561842e-4,2.1131515508206557e-7,1.8648363356217474e-7,2.388928882742591e-7 +Bls12_381_G2_scalarMul/74/24,1.970440740013965e-4,1.9699530278522974e-4,1.9709313725764638e-4,1.6042268945200705e-7,1.3682218688410646e-7,1.866257802353975e-7 +Bls12_381_G2_scalarMul/75/24,1.9683207711653026e-4,1.967950567751086e-4,1.9687058729997667e-4,1.3175007063447288e-7,1.0708160325259963e-7,1.66010287024528e-7 +Bls12_381_G2_scalarMul/76/24,1.9726348069059045e-4,1.97233756049257e-4,1.9729416112635348e-4,9.530562536129634e-8,7.920413995074457e-8,1.2076982376496314e-7 +Bls12_381_G2_scalarMul/77/24,1.973843102515428e-4,1.972999969471908e-4,1.9744865628203232e-4,2.4390143452403977e-7,2.1536825242262668e-7,2.790401018927799e-7 +Bls12_381_G2_scalarMul/78/24,1.9731514624511158e-4,1.972639654633348e-4,1.9735454627931942e-4,1.4997802619044044e-7,1.1376076269432455e-7,2.0671700886614809e-7 +Bls12_381_G2_scalarMul/79/24,1.977483323660596e-4,1.9770642145106382e-4,1.9780223905639286e-4,1.5759761352840068e-7,1.1981389513140428e-7,2.258952659451989e-7 +Bls12_381_G2_scalarMul/80/24,1.973805036270481e-4,1.9735234716813566e-4,1.974119996906846e-4,1.0128654570173993e-7,8.571825184234574e-8,1.2651286222275348e-7 +Bls12_381_G2_scalarMul/81/24,1.9792109310237611e-4,1.9786203537696965e-4,1.9797362495060995e-4,1.8965452288302444e-7,1.514048441826357e-7,2.4031095729239333e-7 +Bls12_381_G2_scalarMul/82/24,1.9799890505443118e-4,1.9796262657375372e-4,1.9803882323107748e-4,1.2162821360358775e-7,1.0139848240399463e-7,1.50262654123461e-7 +Bls12_381_G2_scalarMul/83/24,1.9790322823911257e-4,1.97825648195899e-4,1.9796432288636545e-4,2.39808180069452e-7,2.094117688017608e-7,2.8408416216441836e-7 +Bls12_381_G2_scalarMul/84/24,1.9826054074270584e-4,1.9822118929522514e-4,1.9829718556302607e-4,1.2496643444958838e-7,9.995176631838573e-8,1.5788948232636163e-7 +Bls12_381_G2_scalarMul/85/24,1.9834887798602695e-4,1.9830622584312026e-4,1.9839209964041672e-4,1.5314010455462242e-7,1.284650105849195e-7,1.856399066946127e-7 +Bls12_381_G2_scalarMul/86/24,1.9772759545085437e-4,1.9767179156273464e-4,1.9779101287471584e-4,2.0261724357013375e-7,1.703370763931331e-7,2.437454500398476e-7 +Bls12_381_G2_scalarMul/87/24,1.9882876722587196e-4,1.9878628749003268e-4,1.9887684570098487e-4,1.5031907447048195e-7,1.2475187009213676e-7,1.881218642239226e-7 +Bls12_381_G2_scalarMul/88/24,1.9885961220108409e-4,1.988200204216463e-4,1.9890464108074602e-4,1.4363886920894999e-7,1.1687635684502044e-7,1.8845536407987915e-7 +Bls12_381_G2_scalarMul/89/24,1.990542260474807e-4,1.9900935891584506e-4,1.9909567237350194e-4,1.4408727639182022e-7,1.1867420842097267e-7,1.8227243277885096e-7 +Bls12_381_G2_scalarMul/90/24,1.9873015558114824e-4,1.9869745364374647e-4,1.9876438068973596e-4,1.1659539584990398e-7,8.977639467038443e-8,1.764237768940171e-7 +Bls12_381_G2_scalarMul/91/24,1.992048098723274e-4,1.9912267773746742e-4,1.9927178525096763e-4,2.522684115735243e-7,2.0690454968963164e-7,3.044536561385284e-7 +Bls12_381_G2_scalarMul/92/24,1.991529058108134e-4,1.9909956979767958e-4,1.9920119875180183e-4,1.753551402458399e-7,1.4811188536679065e-7,2.099843152710278e-7 +Bls12_381_G2_scalarMul/93/24,1.9937129367631867e-4,1.9930833986129458e-4,1.9942239149409863e-4,1.9508289688631965e-7,1.629976046081723e-7,2.4853990276865687e-7 +Bls12_381_G2_scalarMul/94/24,1.9908957082521365e-4,1.9902760555923796e-4,1.9913853401680052e-4,1.8657653812079067e-7,1.5946326646105823e-7,2.298016634766633e-7 +Bls12_381_G2_scalarMul/95/24,1.9955883510772458e-4,1.9951182639740727e-4,1.9960100709214058e-4,1.4875199956443023e-7,1.2472995455469654e-7,1.906586460558608e-7 +Bls12_381_G2_scalarMul/96/24,1.992700365359192e-4,1.992161383405006e-4,1.993171697387052e-4,1.8207326642881358e-7,1.4504839631754164e-7,2.4134213264785963e-7 +Bls12_381_G2_scalarMul/97/24,1.9978029717638313e-4,1.997262227812813e-4,1.9983622158353058e-4,1.8970241435145327e-7,1.4374124553562597e-7,2.5359878350353787e-7 +Bls12_381_G2_scalarMul/98/24,1.9890168938228777e-4,1.9882468954511253e-4,1.9899680158793603e-4,2.977813254588543e-7,2.536307493378622e-7,3.4567461598596727e-7 +Bls12_381_G2_scalarMul/99/24,1.9964046951422373e-4,1.9957603743909165e-4,1.9972975653813563e-4,2.626481553767501e-7,2.1060241042760698e-7,3.1337113251249425e-7 +Bls12_381_G2_scalarMul/100/24,2.0009213678244965e-4,2.0003602380397104e-4,2.0014834404700354e-4,1.9341693310099787e-7,1.6193424643347064e-7,2.3580657017689607e-7 +Bls12_381_G2_neg/24,8.165025390029668e-7,8.135059599146181e-7,8.187771083294102e-7,8.309410313217804e-9,6.283105226386016e-9,1.0783472464026722e-8 +Bls12_381_G2_neg/24,8.223792437499628e-7,8.211266856194685e-7,8.238279070705641e-7,4.60717960995362e-9,3.709889610674947e-9,5.913993220072744e-9 +Bls12_381_G2_neg/24,8.181801165249636e-7,8.171344683584316e-7,8.189775523636975e-7,2.925031826292866e-9,2.345128247410826e-9,3.929671217060336e-9 +Bls12_381_G2_neg/24,8.209888044621888e-7,8.198655365271114e-7,8.223789696452296e-7,3.900189258056309e-9,3.3197808249947645e-9,4.827028806139692e-9 +Bls12_381_G2_neg/24,8.180914090963691e-7,8.168790671957458e-7,8.193131915182997e-7,4.277835943036171e-9,3.505083924959871e-9,5.761840105168265e-9 +Bls12_381_G2_neg/24,8.210979103318815e-7,8.198718491862157e-7,8.225284311853184e-7,4.289554637497006e-9,3.2452682013517535e-9,5.938269568797745e-9 +Bls12_381_G2_neg/24,8.22541820655492e-7,8.214341445912403e-7,8.237737561778958e-7,3.964037071216265e-9,3.045330914778998e-9,5.672322669575708e-9 +Bls12_381_G2_neg/24,8.227581729641634e-7,8.216659493294745e-7,8.242184009441144e-7,4.3100735899638976e-9,3.5989496230379927e-9,5.420819160090112e-9 +Bls12_381_G2_neg/24,8.212840954243823e-7,8.200704885892296e-7,8.227347282226674e-7,4.297542600633517e-9,3.461055407518841e-9,5.443312786405298e-9 +Bls12_381_G2_neg/24,8.181902151413586e-7,8.170210216108194e-7,8.192971922831195e-7,3.832114881533683e-9,2.997441868480087e-9,4.686861096033712e-9 +Bls12_381_G2_neg/24,8.179147340023666e-7,8.167680120276008e-7,8.189208990013183e-7,3.6493492839387645e-9,3.0733354657250606e-9,4.4073076973255926e-9 +Bls12_381_G2_neg/24,8.256346858858196e-7,8.243070536155883e-7,8.272724399457183e-7,4.758861581532228e-9,3.805920373733291e-9,6.003029192535229e-9 +Bls12_381_G2_neg/24,8.217386264443312e-7,8.203155764118503e-7,8.232758404989558e-7,4.99393730877653e-9,4.277795546909765e-9,6.130476374425383e-9 +Bls12_381_G2_neg/24,8.202245268364968e-7,8.188954328029333e-7,8.215037058360658e-7,4.267380002531652e-9,3.4541086081562628e-9,5.250675014269046e-9 +Bls12_381_G2_neg/24,8.246396089167911e-7,8.234233417224573e-7,8.258938099720474e-7,4.245882046335769e-9,3.4161879737546177e-9,5.203697463482781e-9 +Bls12_381_G2_neg/24,8.234957269771587e-7,8.220385681470262e-7,8.248136227776723e-7,4.7333802525267445e-9,4.047535895014857e-9,5.686516739504371e-9 +Bls12_381_G2_neg/24,8.217554127923706e-7,8.2046837971597e-7,8.232043330226698e-7,4.50676243067893e-9,3.7320238189619915e-9,5.860206583749289e-9 +Bls12_381_G2_neg/24,8.180641621303969e-7,8.169252941792044e-7,8.190823041628422e-7,3.5898513635241395e-9,2.9519626730943887e-9,4.594857678330991e-9 +Bls12_381_G2_neg/24,8.172293948171187e-7,8.159578862923859e-7,8.183500573024473e-7,3.975781231087608e-9,3.09791850102086e-9,5.572338780651228e-9 +Bls12_381_G2_neg/24,8.155415297834892e-7,8.141601734272131e-7,8.168657062194893e-7,4.3372417136767584e-9,3.5223766908569355e-9,5.403463533940181e-9 +Bls12_381_G2_neg/24,8.200453673101304e-7,8.190666624258804e-7,8.210377535067397e-7,3.347022670427123e-9,2.6564980003041562e-9,4.503643332601171e-9 +Bls12_381_G2_neg/24,8.216481303278066e-7,8.205869640655122e-7,8.231557382697603e-7,4.269069964687739e-9,3.416939020593677e-9,5.6057427239621424e-9 +Bls12_381_G2_neg/24,8.221065909883392e-7,8.208192047556616e-7,8.233204469146156e-7,4.043673282584752e-9,3.4562125484023544e-9,4.7838160946114205e-9 +Bls12_381_G2_neg/24,8.269321580244736e-7,8.258934767969775e-7,8.278872008062487e-7,3.2162807211794755e-9,2.6704986147678588e-9,4.234718272145348e-9 +Bls12_381_G2_neg/24,8.231092025099522e-7,8.21604028272716e-7,8.247843604132669e-7,5.2383226391167e-9,4.08368872535258e-9,6.938905230635081e-9 +Bls12_381_G2_neg/24,8.160870114590354e-7,8.150312744575256e-7,8.171838217755016e-7,3.6805980370833552e-9,2.952521066031094e-9,4.694831023232767e-9 +Bls12_381_G2_neg/24,8.210766391472697e-7,8.20086863970563e-7,8.218992679235827e-7,2.957816929996325e-9,2.4076680902414277e-9,3.957801799463115e-9 +Bls12_381_G2_neg/24,8.228635238353522e-7,8.21811635369837e-7,8.240468126814751e-7,3.751974108247473e-9,3.115450199816162e-9,4.656793316266221e-9 +Bls12_381_G2_neg/24,8.217986047228534e-7,8.205352585463356e-7,8.232383408824333e-7,4.25426168190872e-9,3.4651788092649467e-9,5.37103525929452e-9 +Bls12_381_G2_neg/24,8.228702809631868e-7,8.21571856676123e-7,8.240975630538972e-7,4.284103253909442e-9,3.55857407686724e-9,5.331136937705556e-9 +Bls12_381_G2_neg/24,8.188711806419815e-7,8.174817414550641e-7,8.205378275708677e-7,4.9200749343888745e-9,4.030367728705668e-9,6.292590895610533e-9 +Bls12_381_G2_neg/24,8.222714740730847e-7,8.209489083821487e-7,8.238342236219104e-7,4.744474061379681e-9,3.852495509795029e-9,6.368772924190886e-9 +Bls12_381_G2_neg/24,8.20359631236589e-7,8.193237080304285e-7,8.216057755171697e-7,3.7113980285450372e-9,3.0335964330630043e-9,4.688115189543908e-9 +Bls12_381_G2_neg/24,8.23337495832339e-7,8.22275990349708e-7,8.244435430436498e-7,3.7346715430568606e-9,2.8209134383282047e-9,4.9848054986933885e-9 +Bls12_381_G2_neg/24,8.205938091674416e-7,8.189949403897589e-7,8.219810574835334e-7,4.978382311997323e-9,3.652722975515285e-9,7.69573391496259e-9 +Bls12_381_G2_neg/24,8.173930076635207e-7,8.159507988548937e-7,8.190198795200279e-7,4.975342886238448e-9,3.726543724789974e-9,7.189629888584514e-9 +Bls12_381_G2_neg/24,8.212102979669461e-7,8.199602619781425e-7,8.226570248102791e-7,4.516996387815167e-9,3.3916737922332717e-9,7.370797973182132e-9 +Bls12_381_G2_neg/24,8.185728661394896e-7,8.174318561751165e-7,8.197253736345792e-7,3.884611375305405e-9,3.176002270945951e-9,4.870227978319468e-9 +Bls12_381_G2_neg/24,8.222583950011073e-7,8.211241143208683e-7,8.23717786725287e-7,4.310606118786197e-9,3.573901522008454e-9,5.28925709512383e-9 +Bls12_381_G2_neg/24,8.189288025534292e-7,8.176560851331877e-7,8.202091479715124e-7,4.24612151166824e-9,3.3688837878598267e-9,5.376549408409304e-9 +Bls12_381_G2_neg/24,8.189188068339852e-7,8.179498411654527e-7,8.199301035151883e-7,3.3232622399023546e-9,2.696413290960082e-9,4.137242007915442e-9 +Bls12_381_G2_neg/24,8.186481091574993e-7,8.176809962169499e-7,8.196348207329992e-7,3.3823791665745974e-9,2.849317169409023e-9,4.092762890574509e-9 +Bls12_381_G2_neg/24,8.180520128844817e-7,8.167999908518439e-7,8.198378182621497e-7,4.918668347290406e-9,3.896002889455705e-9,6.597945251793547e-9 +Bls12_381_G2_neg/24,8.230733002868383e-7,8.216762859604294e-7,8.244604555065426e-7,4.802327220054247e-9,3.855500852857544e-9,6.498369605918756e-9 +Bls12_381_G2_neg/24,8.223527204658056e-7,8.207581960709352e-7,8.236225629298993e-7,4.740251294888563e-9,3.941415408338229e-9,6.048139460717157e-9 +Bls12_381_G2_neg/24,8.192435423264568e-7,8.181245443971913e-7,8.202451666088557e-7,3.4748737693830544e-9,2.91656501019667e-9,4.307638715298557e-9 +Bls12_381_G2_neg/24,8.193222574159327e-7,8.18159104859325e-7,8.205193600468921e-7,3.828246604094046e-9,3.215775857842563e-9,4.725640636114352e-9 +Bls12_381_G2_neg/24,8.205213047374816e-7,8.191109053308442e-7,8.217912892844425e-7,4.47808861202354e-9,3.763103139565464e-9,5.760294271204778e-9 +Bls12_381_G2_neg/24,8.197501685651303e-7,8.189340325228784e-7,8.206599476728954e-7,2.9162761511229074e-9,2.45037497129756e-9,3.649302973256489e-9 +Bls12_381_G2_neg/24,8.247243417103342e-7,8.234768300703101e-7,8.261009293316214e-7,4.224689144174743e-9,3.5932225748593145e-9,5.110969918570417e-9 +Bls12_381_G2_neg/24,8.205191634577362e-7,8.190745475988523e-7,8.219594257469697e-7,4.760896153895608e-9,4.0402634885058826e-9,5.756315183963205e-9 +Bls12_381_G2_neg/24,8.190844067485667e-7,8.178558773159264e-7,8.201280975310197e-7,3.751924983907761e-9,3.1046094666344957e-9,4.743298356377524e-9 +Bls12_381_G2_neg/24,8.201994625035483e-7,8.191982470142186e-7,8.211357657795103e-7,3.2678027944520284e-9,2.642888430629559e-9,4.5716133226835625e-9 +Bls12_381_G2_neg/24,8.21437157916288e-7,8.201308060826857e-7,8.227135298730413e-7,4.4612407720970514e-9,3.4358280786888325e-9,6.15066687092843e-9 +Bls12_381_G2_neg/24,8.175926278044614e-7,8.166363280195593e-7,8.186476575102908e-7,3.414170108670917e-9,2.772269082338294e-9,4.3231624521093235e-9 +Bls12_381_G2_neg/24,8.255453794215088e-7,8.24277922612607e-7,8.269026634666535e-7,4.176930665972821e-9,3.4788488018831224e-9,5.12398691602075e-9 +Bls12_381_G2_neg/24,8.209100286781569e-7,8.197543149388397e-7,8.220850967591068e-7,4.031383200958436e-9,3.4146913955495536e-9,5.0800181438863294e-9 +Bls12_381_G2_neg/24,8.187438335770291e-7,8.175848129844904e-7,8.200029931601324e-7,3.960936926610357e-9,3.273349356962628e-9,4.764267350817988e-9 +Bls12_381_G2_neg/24,8.140441831974156e-7,8.125823647153128e-7,8.151141700669117e-7,4.086387340973423e-9,2.9651238544468537e-9,5.951973641608183e-9 +Bls12_381_G2_neg/24,8.231396953651706e-7,8.218716540927884e-7,8.243342221916145e-7,4.283726216656569e-9,3.311488499642332e-9,5.759938915834309e-9 +Bls12_381_G2_neg/24,8.188484816560794e-7,8.176370695585325e-7,8.201335021710166e-7,3.995306435264431e-9,3.1839661485866942e-9,5.3773471935575855e-9 +Bls12_381_G2_neg/24,8.182184530547253e-7,8.172263320904433e-7,8.191277913327964e-7,3.304053917742991e-9,2.86977254598818e-9,4.001458280773409e-9 +Bls12_381_G2_neg/24,8.165182519076756e-7,8.15477581073762e-7,8.176367946292148e-7,3.512769269400729e-9,2.825531151490444e-9,4.627850840444714e-9 +Bls12_381_G2_neg/24,8.186708278301577e-7,8.177952348040468e-7,8.197218089747442e-7,3.3436759895714322e-9,2.7390637565518236e-9,4.5938815651404144e-9 +Bls12_381_G2_neg/24,8.198449590225352e-7,8.190284575501525e-7,8.208086148894005e-7,3.187680461061727e-9,2.5527929920798353e-9,4.194033682218205e-9 +Bls12_381_G2_neg/24,8.177359371019742e-7,8.168130828819296e-7,8.189632687344693e-7,3.48501167082842e-9,2.4828630515125895e-9,4.96807932312784e-9 +Bls12_381_G2_neg/24,8.173543370184284e-7,8.160952047898032e-7,8.186751444156636e-7,4.44698368651926e-9,3.4346793427151e-9,5.768257103466554e-9 +Bls12_381_G2_neg/24,8.202398197640001e-7,8.188456493543971e-7,8.213373255287434e-7,4.203161370278651e-9,3.2933974886356533e-9,5.452194196366044e-9 +Bls12_381_G2_neg/24,8.21483071037575e-7,8.204218903688084e-7,8.228027676013975e-7,4.004982623189788e-9,3.2710394768756417e-9,4.958080289628142e-9 +Bls12_381_G2_neg/24,8.202673176738774e-7,8.191516450801436e-7,8.212935741520998e-7,3.635890236837258e-9,2.8813577313490556e-9,4.920265874736836e-9 +Bls12_381_G2_neg/24,8.163708953055466e-7,8.14751418197427e-7,8.176875729042487e-7,4.895383053271937e-9,3.887055237900295e-9,6.44282821951255e-9 +Bls12_381_G2_neg/24,8.224034568987011e-7,8.211090544038296e-7,8.237382426781994e-7,4.574028799171045e-9,3.612178412748195e-9,5.872000364630431e-9 +Bls12_381_G2_neg/24,8.211455403539975e-7,8.199680725375788e-7,8.225888336365694e-7,4.482089575890876e-9,3.6466627973083054e-9,6.031553341381628e-9 +Bls12_381_G2_neg/24,8.193173361536561e-7,8.181689819802867e-7,8.206202791005787e-7,3.9715226611918546e-9,3.2856032205369355e-9,5.322008219012997e-9 +Bls12_381_G2_neg/24,8.22429084240648e-7,8.211304640976863e-7,8.235545620727602e-7,4.014466037874265e-9,3.2269553367140653e-9,5.145172129537194e-9 +Bls12_381_G2_neg/24,8.208493241305165e-7,8.194482221138899e-7,8.221922774955805e-7,4.612896819760889e-9,3.6223132826371463e-9,6.124474007569341e-9 +Bls12_381_G2_neg/24,8.183679642678797e-7,8.175048053969543e-7,8.193611268704802e-7,3.1143174030003368e-9,2.550865917515296e-9,4.169664390172384e-9 +Bls12_381_G2_neg/24,8.143622876294476e-7,8.133245004410075e-7,8.157203125078571e-7,4.179282207989442e-9,3.1705334611992422e-9,5.5691888072590954e-9 +Bls12_381_G2_neg/24,8.19450580602097e-7,8.183103545302368e-7,8.204239195508328e-7,3.4751513020869737e-9,2.8161791754634724e-9,4.504072632580102e-9 +Bls12_381_G2_neg/24,8.188360199073227e-7,8.179540831487866e-7,8.197999944391778e-7,3.149260038227604e-9,2.5614787561261357e-9,4.018419304025253e-9 +Bls12_381_G2_neg/24,8.157573468989626e-7,8.144236777374268e-7,8.171513831518816e-7,4.571054579180587e-9,3.7370558752458255e-9,6.118654737836788e-9 +Bls12_381_G2_neg/24,8.22370582281056e-7,8.209303279542813e-7,8.236798514653581e-7,4.6820459837933836e-9,3.930005635494706e-9,5.525846583998662e-9 +Bls12_381_G2_neg/24,8.178064540226995e-7,8.162048238384461e-7,8.194855185916116e-7,5.474559124450453e-9,4.526134127308125e-9,6.790443117728489e-9 +Bls12_381_G2_neg/24,8.190256891672289e-7,8.176438196624795e-7,8.202418243692532e-7,4.279977867281911e-9,3.6444882870384727e-9,5.239204742473095e-9 +Bls12_381_G2_neg/24,8.189241145362162e-7,8.172035075008006e-7,8.205638480310585e-7,5.3594291367402465e-9,4.435567114249997e-9,6.838607668631482e-9 +Bls12_381_G2_neg/24,8.230236618494496e-7,8.217342714763384e-7,8.245893968442488e-7,4.717598679309468e-9,3.6837727910337253e-9,5.823632945275712e-9 +Bls12_381_G2_neg/24,8.210133875023171e-7,8.198762487693504e-7,8.222204293264804e-7,3.7351408879522156e-9,3.094263967173246e-9,5.029947907230917e-9 +Bls12_381_G2_neg/24,8.155370309778052e-7,8.143497730858612e-7,8.165900950633418e-7,3.823336092232651e-9,3.2198106647386757e-9,4.593902809357322e-9 +Bls12_381_G2_neg/24,8.2168752678058e-7,8.20504055388815e-7,8.227674166089294e-7,3.770808647944751e-9,3.0863866241760507e-9,4.8660295927595374e-9 +Bls12_381_G2_neg/24,8.272419311913242e-7,8.261829857163794e-7,8.282965117603469e-7,3.6828346934213135e-9,2.96548944493746e-9,5.217806622192912e-9 +Bls12_381_G2_neg/24,8.248679408400651e-7,8.232831921767394e-7,8.262191964144288e-7,5.1538280808366166e-9,3.845078341452096e-9,7.817122813515763e-9 +Bls12_381_G2_neg/24,8.184071909892585e-7,8.174221174677397e-7,8.195603380256769e-7,3.567515754668467e-9,2.9298255259560655e-9,4.6768252833067376e-9 +Bls12_381_G2_neg/24,8.179615388319395e-7,8.168651457639264e-7,8.188477214081943e-7,3.3027840563302123e-9,2.766840748483762e-9,4.057968110969329e-9 +Bls12_381_G2_neg/24,8.213430861205031e-7,8.202021561757105e-7,8.224579189003604e-7,3.618924305502606e-9,2.9066180619922944e-9,4.575245728186616e-9 +Bls12_381_G2_neg/24,8.226833429102481e-7,8.21258171247722e-7,8.241036996903192e-7,4.701331432080841e-9,3.997289414772808e-9,5.569816577140379e-9 +Bls12_381_G2_neg/24,8.191172256925509e-7,8.18012482925682e-7,8.203595281432216e-7,3.9426528025070615e-9,3.1886073186287855e-9,5.174465355359897e-9 +Bls12_381_G2_neg/24,8.196729427338086e-7,8.184346221125481e-7,8.208876306565148e-7,4.231181653147749e-9,3.3236617502889555e-9,5.364913455702642e-9 +Bls12_381_G2_neg/24,8.198287480419516e-7,8.184494602940382e-7,8.211620689946918e-7,4.471423764822357e-9,3.5337871308903887e-9,5.612308564948415e-9 +Bls12_381_G2_neg/24,8.231530065535527e-7,8.221943545021869e-7,8.242931896674504e-7,3.4152190231394113e-9,2.657944340298163e-9,4.6377122491867185e-9 +Bls12_381_G2_neg/24,8.163817351158646e-7,8.15151090793524e-7,8.177032493020969e-7,4.5604847094541034e-9,3.5611375933828484e-9,6.021856010144389e-9 +Bls12_381_G2_equal/24/24,1.7164120210392507e-6,1.7157717908000219e-6,1.7170921407694328e-6,2.3093533779358658e-9,1.9658137510440544e-9,2.6989591867861116e-9 +Bls12_381_G2_equal/24/24,1.7259206737105033e-6,1.7248276320243914e-6,1.7270916576412868e-6,3.6505982721870318e-9,2.9863186334411975e-9,4.5595126836503245e-9 +Bls12_381_G2_equal/24/24,1.7243790538749133e-6,1.7232076634430618e-6,1.7259034744322155e-6,4.49350316414565e-9,3.3409064615099133e-9,6.296157395718197e-9 +Bls12_381_G2_equal/24/24,1.7246730887213877e-6,1.7239187353668e-6,1.7256694865157642e-6,2.90715108202601e-9,2.412769804776261e-9,3.898245045141896e-9 +Bls12_381_G2_equal/24/24,1.7218146274322892e-6,1.7211578787094524e-6,1.7227146829151316e-6,2.5979102857660173e-9,2.08888139312546e-9,3.2382773264793998e-9 +Bls12_381_G2_equal/24/24,1.730262878622185e-6,1.7296666972671497e-6,1.7309800114056363e-6,2.270329911502867e-9,1.7074480665983858e-9,3.1092627149483726e-9 +Bls12_381_G2_equal/24/24,1.7291365216186378e-6,1.7273386227025879e-6,1.7315264469774395e-6,7.336271027913395e-9,6.223018934550471e-9,8.781736812991562e-9 +Bls12_381_G2_equal/24/24,1.745360965917177e-6,1.7433708393128898e-6,1.7472817062924927e-6,7.094642115273327e-9,5.970311836610471e-9,8.626340751515055e-9 +Bls12_381_G2_equal/24/24,1.720921426227498e-6,1.7199385858860305e-6,1.7223382356904118e-6,3.897385203477965e-9,3.0808775179911505e-9,5.741057823968583e-9 +Bls12_381_G2_equal/24/24,1.7267849710519953e-6,1.7258793011263704e-6,1.7280093821545706e-6,3.3796060188439466e-9,2.771779120209812e-9,4.412437245698124e-9 +Bls12_381_G2_equal/24/24,1.7288753578864093e-6,1.727811502711717e-6,1.7301832896913411e-6,3.868938553016677e-9,3.2829267972442116e-9,4.702808314881514e-9 +Bls12_381_G2_equal/24/24,1.7155439977331913e-6,1.7150480276325828e-6,1.7163049543459608e-6,2.029423572968696e-9,1.6019404673952405e-9,2.6170893537860486e-9 +Bls12_381_G2_equal/24/24,1.719638212481003e-6,1.7188382700581375e-6,1.720805715740665e-6,3.389046907117963e-9,2.568911562096218e-9,4.9114426515137775e-9 +Bls12_381_G2_equal/24/24,1.7173793248234099e-6,1.716464152493386e-6,1.7184881954051797e-6,3.354014170492287e-9,2.592283274508813e-9,4.3110104274444206e-9 +Bls12_381_G2_equal/24/24,1.7247219105971318e-6,1.7239798794445268e-6,1.7255126926083934e-6,2.6459478444944774e-9,2.1809707274504626e-9,3.2121099538739957e-9 +Bls12_381_G2_equal/24/24,1.721106471062151e-6,1.720585893765538e-6,1.721892103319354e-6,2.1457180914717006e-9,1.5081918842969473e-9,3.285423802328139e-9 +Bls12_381_G2_equal/24/24,1.7121110574119967e-6,1.7115997760948428e-6,1.7128881254705249e-6,2.2039395824305593e-9,1.7776362442372057e-9,2.79013591470963e-9 +Bls12_381_G2_equal/24/24,1.71675896342827e-6,1.7162321970003579e-6,1.717482683861589e-6,1.9888718967266877e-9,1.5443885741886264e-9,2.9112239209063318e-9 +Bls12_381_G2_equal/24/24,1.7296747075179998e-6,1.7286237310934109e-6,1.7307699838965953e-6,3.7039920046764503e-9,3.0198657867512286e-9,4.7244021936972525e-9 +Bls12_381_G2_equal/24/24,1.7222810420374326e-6,1.7211259312065643e-6,1.723715604500755e-6,4.269971277847011e-9,3.6010134796733666e-9,5.490473006953631e-9 +Bls12_381_G2_equal/24/24,1.7336632252359069e-6,1.7327512599980956e-6,1.734596901483702e-6,3.1289515427018993e-9,2.5573512772807798e-9,3.791008858013847e-9 +Bls12_381_G2_equal/24/24,1.7228475681872657e-6,1.7223206782328628e-6,1.7236901072165293e-6,2.2732576058939838e-9,1.6936974197560836e-9,3.417837874846538e-9 +Bls12_381_G2_equal/24/24,1.719310496820137e-6,1.7183721940454675e-6,1.720419303581183e-6,3.5489754599116537e-9,2.744266840536314e-9,4.407116913175118e-9 +Bls12_381_G2_equal/24/24,1.7346402407974546e-6,1.7331807659880237e-6,1.736603470004531e-6,5.358445739172203e-9,4.2793329044538035e-9,7.149165828785112e-9 +Bls12_381_G2_equal/24/24,1.7204474979982718e-6,1.7194213485016688e-6,1.7216208463499296e-6,3.6563246467321157e-9,3.138524473852501e-9,4.4426770743977915e-9 +Bls12_381_G2_equal/24/24,1.721727192074607e-6,1.7206803222990233e-6,1.7230996896540861e-6,4.296274875471769e-9,3.5663712685212674e-9,5.2431500302889395e-9 +Bls12_381_G2_equal/24/24,1.7141426975055476e-6,1.7134546383921512e-6,1.7154369688521551e-6,3.0683384251818417e-9,2.0656174399657025e-9,5.090741268068677e-9 +Bls12_381_G2_equal/24/24,1.715071840192893e-6,1.7143711636299096e-6,1.7162407994894292e-6,2.8609536252244886e-9,1.8990854529123657e-9,5.00326661439643e-9 +Bls12_381_G2_equal/24/24,1.725383043741297e-6,1.7246719310626674e-6,1.7260631430827724e-6,2.2028062866211417e-9,1.8490651539401582e-9,2.6779018251871333e-9 +Bls12_381_G2_equal/24/24,1.7221538126902513e-6,1.721403444185178e-6,1.7229241284119404e-6,2.4427254208698865e-9,2.090349201337517e-9,2.9428309209911392e-9 +Bls12_381_G2_equal/24/24,1.737442129779637e-6,1.7362534913129157e-6,1.7386890641571622e-6,4.1420792458926665e-9,3.451927036513749e-9,5.351111511884849e-9 +Bls12_381_G2_equal/24/24,1.734080840865216e-6,1.7332746349558268e-6,1.7350571127961063e-6,3.28688570573749e-9,2.5781582131503614e-9,4.683435717529048e-9 +Bls12_381_G2_equal/24/24,1.7289537622572666e-6,1.7284086964335657e-6,1.729806666649289e-6,2.220270150351851e-9,1.7680797180417288e-9,2.8292817118435064e-9 +Bls12_381_G2_equal/24/24,1.7356895882485287e-6,1.7348690058114514e-6,1.7368133977787147e-6,3.1707185398528004e-9,2.5221404610184985e-9,4.554280864166787e-9 +Bls12_381_G2_equal/24/24,1.7140460245045526e-6,1.7135421226262584e-6,1.7149055597118565e-6,2.2570516259485337e-9,1.3078396047583993e-9,3.566035894809449e-9 +Bls12_381_G2_equal/24/24,1.7148741826248651e-6,1.7140821628109842e-6,1.715975469375409e-6,3.1803653475405555e-9,2.5938124819911603e-9,3.941043032848219e-9 +Bls12_381_G2_equal/24/24,1.7160461075270703e-6,1.7155023139047258e-6,1.716821294737699e-6,2.1789276011213323e-9,1.7495756226550814e-9,2.811328455753362e-9 +Bls12_381_G2_equal/24/24,1.7184732397222078e-6,1.71766632876349e-6,1.7194786524371423e-6,3.016883778062053e-9,2.473979405082423e-9,3.752693201192387e-9 +Bls12_381_G2_equal/24/24,1.721527400268055e-6,1.7206485724656243e-6,1.7225120101851082e-6,2.96329998685079e-9,2.4321774423061352e-9,3.7710393256682e-9 +Bls12_381_G2_equal/24/24,1.721023619238502e-6,1.7199438154209907e-6,1.7223517213606712e-6,4.045880530984553e-9,3.150999516233956e-9,5.354379208891193e-9 +Bls12_381_G2_equal/24/24,1.7234951784215268e-6,1.7225885233173447e-6,1.724467874326737e-6,2.992692001112125e-9,2.27935149120599e-9,4.000138426513358e-9 +Bls12_381_G2_equal/24/24,1.7150639170239875e-6,1.7144487198029602e-6,1.7158448349334978e-6,2.2946033019899097e-9,1.8354810250331878e-9,2.9416677128139967e-9 +Bls12_381_G2_equal/24/24,1.720485822150658e-6,1.7198894966707883e-6,1.721360334940401e-6,2.488953252892058e-9,1.747396055862778e-9,3.862781468823398e-9 +Bls12_381_G2_equal/24/24,1.7193210355806703e-6,1.7185002215452656e-6,1.7201205858426518e-6,2.805921165487163e-9,2.3872601273477875e-9,3.300964773621877e-9 +Bls12_381_G2_equal/24/24,1.7296030021025717e-6,1.7288304365619044e-6,1.7309834814776e-6,3.355923086687818e-9,2.522635868519386e-9,4.697114330091775e-9 +Bls12_381_G2_equal/24/24,1.7124399382697922e-6,1.7116998312816755e-6,1.7133815311048201e-6,2.8176578115147484e-9,2.279133428757769e-9,3.4835244767229624e-9 +Bls12_381_G2_equal/24/24,1.7181611602204825e-6,1.717581027594022e-6,1.719005232280692e-6,2.305556289005356e-9,1.869595812785666e-9,2.986949919605887e-9 +Bls12_381_G2_equal/24/24,1.7225706077729036e-6,1.7220437072855137e-6,1.7233399778384387e-6,2.0956355232926614e-9,1.437019762562037e-9,3.6407992068909673e-9 +Bls12_381_G2_equal/24/24,1.7208301957799408e-6,1.7201149057767206e-6,1.7217212559051819e-6,2.5119064577531767e-9,2.1071574576983834e-9,3.046569846585807e-9 +Bls12_381_G2_equal/24/24,1.7204812110334923e-6,1.7194659924173923e-6,1.721397732189698e-6,3.1015858913229835e-9,2.758858688443649e-9,3.5327824756293205e-9 +Bls12_381_G2_equal/24/24,1.7115064368999804e-6,1.7109012593367964e-6,1.7123802893976145e-6,2.304290919060651e-9,1.7832110508955332e-9,3.178135657895622e-9 +Bls12_381_G2_equal/24/24,1.7114838242015718e-6,1.7108472168139046e-6,1.712270846266681e-6,2.4126022550984067e-9,2.007696916912806e-9,2.898927477781363e-9 +Bls12_381_G2_equal/24/24,1.725575488469656e-6,1.7249567357680597e-6,1.7263910505833652e-6,2.4226384210366958e-9,1.8440501530828177e-9,3.2085900947268407e-9 +Bls12_381_G2_equal/24/24,1.7125058311514937e-6,1.7119000532732953e-6,1.7132259374087458e-6,2.1917375554620988e-9,1.8203062148940393e-9,2.693595405876366e-9 +Bls12_381_G2_equal/24/24,1.7110748429397435e-6,1.7102933279736313e-6,1.7119163521715264e-6,2.636171489066187e-9,2.1113535650988074e-9,3.252485111875169e-9 +Bls12_381_G2_equal/24/24,1.7169157457580761e-6,1.7161523360362755e-6,1.718148326020892e-6,3.2816834358741255e-9,2.3679200636027244e-9,5.252885894194207e-9 +Bls12_381_G2_equal/24/24,1.7113757757139977e-6,1.7107602810291646e-6,1.712599352448796e-6,2.8908372186985504e-9,1.5514649106066264e-9,4.8480796153318335e-9 +Bls12_381_G2_equal/24/24,1.7364601185096783e-6,1.7354479107273437e-6,1.737871652830418e-6,4.031261515225565e-9,2.969060664920446e-9,5.116936989692086e-9 +Bls12_381_G2_equal/24/24,1.7140972358558208e-6,1.7134271155745068e-6,1.714872333610169e-6,2.3772082956563962e-9,2.007920792800265e-9,3.1536706486874858e-9 +Bls12_381_G2_equal/24/24,1.7264396953398245e-6,1.7259807142422317e-6,1.7269857091616114e-6,1.7785718889619162e-9,1.3904891009960195e-9,2.2446658077876546e-9 +Bls12_381_G2_equal/24/24,1.7271165951231557e-6,1.7265961266606317e-6,1.727824584849707e-6,2.130536464613246e-9,1.6476157743160515e-9,3.1815927404601455e-9 +Bls12_381_G2_equal/24/24,1.7162541780583409e-6,1.7157014445219138e-6,1.716879357632562e-6,1.9501800092403887e-9,1.6401864391383542e-9,2.3946239569360366e-9 +Bls12_381_G2_equal/24/24,1.7209272372840842e-6,1.7204088378144159e-6,1.721411065881495e-6,1.6380438850644598e-9,1.4148620965983211e-9,1.9363361618163044e-9 +Bls12_381_G2_equal/24/24,1.7163553680766525e-6,1.7159184619191285e-6,1.7169603400269716e-6,1.7631817546201533e-9,1.3457978498603006e-9,2.716726140066824e-9 +Bls12_381_G2_equal/24/24,1.7172918792149428e-6,1.7165377660396248e-6,1.7183150820911407e-6,3.0162282589465323e-9,2.306126417379783e-9,4.3798295069919075e-9 +Bls12_381_G2_equal/24/24,1.7179367693705743e-6,1.7170862754054549e-6,1.7191416855728567e-6,3.3319550963933344e-9,2.584594545103518e-9,4.853765484711812e-9 +Bls12_381_G2_equal/24/24,1.7189699158117725e-6,1.7178122195700621e-6,1.7202533478569506e-6,3.994292962121659e-9,3.2456999083599394e-9,4.9038217171593025e-9 +Bls12_381_G2_equal/24/24,1.724400448645333e-6,1.7236635055366097e-6,1.7253407890065252e-6,2.6870198448907544e-9,2.134591792504384e-9,3.6100358069924116e-9 +Bls12_381_G2_equal/24/24,1.725050946295091e-6,1.7241762269001636e-6,1.7262240473198131e-6,3.1747039169093376e-9,2.4175130993852584e-9,4.288066012651488e-9 +Bls12_381_G2_equal/24/24,1.729615289788062e-6,1.7288863510056734e-6,1.7305069064322255e-6,2.7918296496466857e-9,2.1907841276037138e-9,3.6238141457596925e-9 +Bls12_381_G2_equal/24/24,1.7369118742741836e-6,1.736076872219183e-6,1.7378315037387757e-6,3.232693791800285e-9,2.691396366389154e-9,3.933141178513603e-9 +Bls12_381_G2_equal/24/24,1.7186178744172078e-6,1.7172658319458972e-6,1.7201059740840972e-6,4.923327100805297e-9,3.91388556671697e-9,6.620995703977137e-9 +Bls12_381_G2_equal/24/24,1.728856865699771e-6,1.7274729141313333e-6,1.73043835807257e-6,5.117256147292706e-9,4.2648796224429975e-9,6.112945510168965e-9 +Bls12_381_G2_equal/24/24,1.7236969670834279e-6,1.7227754171443627e-6,1.724701341452965e-6,3.2627481175610406e-9,2.6503482484175124e-9,4.096800546848629e-9 +Bls12_381_G2_equal/24/24,1.722935141508051e-6,1.7221694331931434e-6,1.7240384647278723e-6,3.0795637459193667e-9,2.191902574279697e-9,4.840466669976208e-9 +Bls12_381_G2_equal/24/24,1.7203592427149494e-6,1.7198099759983991e-6,1.721356786912123e-6,2.4008319005914607e-9,1.663919598101655e-9,3.358004729824581e-9 +Bls12_381_G2_equal/24/24,1.7225298035308519e-6,1.7217743525149872e-6,1.7235028502038157e-6,2.7979506711065527e-9,2.3590677243999594e-9,3.4429228886086357e-9 +Bls12_381_G2_equal/24/24,1.7183142592010938e-6,1.7176379352955975e-6,1.7192438814112502e-6,2.6318036864452116e-9,2.069235713142891e-9,3.189010707437535e-9 +Bls12_381_G2_equal/24/24,1.7234203405576858e-6,1.722700769137542e-6,1.7243843035781865e-6,2.78788920427373e-9,2.0489830117789384e-9,3.760234944890855e-9 +Bls12_381_G2_equal/24/24,1.7167708463552428e-6,1.7159948693865667e-6,1.7178605310995829e-6,3.0648381382218445e-9,2.3272449531332777e-9,4.826561625802498e-9 +Bls12_381_G2_equal/24/24,1.7172031815011172e-6,1.7163336398172836e-6,1.7183050064479234e-6,3.3606833175775916e-9,2.904471704783709e-9,3.8228493962719984e-9 +Bls12_381_G2_equal/24/24,1.714137120798471e-6,1.7133243338366462e-6,1.71522574875308e-6,3.1287234868578316e-9,2.0660546353934497e-9,5.399488768613799e-9 +Bls12_381_G2_equal/24/24,1.7272616987880286e-6,1.7263359594621952e-6,1.7284214071733956e-6,3.3253248425638565e-9,2.7248028527594965e-9,4.7467046988007416e-9 +Bls12_381_G2_equal/24/24,1.7263395968349483e-6,1.7256275594258206e-6,1.7271512734507752e-6,2.5609620535896636e-9,2.056277305746294e-9,3.3362582595506795e-9 +Bls12_381_G2_equal/24/24,1.7179730769314998e-6,1.7171821622862278e-6,1.7188424822858602e-6,2.831581796376716e-9,2.387097398172936e-9,3.455585196949079e-9 +Bls12_381_G2_equal/24/24,1.7283453329314664e-6,1.7275912628769436e-6,1.7298290765698196e-6,3.422908865630628e-9,2.0626045338034972e-9,6.054646897656566e-9 +Bls12_381_G2_equal/24/24,1.7250182678935728e-6,1.7241796966518782e-6,1.72591921479806e-6,2.7892344118653546e-9,2.3139803414035412e-9,3.571408087517428e-9 +Bls12_381_G2_equal/24/24,1.7196261800744873e-6,1.7189962105029715e-6,1.720485394135137e-6,2.4563508139453196e-9,1.987673453118308e-9,3.4716295799598037e-9 +Bls12_381_G2_equal/24/24,1.716702040523542e-6,1.7157993913565047e-6,1.7177543032287618e-6,3.3163616060205836e-9,2.719819773247985e-9,3.9285872856112825e-9 +Bls12_381_G2_equal/24/24,1.7185634967603354e-6,1.7179336128236259e-6,1.719321993482066e-6,2.3583310571592374e-9,1.9453090983275317e-9,3.0613293225232025e-9 +Bls12_381_G2_equal/24/24,1.7258972777334025e-6,1.7249344045555537e-6,1.7273647703438114e-6,3.914994109900926e-9,2.8232983757618663e-9,5.754238766596791e-9 +Bls12_381_G2_equal/24/24,1.729397951582818e-6,1.7286935958800418e-6,1.7305098095304405e-6,2.9582957522891064e-9,1.7232704552386938e-9,4.461103631547818e-9 +Bls12_381_G2_equal/24/24,1.7225514238942647e-6,1.7221017946388061e-6,1.723080045937989e-6,1.5415937605234424e-9,1.1951628795711923e-9,2.0910210006627028e-9 +Bls12_381_G2_equal/24/24,1.7177997407279744e-6,1.7171302244795807e-6,1.7185858223695856e-6,2.3861461948952787e-9,1.8777855823562783e-9,2.9810960202508512e-9 +Bls12_381_G2_equal/24/24,1.7182733806670329e-6,1.7176647738371886e-6,1.7190049433182606e-6,2.263140861554997e-9,1.8345763905536135e-9,2.9795502807307844e-9 +Bls12_381_G2_equal/24/24,1.7213996965254382e-6,1.7205131944531873e-6,1.7226563971929701e-6,3.446603578814361e-9,2.7249730168346848e-9,4.443992823233112e-9 +Bls12_381_G2_equal/24/24,1.733287159862767e-6,1.7326464800212694e-6,1.7341017249216641e-6,2.4057824063882984e-9,1.987332239300603e-9,2.8965893308706104e-9 +Bls12_381_G2_equal/24/24,1.7248942893529463e-6,1.724012008749591e-6,1.7259579481897938e-6,3.334380655142448e-9,2.7876611368189876e-9,4.3894058582194414e-9 +Bls12_381_G2_equal/24/24,1.7229415253663602e-6,1.72197560813867e-6,1.7241023542311915e-6,3.539974161340876e-9,3.044341166875544e-9,5.007533529488454e-9 +Bls12_381_G2_equal/24/24,1.7213485745392692e-6,1.720764939563223e-6,1.7221412282251658e-6,2.3432954074310673e-9,1.9409507449032984e-9,2.8848722272410867e-9 +Bls12_381_G2_hashToGroup/341,2.129788741791096e-4,2.1295679543123023e-4,2.1299972321102927e-4,7.162286132094623e-8,5.972118001191288e-8,8.749494572460413e-8 +Bls12_381_G2_hashToGroup/320,2.1261471912269856e-4,2.1258942619522373e-4,2.126429070852095e-4,9.572629921258496e-8,7.926823134177476e-8,1.314647716832198e-7 +Bls12_381_G2_hashToGroup/41,2.0602563187804572e-4,2.0600317724205216e-4,2.060442834287869e-4,6.765043147734124e-8,5.540414180836611e-8,8.633977435867539e-8 +Bls12_381_G2_hashToGroup/316,2.1229270099662833e-4,2.1227007055965686e-4,2.1231523900200133e-4,8.030158064898588e-8,6.538165186345866e-8,1.0308780079232161e-7 +Bls12_381_G2_hashToGroup/361,2.1340872532426438e-4,2.1338470198885062e-4,2.1342923441542412e-4,6.947379783501384e-8,5.90661229310681e-8,8.53261923934247e-8 +Bls12_381_G2_hashToGroup/301,2.1212356652276228e-4,2.120992525197768e-4,2.1214931913685046e-4,8.5071664207455e-8,6.462070650147723e-8,1.2093922383609424e-7 +Bls12_381_G2_hashToGroup/252,2.1097724241839717e-4,2.1095612166895027e-4,2.109992026696671e-4,7.094695999450886e-8,5.572959593005505e-8,9.159016898994846e-8 +Bls12_381_G2_hashToGroup/302,2.120824389461971e-4,2.120656786854464e-4,2.1210217585421426e-4,6.198597103734725e-8,4.654492244100956e-8,8.160263819759729e-8 +Bls12_381_G2_hashToGroup/285,2.11684359094977e-4,2.116633166383863e-4,2.1170411176928526e-4,6.856680896671494e-8,5.902570431780124e-8,7.999260737707609e-8 +Bls12_381_G2_hashToGroup/170,2.090127628234822e-4,2.0899469431929195e-4,2.090321235312045e-4,6.431780617315031e-8,5.185327268382114e-8,9.300358183683968e-8 +Bls12_381_G2_hashToGroup/161,2.0873637558270017e-4,2.0871536581260454e-4,2.087605916648273e-4,7.704287351610477e-8,6.095717414902702e-8,9.503803912174515e-8 +Bls12_381_G2_hashToGroup/364,2.13483838179019e-4,2.1346010232870796e-4,2.13506700033493e-4,7.576008476848646e-8,6.116143811712708e-8,9.929522074521787e-8 +Bls12_381_G2_hashToGroup/25,2.056641525781056e-4,2.0563841440918626e-4,2.0568426674921989e-4,7.507358829130469e-8,5.982696745814523e-8,1.0641875465990127e-7 +Bls12_381_G2_hashToGroup/8,2.0539318495721952e-4,2.0535562621241545e-4,2.0542814707397416e-4,1.2071319556174497e-7,9.136779812220319e-8,1.7641225216572697e-7 +Bls12_381_G2_hashToGroup/96,2.0738903342726756e-4,2.0735956281708415e-4,2.0741451662743078e-4,8.339357880356846e-8,6.325521204298251e-8,1.0969985008498233e-7 +Bls12_381_G2_hashToGroup/347,2.1320201716088248e-4,2.1317675373087766e-4,2.132273508810592e-4,8.70855707200718e-8,7.431307632045972e-8,1.053079325924927e-7 +Bls12_381_G2_hashToGroup/25,2.05787597309435e-4,2.0576392183185936e-4,2.0581425896747823e-4,9.047524719475849e-8,7.561506729018904e-8,1.0939701016995154e-7 +Bls12_381_G2_hashToGroup/360,2.1338778171805988e-4,2.1336872610484036e-4,2.1340853166457969e-4,6.817602893095894e-8,5.6959558877201964e-8,8.260275207840287e-8 +Bls12_381_G2_hashToGroup/299,2.121864457167993e-4,2.121628318484674e-4,2.1220751205636816e-4,7.219747529671825e-8,5.8293158311123e-8,9.44348801697498e-8 +Bls12_381_G2_hashToGroup/106,2.0754094097344625e-4,2.0751894472104647e-4,2.075626200644936e-4,7.029552060089509e-8,5.689811657452966e-8,9.426792400768538e-8 +Bls12_381_G2_hashToGroup/59,2.064706929111479e-4,2.0643913113988573e-4,2.064942445963509e-4,8.826881464633263e-8,7.009963123117718e-8,1.3452349752161292e-7 +Bls12_381_G2_hashToGroup/318,2.1236922748167704e-4,2.1234262100028312e-4,2.1239155436157087e-4,8.052684917027734e-8,6.092632863941307e-8,1.1888788977807551e-7 +Bls12_381_G2_hashToGroup/32,2.0596579844016764e-4,2.0594147429025612e-4,2.0598786582483168e-4,7.877115858266837e-8,6.45950619905984e-8,1.0552397264416117e-7 +Bls12_381_G2_hashToGroup/111,2.0777175973675385e-4,2.0775259127266962e-4,2.0779054243807922e-4,5.904315979023431e-8,4.672707345911866e-8,8.398129484101755e-8 +Bls12_381_G2_hashToGroup/226,2.104034773477081e-4,2.103748984890051e-4,2.104733117587856e-4,1.493775121220188e-7,7.610379869602585e-8,2.88929070732979e-7 +Bls12_381_G2_hashToGroup/118,2.0774501968876539e-4,2.077233804333831e-4,2.0776416442029396e-4,6.652112929132384e-8,5.419101922776952e-8,8.700373922310981e-8 +Bls12_381_G2_hashToGroup/370,2.1353485487452664e-4,2.1351626892918515e-4,2.135516792941517e-4,5.9315789240419994e-8,5.009700528556009e-8,7.346932060320179e-8 +Bls12_381_G2_hashToGroup/303,2.1218633167763222e-4,2.1215470711740097e-4,2.1221335649531842e-4,9.682743613690018e-8,8.111289069830641e-8,1.1759330940617903e-7 +Bls12_381_G2_hashToGroup/57,2.0645213698416756e-4,2.0643007609667412e-4,2.064784263983493e-4,7.968073098740633e-8,6.379613978794088e-8,1.1306625506943366e-7 +Bls12_381_G2_hashToGroup/336,2.130592263949379e-4,2.130381276171849e-4,2.1308917889660474e-4,8.334404943580928e-8,6.567353728911288e-8,1.1218268815736042e-7 +Bls12_381_G2_hashToGroup/178,2.092144930054097e-4,2.091858315838416e-4,2.092380624811797e-4,9.00373171959838e-8,6.743828031015395e-8,1.326239223163364e-7 +Bls12_381_G2_hashToGroup/23,2.0557229277711739e-4,2.0554949103363776e-4,2.0559348952461194e-4,7.730146574765996e-8,5.961865553051686e-8,1.0650965649741973e-7 +Bls12_381_G2_hashToGroup/153,2.0857455976987534e-4,2.0855247012243372e-4,2.085986142907185e-4,7.790887713287495e-8,6.53184488646437e-8,9.574301071704835e-8 +Bls12_381_G2_hashToGroup/194,2.0953689818290413e-4,2.0950668924719942e-4,2.0956203087525707e-4,9.123419378533313e-8,7.56290248735648e-8,1.142817738039915e-7 +Bls12_381_G2_hashToGroup/249,2.110285116257151e-4,2.1100153860820293e-4,2.1106894725311809e-4,1.0937372149222856e-7,7.789362761895745e-8,1.5497871807090403e-7 +Bls12_381_G2_hashToGroup/306,2.1239307776967548e-4,2.1236724947150068e-4,2.1242408395965757e-4,9.328248713546076e-8,7.610580906139275e-8,1.1833802099463707e-7 +Bls12_381_G2_hashToGroup/369,2.1368724341489707e-4,2.136658891886771e-4,2.137108377670379e-4,7.403362675524255e-8,5.8505109116385806e-8,1.0512117640226022e-7 +Bls12_381_G2_hashToGroup/51,2.0628195647410673e-4,2.0626101725158702e-4,2.063074399912802e-4,7.388586584177836e-8,5.6970344581504077e-8,1.0315376985452963e-7 +Bls12_381_G2_hashToGroup/178,2.0912756313395034e-4,2.0910381911228856e-4,2.0915220397521863e-4,8.035710806188162e-8,6.464917321535245e-8,1.024590350763347e-7 +Bls12_381_G2_hashToGroup/358,2.1336669412175098e-4,2.1333131146406361e-4,2.133915885305468e-4,9.744321778347542e-8,7.33038771006027e-8,1.5096230142941588e-7 +Bls12_381_G2_hashToGroup/16,2.05531827275778e-4,2.0550469236472663e-4,2.0555389232915206e-4,8.639493529460203e-8,6.81888096539527e-8,1.0766631360643544e-7 +Bls12_381_G2_hashToGroup/177,2.0909410663872416e-4,2.090716738686868e-4,2.091148051569748e-4,7.348423575393837e-8,6.046034079438065e-8,9.323686583788268e-8 +Bls12_381_G2_hashToGroup/315,2.1248668154704234e-4,2.1245863127635547e-4,2.1252594182315883e-4,1.0718918272659669e-7,8.043782875234656e-8,1.5668973235000454e-7 +Bls12_381_G2_hashToGroup/300,2.1214052546246899e-4,2.1211728826499318e-4,2.1216232456171507e-4,8.007072813659739e-8,6.498234821865692e-8,1.0082536522372624e-7 +Bls12_381_G2_hashToGroup/49,2.0624357945413655e-4,2.0622056351386652e-4,2.062646115914754e-4,7.600117648315247e-8,5.96364479842039e-8,1.0702798383550724e-7 +Bls12_381_G2_hashToGroup/374,2.1353530044199905e-4,2.1351129870438617e-4,2.1355922276169672e-4,8.100580885376073e-8,6.655346472708137e-8,1.01791190911209e-7 +Bls12_381_G2_hashToGroup/133,2.0814624216029223e-4,2.0812246452281963e-4,2.081736359081136e-4,8.912534021063129e-8,7.179996481872215e-8,1.1353913535033923e-7 +Bls12_381_G2_hashToGroup/31,2.0596176120711243e-4,2.059381524008304e-4,2.0600647844130164e-4,1.0149861629029264e-7,7.213144494129113e-8,1.6740630281549253e-7 +Bls12_381_G2_hashToGroup/354,2.133304377640931e-4,2.133084559463474e-4,2.133548817273525e-4,7.986647516673417e-8,6.420762548599862e-8,1.1277678010637305e-7 +Bls12_381_G2_hashToGroup/161,2.0889048118277113e-4,2.0886836940588752e-4,2.0891939165177263e-4,8.320603481956399e-8,6.711301172290018e-8,1.1064992014075362e-7 +Bls12_381_G2_hashToGroup/200,2.0977141705595835e-4,2.0974735661060493e-4,2.097916808669393e-4,7.691244897469319e-8,6.334856380773652e-8,9.446656406065382e-8 +Bls12_381_G2_hashToGroup/159,2.086122319131145e-4,2.0859034597804193e-4,2.08635762671432e-4,7.726734262165393e-8,6.170074277438962e-8,1.0354520188575726e-7 +Bls12_381_G2_hashToGroup/281,2.117051931538629e-4,2.1168707092567992e-4,2.1172911871700657e-4,7.215610105682633e-8,5.422535255990677e-8,1.031240244930825e-7 +Bls12_381_G2_hashToGroup/99,2.073932728805242e-4,2.073751481213084e-4,2.0741375904612713e-4,6.875964810161581e-8,5.6398315695598965e-8,8.673221334142427e-8 +Bls12_381_G2_hashToGroup/342,2.1298929738531463e-4,2.129677065946553e-4,2.1300971050788262e-4,6.986461484738304e-8,5.745019717545011e-8,8.839647438453426e-8 +Bls12_381_G2_hashToGroup/303,2.121590421156865e-4,2.121364641841797e-4,2.1218692745012582e-4,8.164231450636451e-8,6.603122473294851e-8,1.0822283332249664e-7 +Bls12_381_G2_hashToGroup/305,2.1229622637531823e-4,2.1226622050326115e-4,2.123221957160536e-4,8.880306022707623e-8,7.37799387431859e-8,1.1711542673231992e-7 +Bls12_381_G2_hashToGroup/231,2.1053087694658334e-4,2.1050818052710586e-4,2.1055298843750242e-4,7.588504807411637e-8,6.246707346568688e-8,9.348007768038816e-8 +Bls12_381_G2_hashToGroup/33,2.0594446229020994e-4,2.059092297579234e-4,2.0597426074781195e-4,1.0876623009950123e-7,8.415545355012903e-8,1.5955934672206164e-7 +Bls12_381_G2_hashToGroup/71,2.068382774201973e-4,2.068182974152815e-4,2.0685825658638127e-4,6.757528745589374e-8,5.80210324294126e-8,7.983493825853828e-8 +Bls12_381_G2_hashToGroup/76,2.0682578032139577e-4,2.0680160347489156e-4,2.068518758480919e-4,8.51181589904574e-8,7.10067149859489e-8,1.074026053145623e-7 +Bls12_381_G2_hashToGroup/177,2.0920550495167912e-4,2.0918477282659404e-4,2.0924329400853972e-4,9.105686007531587e-8,5.847845660239202e-8,1.5740212783173414e-7 +Bls12_381_G2_hashToGroup/189,2.0932440045360576e-4,2.0929877062892557e-4,2.09348030609318e-4,8.347360091897458e-8,6.693316023540837e-8,1.0599283146651769e-7 +Bls12_381_G2_hashToGroup/345,2.130278702647817e-4,2.130047187370758e-4,2.130529347833298e-4,8.0598567467852e-8,6.687945839563679e-8,9.84147225856518e-8 +Bls12_381_G2_hashToGroup/71,2.0664467410650114e-4,2.0662102669552373e-4,2.0666632161023908e-4,7.602351554323011e-8,5.899086831843314e-8,1.00646501916083e-7 +Bls12_381_G2_hashToGroup/308,2.1231345362694086e-4,2.1227757662161558e-4,2.1233891079666138e-4,9.502249965959099e-8,6.908575333955004e-8,1.3093498928159572e-7 +Bls12_381_G2_hashToGroup/101,2.0735985706902616e-4,2.0733987176684324e-4,2.073793161174003e-4,6.464111150485961e-8,5.458460505548783e-8,8.032195424119484e-8 +Bls12_381_G2_hashToGroup/86,2.0697772907016075e-4,2.069542143957641e-4,2.0701235270247103e-4,9.332899523165562e-8,6.368956544106328e-8,1.455682992000308e-7 +Bls12_381_G2_hashToGroup/89,2.0713580666116687e-4,2.0710148372169766e-4,2.0716523804021914e-4,1.02076800102144e-7,8.386287383047506e-8,1.1992293518637246e-7 +Bls12_381_G2_hashToGroup/150,2.0845696410543764e-4,2.0842787962637856e-4,2.0848421208278175e-4,9.607617531265084e-8,7.71765286999077e-8,1.2573257882934124e-7 +Bls12_381_G2_hashToGroup/54,2.0629972654778774e-4,2.0627532188223645e-4,2.0632247552445585e-4,8.253327402429614e-8,6.829748841599919e-8,1.0971936620215931e-7 +Bls12_381_G2_hashToGroup/114,2.076979557322759e-4,2.0767368380799364e-4,2.0772193499446882e-4,8.135940389662277e-8,6.184693589498078e-8,1.121500528775938e-7 +Bls12_381_G2_hashToGroup/22,2.0560585240272908e-4,2.0558163733240398e-4,2.0562831618977393e-4,7.7877694903827e-8,6.513914422200108e-8,9.74432475049138e-8 +Bls12_381_G2_hashToGroup/93,2.0716627676179407e-4,2.0714373041743256e-4,2.0718719776758514e-4,7.633202478204223e-8,6.185916906731173e-8,1.0265339663559895e-7 +Bls12_381_G2_hashToGroup/187,2.0930264190316733e-4,2.092756015585207e-4,2.0933079556125663e-4,9.697133566501167e-8,7.612887709818835e-8,1.2558483984390588e-7 +Bls12_381_G2_hashToGroup/152,2.0866963984359868e-4,2.0864770024683346e-4,2.0868938990249288e-4,6.66319403989379e-8,5.539793245029242e-8,8.114197880405078e-8 +Bls12_381_G2_hashToGroup/304,2.1234298075430277e-4,2.123155468279548e-4,2.1236535439826966e-4,8.49880350237896e-8,6.990894165769057e-8,1.0590208782039957e-7 +Bls12_381_G2_hashToGroup/375,2.1393472370634901e-4,2.1390594200594194e-4,2.139634528169763e-4,9.406096626776241e-8,7.944101522725493e-8,1.2371594112899104e-7 +Bls12_381_G2_hashToGroup/161,2.088598026970315e-4,2.0883309011656296e-4,2.0887806762816982e-4,7.355310655254897e-8,5.381904434378803e-8,1.0521287187844891e-7 +Bls12_381_G2_hashToGroup/268,2.1142170910726306e-4,2.1140175001142913e-4,2.1144505716840843e-4,7.389089113266145e-8,6.108471536659211e-8,9.129060702119146e-8 +Bls12_381_G2_hashToGroup/51,2.062959666808126e-4,2.0627189182947854e-4,2.0632317832133847e-4,8.23259694753223e-8,6.281533326936517e-8,1.1241931691980564e-7 +Bls12_381_G2_hashToGroup/249,2.1084982135456852e-4,2.1082926223355434e-4,2.108703601515483e-4,7.074509945233524e-8,5.853612387500151e-8,8.736658461361484e-8 +Bls12_381_G2_hashToGroup/246,2.1088598290746157e-4,2.1086222462409033e-4,2.1091749425670428e-4,8.895648006524975e-8,6.477806536290363e-8,1.273933778330614e-7 +Bls12_381_G2_hashToGroup/240,2.1085937725353192e-4,2.1083332722609903e-4,2.1090124761299363e-4,1.1146323466729487e-7,7.986523856146137e-8,1.5665395850690777e-7 +Bls12_381_G2_hashToGroup/205,2.0952145751616403e-4,2.0950433297180787e-4,2.0953970473998115e-4,5.8130067355483565e-8,4.7071081579835015e-8,7.438895068485158e-8 +Bls12_381_G2_hashToGroup/185,2.0922186879232296e-4,2.0920109663098203e-4,2.0924730348727757e-4,7.501766754570088e-8,5.807656451685706e-8,1.0185564205392775e-7 +Bls12_381_G2_hashToGroup/139,2.0817662441524536e-4,2.0815773319296616e-4,2.0820026824756218e-4,6.872707672444372e-8,5.516893237487751e-8,9.458903565423293e-8 +Bls12_381_G2_hashToGroup/328,2.1268969797202583e-4,2.1266868952123766e-4,2.1271791153240808e-4,8.430049697662431e-8,6.578126202613031e-8,1.1746387273950975e-7 +Bls12_381_G2_hashToGroup/115,2.076222265395854e-4,2.0760031497916732e-4,2.0764294574792175e-4,6.696392161566262e-8,5.4876844871160236e-8,9.097305807632586e-8 +Bls12_381_G2_hashToGroup/167,2.0895047665269657e-4,2.089274015135669e-4,2.0897696082886727e-4,8.563201733926333e-8,6.779420621208553e-8,1.05731867185367e-7 +Bls12_381_G2_hashToGroup/115,2.0763714022840128e-4,2.0761553767947505e-4,2.0765889864713714e-4,7.13263438853051e-8,5.7996444836101254e-8,8.786895862668791e-8 +Bls12_381_G2_hashToGroup/183,2.092528177634723e-4,2.092383679143291e-4,2.0927934665600283e-4,6.811029233998565e-8,4.505497020240757e-8,1.1517577670579284e-7 +Bls12_381_G2_hashToGroup/81,2.0691869639421096e-4,2.0689907030043786e-4,2.0693725418913518e-4,6.877037445268205e-8,5.7056119458910705e-8,8.493830686539468e-8 +Bls12_381_G2_hashToGroup/169,2.0892526488014174e-4,2.0890008023251397e-4,2.089501498952072e-4,8.656004417203822e-8,6.83460553719044e-8,1.131694563983478e-7 +Bls12_381_G2_hashToGroup/140,2.0815198464072516e-4,2.0813416137058588e-4,2.0817458734319276e-4,7.119365038807178e-8,5.7344449867379686e-8,9.52435464595132e-8 +Bls12_381_G2_hashToGroup/105,2.0741556299164307e-4,2.073991942342705e-4,2.0743059039387402e-4,5.4558451782995085e-8,4.139358468265616e-8,7.650287987919465e-8 +Bls12_381_G2_hashToGroup/364,2.134322632916413e-4,2.1341031474757062e-4,2.1346210235944236e-4,8.62073170094966e-8,5.912171880777086e-8,1.377159445831743e-7 +Bls12_381_G2_hashToGroup/280,2.1166468008665626e-4,2.116342745373794e-4,2.1168969570439176e-4,9.116002848398588e-8,7.368088249245984e-8,1.1874587469200087e-7 +Bls12_381_G2_hashToGroup/143,2.082862363023876e-4,2.0825200852568856e-4,2.083122723019335e-4,1.0161760303913633e-7,8.783385385468789e-8,1.2264109491186685e-7 +Bls12_381_G2_hashToGroup/182,2.0909920712833803e-4,2.0907814675107954e-4,2.091162231434402e-4,6.153099637963667e-8,4.941927264738086e-8,9.530601460089702e-8 +Bls12_381_G2_compress/24,4.472896520242245e-6,4.469890168846916e-6,4.476578873455801e-6,1.1441489241616693e-8,8.622552976984747e-9,1.4753881478943905e-8 +Bls12_381_G2_compress/24,4.490159992948012e-6,4.484390935714641e-6,4.4967018763354235e-6,2.0782213906559093e-8,1.736151816078538e-8,2.5529815184022608e-8 +Bls12_381_G2_compress/24,4.477938433673515e-6,4.473376366089314e-6,4.484501013942274e-6,1.839873046373946e-8,1.4365174587351205e-8,2.3752198606273758e-8 +Bls12_381_G2_compress/24,4.487832221529966e-6,4.48120590972749e-6,4.496097086393494e-6,2.4324981450988344e-8,1.793453354237352e-8,3.06342451077735e-8 +Bls12_381_G2_compress/24,4.4719061817075366e-6,4.4673050034082835e-6,4.476411274800682e-6,1.5268195852468947e-8,1.2992805840131642e-8,1.822891849737885e-8 +Bls12_381_G2_compress/24,4.49971477127066e-6,4.490926502490308e-6,4.509148507984139e-6,2.989957265578073e-8,2.5316054180102684e-8,3.405560820185761e-8 +Bls12_381_G2_compress/24,4.4734293152445485e-6,4.469054456069871e-6,4.4787701899720274e-6,1.647137667563712e-8,1.4368409865570293e-8,1.904227043987702e-8 +Bls12_381_G2_compress/24,4.486324374521222e-6,4.480556452894699e-6,4.4931803711371334e-6,2.0998518879799702e-8,1.744755714921433e-8,2.7369232886651417e-8 +Bls12_381_G2_compress/24,4.493933744953781e-6,4.4890929578761875e-6,4.499474672443071e-6,1.7352872043508157e-8,1.4826034040395604e-8,2.042311801691468e-8 +Bls12_381_G2_compress/24,4.472364621466292e-6,4.46878432091565e-6,4.476323490818293e-6,1.2792345431231487e-8,1.0526466135341152e-8,1.8311574998879573e-8 +Bls12_381_G2_compress/24,4.460341060276176e-6,4.4573208080262756e-6,4.4634780881442055e-6,1.0361652778957462e-8,8.368260441814787e-9,1.2672876431521048e-8 +Bls12_381_G2_compress/24,4.458776898533878e-6,4.456623533083032e-6,4.4610038809612586e-6,7.815118494140448e-9,6.298372479894316e-9,9.471624721400607e-9 +Bls12_381_G2_compress/24,4.4815470464857725e-6,4.474428904779486e-6,4.488927930229373e-6,2.4082158679495837e-8,2.001282628190952e-8,3.0236007787240116e-8 +Bls12_381_G2_compress/24,4.4573741648196405e-6,4.456022516785451e-6,4.459135181540198e-6,4.9828560823532434e-9,3.999453189527347e-9,6.207820426816555e-9 +Bls12_381_G2_compress/24,4.460551693833552e-6,4.4595610128209546e-6,4.461762041901581e-6,3.6956802820603293e-9,3.157427848424006e-9,4.746671308492238e-9 +Bls12_381_G2_compress/24,4.473535035391517e-6,4.468535339831429e-6,4.478613030627824e-6,1.7041071360226433e-8,1.5044173994538217e-8,1.9343209675425254e-8 +Bls12_381_G2_compress/24,4.480086476507353e-6,4.471614751790112e-6,4.4895348297355134e-6,2.9785820570452968e-8,2.5590171666606275e-8,3.5047683391098854e-8 +Bls12_381_G2_compress/24,4.493949780985899e-6,4.4874385389819715e-6,4.501669332688259e-6,2.445008520942283e-8,2.078122829580892e-8,3.0831778721048856e-8 +Bls12_381_G2_compress/24,4.494811436569721e-6,4.489000151294437e-6,4.501184085471003e-6,2.0381438693348828e-8,1.7288036733694067e-8,2.4316186373842604e-8 +Bls12_381_G2_compress/24,4.463951252674855e-6,4.459110668655417e-6,4.469633202106069e-6,1.8002321125568076e-8,1.5319321960012243e-8,2.1360792777462163e-8 +Bls12_381_G2_compress/24,4.484168142692416e-6,4.479953001937428e-6,4.488579740718097e-6,1.518271848715697e-8,1.2500667779136535e-8,1.9825252814853373e-8 +Bls12_381_G2_compress/24,4.4831002762787205e-6,4.4784672179535105e-6,4.488044508371372e-6,1.6477675112786556e-8,1.4680781919980499e-8,1.9497004171765636e-8 +Bls12_381_G2_compress/24,4.481836309677612e-6,4.477738555097942e-6,4.486705879230458e-6,1.4692470693181813e-8,1.1349525623743624e-8,1.9635629283673937e-8 +Bls12_381_G2_compress/24,4.4651185145850735e-6,4.4633898611399255e-6,4.466967358787129e-6,6.029447025256269e-9,4.884837590113801e-9,7.464637670620278e-9 +Bls12_381_G2_compress/24,4.4946539691228966e-6,4.489705375578442e-6,4.500399842756054e-6,1.7427467146608742e-8,1.4660245839635725e-8,2.2281209350766835e-8 +Bls12_381_G2_compress/24,4.456730917381743e-6,4.454978982972283e-6,4.459008673428315e-6,6.772528146867589e-9,5.451029706069313e-9,9.019207560481798e-9 +Bls12_381_G2_compress/24,4.482594306874609e-6,4.477873040857285e-6,4.487929020697277e-6,1.643862682362759e-8,1.4609452629181636e-8,1.8794435018398286e-8 +Bls12_381_G2_compress/24,4.47054051906704e-6,4.467887745688168e-6,4.4742011149409535e-6,1.0430757483842534e-8,7.975438855208743e-9,1.3827947065914128e-8 +Bls12_381_G2_compress/24,4.474581707068759e-6,4.471738899251674e-6,4.477492143413731e-6,1.0276779066450207e-8,8.344302910871857e-9,1.2733260862516508e-8 +Bls12_381_G2_compress/24,4.482447041405725e-6,4.477614156022306e-6,4.490110714223894e-6,1.8767175827189872e-8,1.5371860322060778e-8,2.231797586459308e-8 +Bls12_381_G2_compress/24,4.488528028403969e-6,4.483433967885858e-6,4.494814120948323e-6,1.936771482551408e-8,1.6048320911024743e-8,2.3317084862111216e-8 +Bls12_381_G2_compress/24,4.497885276763904e-6,4.490972023973414e-6,4.506186335629026e-6,2.497438491084989e-8,2.175545900743706e-8,3.078743119296623e-8 +Bls12_381_G2_compress/24,4.480185804306606e-6,4.475877212495156e-6,4.486414784592081e-6,1.7240811113517997e-8,1.4605853464748992e-8,2.1481427612857804e-8 +Bls12_381_G2_compress/24,4.48563410079163e-6,4.479824851313827e-6,4.491563652331192e-6,2.045572849694163e-8,1.7471794781426265e-8,2.426250286808692e-8 +Bls12_381_G2_compress/24,4.473078622009006e-6,4.470696504766431e-6,4.47589368030979e-6,8.70695736516792e-9,7.105012538508673e-9,1.0955636270920074e-8 +Bls12_381_G2_compress/24,4.486627548549285e-6,4.481258571445589e-6,4.4928057493851425e-6,1.891715155480631e-8,1.598322069807599e-8,2.363281353493563e-8 +Bls12_381_G2_compress/24,4.503925566665844e-6,4.4966416634276884e-6,4.511335925899258e-6,2.409302263980751e-8,2.040116273919986e-8,2.8335899826542185e-8 +Bls12_381_G2_compress/24,4.487725368064784e-6,4.483165573574944e-6,4.493367721504761e-6,1.7746583729304512e-8,1.4944557547976272e-8,2.2694412057098435e-8 +Bls12_381_G2_compress/24,4.474009282661092e-6,4.469489349710089e-6,4.480603369621966e-6,1.82972887255463e-8,1.3733303492770053e-8,2.4065975777361414e-8 +Bls12_381_G2_compress/24,4.48496066870475e-6,4.479981319165085e-6,4.490507924648944e-6,1.7637669460421576e-8,1.4300809987458192e-8,2.2065618351219827e-8 +Bls12_381_G2_compress/24,4.501695050569071e-6,4.497149294350555e-6,4.5065185827599036e-6,1.6176835494324253e-8,1.3765137589982458e-8,1.9913038154520028e-8 +Bls12_381_G2_compress/24,4.505822882405147e-6,4.50024092887078e-6,4.5129704007048526e-6,2.0405496084848656e-8,1.7198781604661345e-8,2.4676526514246617e-8 +Bls12_381_G2_compress/24,4.498081143428331e-6,4.492970034775859e-6,4.503166063937654e-6,1.735772160375218e-8,1.4292155599689015e-8,2.1076035561671006e-8 +Bls12_381_G2_compress/24,4.488520197903452e-6,4.482804744808894e-6,4.4966777982275476e-6,2.2068458725285626e-8,1.723457387712395e-8,2.7440912063861783e-8 +Bls12_381_G2_compress/24,4.4865794478099634e-6,4.480206576059935e-6,4.49391272051999e-6,2.2287061789088753e-8,1.7745814719170375e-8,2.808251171174503e-8 +Bls12_381_G2_compress/24,4.498976245595867e-6,4.492311257632614e-6,4.505603590909025e-6,2.2088249733553345e-8,1.9378149418544547e-8,2.5699918069277328e-8 +Bls12_381_G2_compress/24,4.480466470485243e-6,4.476487598811475e-6,4.485883582288977e-6,1.498262075495414e-8,1.1571648252886656e-8,1.9665850769241816e-8 +Bls12_381_G2_compress/24,4.4875124158769735e-6,4.483092013133869e-6,4.494199542411586e-6,1.8180491027243606e-8,1.2279731782100515e-8,3.06785778445309e-8 +Bls12_381_G2_compress/24,4.496404356606266e-6,4.491449700844972e-6,4.502479237225465e-6,1.8431229930901675e-8,1.4573815756739243e-8,2.6854855591701967e-8 +Bls12_381_G2_compress/24,4.463511382232791e-6,4.460677270220255e-6,4.467565106212051e-6,1.1073278891713545e-8,7.717938848663344e-9,1.650615388295891e-8 +Bls12_381_G2_compress/24,4.461422564960903e-6,4.4579203201042386e-6,4.4668339890370286e-6,1.451876909824253e-8,1.0082920669884843e-8,2.0559524000095166e-8 +Bls12_381_G2_compress/24,4.500073640865639e-6,4.492045571522089e-6,4.507861905627913e-6,2.555045505199874e-8,2.1791523336066285e-8,3.110502515315762e-8 +Bls12_381_G2_compress/24,4.495245297831844e-6,4.491133020453866e-6,4.5004223935740515e-6,1.622927850059526e-8,1.2664109697248874e-8,2.110866348060408e-8 +Bls12_381_G2_compress/24,4.484566333858554e-6,4.481126502042592e-6,4.48982707710345e-6,1.4122073963779746e-8,9.87974556351789e-9,1.9076747878653486e-8 +Bls12_381_G2_compress/24,4.474056532467787e-6,4.4716787785876695e-6,4.477492950045218e-6,9.757982758206895e-9,7.319595117338277e-9,1.2976711513897198e-8 +Bls12_381_G2_compress/24,4.492032259830899e-6,4.488244147916157e-6,4.496510606715617e-6,1.3748322765574113e-8,1.157440497057756e-8,1.656209381417527e-8 +Bls12_381_G2_compress/24,4.520389144659202e-6,4.512846449886356e-6,4.528847482883674e-6,2.7489135020874064e-8,2.3339599089471297e-8,3.2858854685212745e-8 +Bls12_381_G2_compress/24,4.497459300024577e-6,4.491943084908547e-6,4.503998682770781e-6,2.001363571338702e-8,1.7763353785722917e-8,2.3235260607633388e-8 +Bls12_381_G2_compress/24,4.47059272229654e-6,4.468119402457684e-6,4.474037355039461e-6,9.857564324416555e-9,8.01852945320927e-9,1.343877861788178e-8 +Bls12_381_G2_compress/24,4.5086626331375726e-6,4.501837919305942e-6,4.516305804296802e-6,2.516121507565348e-8,2.1774163137575253e-8,2.8616656690110376e-8 +Bls12_381_G2_compress/24,4.503755040967891e-6,4.495669734619336e-6,4.512199087884757e-6,2.6696707693360958e-8,2.234648823057618e-8,3.268965770850006e-8 +Bls12_381_G2_compress/24,4.481019518429378e-6,4.4772732159521474e-6,4.487388921577208e-6,1.660624225385607e-8,1.2548579981846706e-8,2.2951469582210467e-8 +Bls12_381_G2_compress/24,4.4782409630823005e-6,4.473958365949879e-6,4.483274217740226e-6,1.5766461240157103e-8,1.2610925924335714e-8,1.9590092955616908e-8 +Bls12_381_G2_compress/24,4.50489974695264e-6,4.497982187567718e-6,4.512465865198362e-6,2.506649075672838e-8,2.2063803672884077e-8,2.8766989867549014e-8 +Bls12_381_G2_compress/24,4.503958613043944e-6,4.496801691556769e-6,4.51055980300888e-6,2.2891998442721765e-8,2.0049253892053702e-8,2.5983890305563173e-8 +Bls12_381_G2_compress/24,4.484735786828841e-6,4.479923239444164e-6,4.491984689596301e-6,1.9628065045189786e-8,1.5598319577794443e-8,2.4480858326653326e-8 +Bls12_381_G2_compress/24,4.497003929942836e-6,4.490858617790057e-6,4.5040725507070535e-6,2.2217119319228806e-8,1.837129260609057e-8,2.829662053356292e-8 +Bls12_381_G2_compress/24,4.4863838391764584e-6,4.480389083710624e-6,4.493815650595048e-6,2.2068326810527575e-8,1.8683217591301735e-8,2.752977900894102e-8 +Bls12_381_G2_compress/24,4.50876125366322e-6,4.502625492033323e-6,4.515596937770772e-6,2.1063478439594947e-8,1.7957831458786472e-8,2.6474661686370836e-8 +Bls12_381_G2_compress/24,4.460551955556263e-6,4.459254848001255e-6,4.46199221530973e-6,4.603508478834518e-9,4.073221662255847e-9,5.447475838065834e-9 +Bls12_381_G2_compress/24,4.488426750307325e-6,4.483043566501198e-6,4.495326692827117e-6,2.1356606695186993e-8,1.7953005866097247e-8,2.5713513224840053e-8 +Bls12_381_G2_compress/24,4.476812257700864e-6,4.472454989812052e-6,4.481486999514252e-6,1.5097436004850884e-8,1.2884390205532325e-8,1.8284352024498314e-8 +Bls12_381_G2_compress/24,4.482536444873887e-6,4.477266397701982e-6,4.4890552560540376e-6,1.907860345216982e-8,1.4585494492156278e-8,2.7021618985993638e-8 +Bls12_381_G2_compress/24,4.483653948179497e-6,4.480017007578089e-6,4.487456191887894e-6,1.2755238624329704e-8,1.07090601011171e-8,1.603989237124619e-8 +Bls12_381_G2_compress/24,4.497277863903486e-6,4.493076934691595e-6,4.501774068110303e-6,1.4132727233576122e-8,1.1716141017060636e-8,1.7168401836210593e-8 +Bls12_381_G2_compress/24,4.5155309131273785e-6,4.5083683633644575e-6,4.523321769388778e-6,2.460395679806921e-8,2.1488053601315314e-8,2.8297126378303872e-8 +Bls12_381_G2_compress/24,4.472707922300022e-6,4.46913144175835e-6,4.478449223085116e-6,1.5393489269340444e-8,1.047040223740479e-8,2.284249289839525e-8 +Bls12_381_G2_compress/24,4.500801722384024e-6,4.495365042246207e-6,4.507229722801382e-6,1.9238698647144095e-8,1.6717014636330462e-8,2.279422316878429e-8 +Bls12_381_G2_compress/24,4.514458369681824e-6,4.506325630055859e-6,4.5247485388004205e-6,3.1270845296022725e-8,2.55583623923824e-8,3.738278303718214e-8 +Bls12_381_G2_compress/24,4.480793515615463e-6,4.476979353073161e-6,4.486186769998003e-6,1.5399059024127674e-8,1.296492947354178e-8,1.8562574344716137e-8 +Bls12_381_G2_compress/24,4.48734568279628e-6,4.482538015432771e-6,4.492036664349571e-6,1.6061659551594687e-8,1.3872765516762512e-8,1.941730210621003e-8 +Bls12_381_G2_compress/24,4.5143021666600815e-6,4.507150880809876e-6,4.520375410170568e-6,2.2459146186577522e-8,1.9684995746946005e-8,2.6064873810957342e-8 +Bls12_381_G2_compress/24,4.5209808909091056e-6,4.516233919325663e-6,4.5263366621159855e-6,1.6829666862830583e-8,1.3815224431705952e-8,2.14673212685568e-8 +Bls12_381_G2_compress/24,4.51260464124081e-6,4.505592292365244e-6,4.518903348339562e-6,2.3374402469493353e-8,1.9745211711320425e-8,2.7917183557976942e-8 +Bls12_381_G2_compress/24,4.495192213895727e-6,4.489485476272098e-6,4.500704051425554e-6,1.79928737819654e-8,1.5449691835016964e-8,2.113973310454625e-8 +Bls12_381_G2_compress/24,4.485595338033461e-6,4.481495282940903e-6,4.4903037405904e-6,1.5045143337402997e-8,1.2158834160141927e-8,1.922987968027865e-8 +Bls12_381_G2_compress/24,4.4906245294648536e-6,4.484489611063624e-6,4.498550339177264e-6,2.2476667862154414e-8,1.7729585900810762e-8,2.842334944740524e-8 +Bls12_381_G2_compress/24,4.514499614226495e-6,4.508017731623382e-6,4.5222586770876355e-6,2.2770651080143856e-8,1.903794468158692e-8,2.749309915979186e-8 +Bls12_381_G2_compress/24,4.461316488069694e-6,4.458630821380349e-6,4.46495073699894e-6,1.0765326153604861e-8,7.94856734998886e-9,1.4745702071336424e-8 +Bls12_381_G2_compress/24,4.471905324942121e-6,4.467427629651534e-6,4.476656908999133e-6,1.522930012997049e-8,1.2580304404555598e-8,1.8890716636636378e-8 +Bls12_381_G2_compress/24,4.490375371553024e-6,4.482805385434586e-6,4.498087036054148e-6,2.4283085568061124e-8,2.054714836418237e-8,2.980617798752828e-8 +Bls12_381_G2_compress/24,4.507867408285585e-6,4.500831565181309e-6,4.517741268662763e-6,2.650531083143467e-8,2.203971585871165e-8,3.517179099324207e-8 +Bls12_381_G2_compress/24,4.484029905456001e-6,4.479906982891064e-6,4.489081358125962e-6,1.5332724635366472e-8,1.3465335864352749e-8,1.7672367481782605e-8 +Bls12_381_G2_compress/24,4.473896634809549e-6,4.4721834250770745e-6,4.4761801003154425e-6,6.395688377630983e-9,5.2401469819453734e-9,8.097097080447828e-9 +Bls12_381_G2_compress/24,4.483585909155061e-6,4.47842109852072e-6,4.490380102534803e-6,1.941879621844309e-8,1.6367211604915536e-8,2.3225474065582247e-8 +Bls12_381_G2_compress/24,4.476539694630472e-6,4.471945251541213e-6,4.48193780803602e-6,1.625465428634518e-8,1.3979131899364892e-8,1.9195532862432342e-8 +Bls12_381_G2_compress/24,4.471328099990277e-6,4.468541387269371e-6,4.475695414214863e-6,1.1728740568182837e-8,8.042241677726552e-9,1.7046929536576993e-8 +Bls12_381_G2_compress/24,4.485384852010975e-6,4.4800339642989885e-6,4.491674461090183e-6,2.0368865604263423e-8,1.702563040659319e-8,2.525166310796582e-8 +Bls12_381_G2_compress/24,4.487353378960722e-6,4.482807524677165e-6,4.494128652305505e-6,1.8015934240630665e-8,1.3454862057789802e-8,2.7657526304186306e-8 +Bls12_381_G2_compress/24,4.5040222481369405e-6,4.494975308042294e-6,4.515694266821225e-6,3.564199650601868e-8,3.150389163236145e-8,4.032939522902125e-8 +Bls12_381_G2_uncompress/12,3.368331661846462e-5,3.367291827275936e-5,3.369685278889438e-5,4.0649362678196495e-8,3.340986430215876e-8,5.040923327080929e-8 +Bls12_381_G2_uncompress/12,3.37460912100559e-5,3.373519876759965e-5,3.375709713819811e-5,3.5056343802191235e-8,2.9497503171840963e-8,4.158217265971079e-8 +Bls12_381_G2_uncompress/12,3.372158681172636e-5,3.371219667442539e-5,3.373088997269635e-5,3.130046572315666e-8,2.668640151100567e-8,3.8028341068818285e-8 +Bls12_381_G2_uncompress/12,3.367262992884462e-5,3.365738819976914e-5,3.369034650231155e-5,5.383309363395393e-8,4.6118478922860875e-8,6.339155869724838e-8 +Bls12_381_G2_uncompress/12,3.371026003781142e-5,3.3700245240976824e-5,3.372057462301585e-5,3.56002123132442e-8,3.038030522186163e-8,4.250259159114893e-8 +Bls12_381_G2_uncompress/12,3.374534218553453e-5,3.373605528861225e-5,3.375380596006134e-5,2.8779259428250616e-8,2.3660223215979382e-8,3.595610681616483e-8 +Bls12_381_G2_uncompress/12,3.372457879868171e-5,3.371634773466306e-5,3.3733694911966814e-5,2.999012429313029e-8,2.5019018481332262e-8,3.607059632515831e-8 +Bls12_381_G2_uncompress/12,3.3738715889924457e-5,3.3728881110799665e-5,3.374738003705994e-5,3.1232544445432875e-8,2.585907880797334e-8,3.892927033900876e-8 +Bls12_381_G2_uncompress/12,3.3729888861690227e-5,3.372142131824873e-5,3.3738820937262296e-5,2.8677946358084518e-8,2.3491514967296998e-8,3.592099440545622e-8 +Bls12_381_G2_uncompress/12,3.372785769846755e-5,3.372132689781245e-5,3.3735608621325173e-5,2.46923448631019e-8,2.0431639697720108e-8,3.035867236546243e-8 +Bls12_381_G2_uncompress/12,3.374441117475096e-5,3.373482825723694e-5,3.375199435632881e-5,2.9424008266972756e-8,2.3451995130115943e-8,3.6838110737812003e-8 +Bls12_381_G2_uncompress/12,3.372537790208422e-5,3.371740936743446e-5,3.37329925578208e-5,2.7058041366018322e-8,2.2738186618759055e-8,3.407404960261042e-8 +Bls12_381_G2_uncompress/12,3.367351742413692e-5,3.3659405875199915e-5,3.368925667011788e-5,4.8923292460134285e-8,4.172692702873501e-8,5.770304381394602e-8 +Bls12_381_G2_uncompress/12,3.370214567076741e-5,3.369411913728443e-5,3.371046150501899e-5,2.839384483682829e-8,2.238752017837688e-8,3.583131570197603e-8 +Bls12_381_G2_uncompress/12,3.3701989893700634e-5,3.369199538536491e-5,3.371206850144989e-5,3.337570156912946e-8,2.664438611975966e-8,4.523011110825886e-8 +Bls12_381_G2_uncompress/12,3.372836070767894e-5,3.371751229686101e-5,3.373760389043035e-5,3.3319243217809556e-8,2.7420871534407307e-8,4.2572508362691576e-8 +Bls12_381_G2_uncompress/12,3.370998514836897e-5,3.369331133165032e-5,3.37229908596486e-5,5.099621078765201e-8,4.076703124104015e-8,6.208124889788935e-8 +Bls12_381_G2_uncompress/12,3.373422712385182e-5,3.372549151560856e-5,3.374367163815047e-5,3.077220621578622e-8,2.4381639068348604e-8,3.956564105580416e-8 +Bls12_381_G2_uncompress/12,3.371094554670268e-5,3.3694556063800264e-5,3.3722371339469475e-5,4.619803408504752e-8,3.400675172953393e-8,6.375241165108103e-8 +Bls12_381_G2_uncompress/12,3.3686812500799126e-5,3.367839189228087e-5,3.369529501671225e-5,2.9794263802513914e-8,2.5043704192620663e-8,3.645143662067461e-8 +Bls12_381_G2_uncompress/12,3.372664192642419e-5,3.371790297563634e-5,3.373446073526762e-5,2.9409852513419243e-8,2.3761436011448597e-8,3.8260049027386665e-8 +Bls12_381_G2_uncompress/12,3.370847747827224e-5,3.3697481531771325e-5,3.3719518600772304e-5,3.6997284980034115e-8,3.150148770319346e-8,4.3753142240594806e-8 +Bls12_381_G2_uncompress/12,3.373593508531189e-5,3.372802879864757e-5,3.3742856283682615e-5,2.4891826888162524e-8,2.0121328575503146e-8,3.1080644208989575e-8 +Bls12_381_G2_uncompress/12,3.3710463217275126e-5,3.369779296199506e-5,3.3722707339261375e-5,4.167789757312139e-8,3.424933395049679e-8,5.199433030609943e-8 +Bls12_381_G2_uncompress/12,3.370816931876761e-5,3.369785550621333e-5,3.3720251551104215e-5,3.533755228972252e-8,3.034783340119071e-8,4.275959926382064e-8 +Bls12_381_G2_uncompress/12,3.3672319745037066e-5,3.3660498641544606e-5,3.3683488724487315e-5,3.808441462225403e-8,3.240561939951706e-8,4.853846409812958e-8 +Bls12_381_G2_uncompress/12,3.369072389052844e-5,3.3682677090979374e-5,3.370059134801669e-5,3.003132840546861e-8,2.5107744675080792e-8,3.670112973522527e-8 +Bls12_381_G2_uncompress/12,3.372305579147366e-5,3.3713752831827037e-5,3.373151004257338e-5,2.990707554550732e-8,2.582880865037764e-8,3.847601265543224e-8 +Bls12_381_G2_uncompress/12,3.366417725735334e-5,3.365893787843922e-5,3.3669756850450055e-5,1.826099661340167e-8,1.5926565678656576e-8,2.1450014113435272e-8 +Bls12_381_G2_uncompress/12,3.3648187220217404e-5,3.364047768001048e-5,3.365721893528248e-5,2.8188971197727086e-8,2.4631177225821235e-8,3.23015920801455e-8 +Bls12_381_G2_uncompress/12,3.3684755511867977e-5,3.366873483626861e-5,3.369916951007301e-5,5.228462977441141e-8,4.6751597444054615e-8,6.008185347941934e-8 +Bls12_381_G2_uncompress/12,3.369573520430405e-5,3.368649787142132e-5,3.3705132152321845e-5,2.9950891970384135e-8,2.456699829392113e-8,3.8628075571987626e-8 +Bls12_381_G2_uncompress/12,3.366040721879349e-5,3.365266963050979e-5,3.366924832544693e-5,2.799982887717617e-8,2.3462737014789627e-8,3.529588092073405e-8 +Bls12_381_G2_uncompress/12,3.369290927710014e-5,3.367424467270492e-5,3.3710362247590235e-5,5.692197648038245e-8,5.1177991785092555e-8,6.4210842639764e-8 +Bls12_381_G2_uncompress/12,3.3728259137640626e-5,3.3718878613497785e-5,3.3735879894195856e-5,2.800772902675653e-8,2.321992514059673e-8,3.479501098179543e-8 +Bls12_381_G2_uncompress/12,3.370864041176259e-5,3.3699486437880526e-5,3.371676435763151e-5,2.9695656584567705e-8,2.4772857376545393e-8,3.581616634720994e-8 +Bls12_381_G2_uncompress/12,3.3729618905981235e-5,3.3722093994933215e-5,3.3737018174295265e-5,2.5996938112388343e-8,2.1831574894819145e-8,3.211665089289109e-8 +Bls12_381_G2_uncompress/12,3.3684619185185666e-5,3.367357511905802e-5,3.369634959657246e-5,3.844171330545213e-8,3.173407474862979e-8,4.803469802221334e-8 +Bls12_381_G2_uncompress/12,3.3633691091420034e-5,3.362112107784285e-5,3.3645719341454086e-5,3.94837742328844e-8,3.3433128960639554e-8,4.759545278859536e-8 +Bls12_381_G2_uncompress/12,3.3732734683582256e-5,3.3720952057913174e-5,3.374600717981091e-5,4.145073686175565e-8,3.3947802190544333e-8,4.933911671205197e-8 +Bls12_381_G2_uncompress/12,3.3670068828514477e-5,3.366000042632345e-5,3.368046168400567e-5,3.305985360212626e-8,2.6364818064185116e-8,4.196700341468266e-8 +Bls12_381_G2_uncompress/12,3.368640522563393e-5,3.367833541369626e-5,3.369592693827729e-5,2.9297421135737572e-8,2.511963164802634e-8,3.505475676882953e-8 +Bls12_381_G2_uncompress/12,3.3703418121327484e-5,3.369531912264688e-5,3.371202182205049e-5,2.890425352007031e-8,2.4773336144570688e-8,3.5456377655785535e-8 +Bls12_381_G2_uncompress/12,3.369796370734024e-5,3.3687729079120675e-5,3.370936754883198e-5,3.702286486848039e-8,3.1119281645740685e-8,4.541516405620434e-8 +Bls12_381_G2_uncompress/12,3.366299769777637e-5,3.365341130357184e-5,3.367215206632537e-5,3.3031082342463315e-8,2.8103349374614928e-8,4.0515826938576696e-8 +Bls12_381_G2_uncompress/12,3.371648211758041e-5,3.370707651723831e-5,3.372441928469973e-5,2.94004047337134e-8,2.1713133603864598e-8,4.242703764754408e-8 +Bls12_381_G2_uncompress/12,3.372209999648925e-5,3.371350612244654e-5,3.373020830621123e-5,2.8816687316365537e-8,2.3308482852416458e-8,3.581311692069196e-8 +Bls12_381_G2_uncompress/12,3.371145752283744e-5,3.370380277921693e-5,3.371948965581531e-5,2.576233080337445e-8,2.1908466667668996e-8,3.0355939759241285e-8 +Bls12_381_G2_uncompress/12,3.3707642357358705e-5,3.369787193312565e-5,3.371676797921265e-5,2.9959807174676246e-8,2.49538791923691e-8,3.669380827459282e-8 +Bls12_381_G2_uncompress/12,3.370763824298719e-5,3.3698975102388525e-5,3.371819726647414e-5,3.175929299136193e-8,2.6755555758411995e-8,3.876420500814298e-8 +Bls12_381_G2_uncompress/12,3.3668168181354616e-5,3.3660651614759464e-5,3.367538292671355e-5,2.433233431171747e-8,2.0922723934915225e-8,2.955245478484389e-8 +Bls12_381_G2_uncompress/12,3.370093608636609e-5,3.3686809143814657e-5,3.371334806615229e-5,4.223588802470261e-8,3.627791797144188e-8,4.9407025718545995e-8 +Bls12_381_G2_uncompress/12,3.3675152790406234e-5,3.366735316368274e-5,3.368199982079446e-5,2.6080686616392678e-8,2.1604641530413334e-8,3.3235275613833234e-8 +Bls12_381_G2_uncompress/12,3.3710365181387294e-5,3.370115712334436e-5,3.372029064497029e-5,3.090072248959039e-8,2.6019013845521176e-8,3.719944188370163e-8 +Bls12_381_G2_uncompress/12,3.3714153680099e-5,3.370307769289218e-5,3.372168264886094e-5,3.096567671738797e-8,2.5391246758064082e-8,3.776026153137279e-8 +Bls12_381_G2_uncompress/12,3.367550323104058e-5,3.366782684052052e-5,3.36838108126153e-5,2.7461876232572124e-8,2.331382742732485e-8,3.3661314852079345e-8 +Bls12_381_G2_uncompress/12,3.3707512238833985e-5,3.3700164313246446e-5,3.371442830535456e-5,2.5759834933705554e-8,2.2341660421552227e-8,3.073211804913365e-8 +Bls12_381_G2_uncompress/12,3.373183997675079e-5,3.3726775749706804e-5,3.3736618144838244e-5,1.6336343706002188e-8,1.3940797048175886e-8,1.9933348136876606e-8 +Bls12_381_G2_uncompress/12,3.37268860890591e-5,3.371570645375917e-5,3.3737056125493846e-5,3.4596153161684925e-8,2.811754925348263e-8,4.269419633136117e-8 +Bls12_381_G2_uncompress/12,3.371592405003103e-5,3.370665092266735e-5,3.3725611262957744e-5,3.113989271711134e-8,2.584149093865469e-8,3.8492068260961825e-8 +Bls12_381_G2_uncompress/12,3.3739476770308424e-5,3.373051764506177e-5,3.3747260438570524e-5,2.636278682511915e-8,2.1752130533104296e-8,3.2518794921557026e-8 +Bls12_381_G2_uncompress/12,3.373788930691076e-5,3.372980409917051e-5,3.374542326726575e-5,2.7304900228591988e-8,2.228001278737098e-8,3.4915013627531254e-8 +Bls12_381_G2_uncompress/12,3.368220024078363e-5,3.366906014824435e-5,3.3697990739612596e-5,4.5401046066666276e-8,3.882036933003415e-8,5.495345370706566e-8 +Bls12_381_G2_uncompress/12,3.371540021380329e-5,3.3707208161085544e-5,3.372541734350792e-5,3.016159001045685e-8,2.4250251476059323e-8,3.784334934718404e-8 +Bls12_381_G2_uncompress/12,3.366976008045583e-5,3.365684963468495e-5,3.36812155594247e-5,3.922442860467293e-8,3.4363906036841293e-8,4.5081767852490144e-8 +Bls12_381_G2_uncompress/12,3.3724486601123806e-5,3.371045806624737e-5,3.373483224655538e-5,3.9649384104948735e-8,3.134166042447259e-8,5.2249469914078974e-8 +Bls12_381_G2_uncompress/12,3.37076129767199e-5,3.369707329717063e-5,3.3719294053159935e-5,3.6108187072502e-8,3.0412283759611976e-8,4.7518028328467675e-8 +Bls12_381_G2_uncompress/12,3.371661541261064e-5,3.370830509189959e-5,3.3724350386407433e-5,2.650672550592543e-8,2.0547109082546627e-8,3.550269493608434e-8 +Bls12_381_G2_uncompress/12,3.37102550344057e-5,3.3699663411101163e-5,3.371853125539516e-5,3.221735357280586e-8,2.666028086546033e-8,4.10467827684095e-8 +Bls12_381_G2_uncompress/12,3.374712794915472e-5,3.3741467318191706e-5,3.375231058147286e-5,1.8814544560046902e-8,1.5420002761751856e-8,2.5553453850476318e-8 +Bls12_381_G2_uncompress/12,3.372113571607448e-5,3.370732275667284e-5,3.3731740953781505e-5,4.1025105735378866e-8,3.2424831811815974e-8,5.348822227064699e-8 +Bls12_381_G2_uncompress/12,3.36897625551872e-5,3.368335754362706e-5,3.369738822162257e-5,2.470022698926335e-8,1.9423755906942595e-8,3.464466954456096e-8 +Bls12_381_G2_uncompress/12,3.3676620930021234e-5,3.3664870611250154e-5,3.368786919612592e-5,3.919350936620381e-8,3.177409281594349e-8,4.8462335588664636e-8 +Bls12_381_G2_uncompress/12,3.370623864805028e-5,3.3697259388836615e-5,3.3714844076289694e-5,2.9392044662406592e-8,2.4491043144142235e-8,3.816999940662892e-8 +Bls12_381_G2_uncompress/12,3.370956128361855e-5,3.370211049499798e-5,3.371604070244216e-5,2.4598429392685263e-8,1.9853240154654137e-8,3.0830669337637296e-8 +Bls12_381_G2_uncompress/12,3.363744784406855e-5,3.3626329672815705e-5,3.364832304048237e-5,3.7518626058367525e-8,3.133747219673104e-8,4.5358235487337614e-8 +Bls12_381_G2_uncompress/12,3.3690521377750744e-5,3.367969850200511e-5,3.370107542852144e-5,3.5810965520806963e-8,2.9758727410873297e-8,4.3254068395094707e-8 +Bls12_381_G2_uncompress/12,3.370694269413603e-5,3.369151830770724e-5,3.371630367971731e-5,3.9547964674159935e-8,2.8386880434968097e-8,5.667519610924559e-8 +Bls12_381_G2_uncompress/12,3.370259052859528e-5,3.3682264689929345e-5,3.371894143824342e-5,5.8836189760398466e-8,4.882506766333477e-8,7.453848070980615e-8 +Bls12_381_G2_uncompress/12,3.3642765295200984e-5,3.363502672974287e-5,3.365203475629195e-5,2.7985878755682933e-8,2.0668974236646834e-8,3.777349642123613e-8 +Bls12_381_G2_uncompress/12,3.364323482147261e-5,3.3628359236747124e-5,3.366190361100342e-5,5.529213188180726e-8,4.629500110700922e-8,6.459831919793065e-8 +Bls12_381_G2_uncompress/12,3.3716413876373766e-5,3.3708577396547814e-5,3.372514208887315e-5,2.7630357509930095e-8,2.3111641359047324e-8,3.351780864699293e-8 +Bls12_381_G2_uncompress/12,3.369172878714875e-5,3.368294168604478e-5,3.370081513227973e-5,3.0978708145078455e-8,2.6725420505724354e-8,3.732949568407692e-8 +Bls12_381_G2_uncompress/12,3.3667013124744857e-5,3.365164885276759e-5,3.3683090648886125e-5,5.505390764764752e-8,4.801459418117831e-8,6.760373099041724e-8 +Bls12_381_G2_uncompress/12,3.368946855470384e-5,3.36797023622018e-5,3.3698148233982016e-5,3.026165025855063e-8,2.474896656696865e-8,3.935034592735068e-8 +Bls12_381_G2_uncompress/12,3.370234297705171e-5,3.368837820435658e-5,3.371225487598361e-5,3.9720094063022875e-8,3.2104351464398536e-8,5.287525100113241e-8 +Bls12_381_G2_uncompress/12,3.371176776015668e-5,3.370146801697894e-5,3.3721948136653205e-5,3.4669487227884736e-8,2.9564870049810287e-8,4.1498290262902184e-8 +Bls12_381_G2_uncompress/12,3.368759697317292e-5,3.367954865685448e-5,3.36949947659397e-5,2.581089872960588e-8,2.1692474019281906e-8,3.106248038010286e-8 +Bls12_381_G2_uncompress/12,3.370707912623566e-5,3.369586066567834e-5,3.371587157341948e-5,3.298968245005678e-8,2.7537827072275173e-8,4.380212387977398e-8 +Bls12_381_G2_uncompress/12,3.369610676580165e-5,3.368160049932145e-5,3.370902998826088e-5,4.5152667128471284e-8,3.809907924722644e-8,5.4926769686247236e-8 +Bls12_381_G2_uncompress/12,3.37206634065477e-5,3.3713306516995556e-5,3.372772976844866e-5,2.539780545743215e-8,2.1774251902130387e-8,3.084707894252458e-8 +Bls12_381_G2_uncompress/12,3.372522981399643e-5,3.371555934372195e-5,3.3735039103467305e-5,3.293385670922351e-8,2.772489726139651e-8,4.144869827437471e-8 +Bls12_381_G2_uncompress/12,3.370259288514234e-5,3.368848805222842e-5,3.371790959992366e-5,4.896003223033257e-8,4.3156056390438974e-8,5.605138655510269e-8 +Bls12_381_G2_uncompress/12,3.374648053095212e-5,3.3739683791166705e-5,3.375283213040814e-5,2.2755906460638733e-8,1.938670928244765e-8,2.749811085285635e-8 +Bls12_381_G2_uncompress/12,3.3715051876432916e-5,3.370899833949093e-5,3.372061712869348e-5,1.9136481146619343e-8,1.5508744381652927e-8,2.5503268508390293e-8 +Bls12_381_G2_uncompress/12,3.371913200682742e-5,3.371201324791634e-5,3.372553424761996e-5,2.3231189763843498e-8,1.8331237781489392e-8,3.0409896668208317e-8 +Bls12_381_G2_uncompress/12,3.369755007270294e-5,3.368717336043164e-5,3.370617848642851e-5,3.155082262665045e-8,2.6676191860517945e-8,3.8603825929804484e-8 +Bls12_381_G2_uncompress/12,3.3709933251831695e-5,3.370065626656161e-5,3.372010281293742e-5,3.294073104323416e-8,2.8659074547445638e-8,3.809305090750709e-8 +Bls12_381_G2_uncompress/12,3.373217013024657e-5,3.372364193495861e-5,3.373963743713357e-5,2.7782907952420355e-8,2.2383452003047133e-8,3.536245941664676e-8 +Bls12_381_G2_uncompress/12,3.3708665856675674e-5,3.369943092708221e-5,3.371683109946718e-5,2.9440508573713478e-8,2.5087582618107095e-8,3.438089945017901e-8 +Bls12_381_mulMlResult/144/144,3.1685220092723058e-6,3.165215509078869e-6,3.172771155060226e-6,1.2985544971470523e-8,1.0521246167627658e-8,1.607682560266259e-8 +Bls12_381_mulMlResult/144/144,3.166924461312826e-6,3.161995899294484e-6,3.1721608810276537e-6,1.6672804595632662e-8,1.4225274388291793e-8,1.9571464792172482e-8 +Bls12_381_mulMlResult/144/144,3.1546119830548668e-6,3.15254695804716e-6,3.157632151470478e-6,8.33203953651798e-9,6.6146079710792875e-9,1.0287774587496977e-8 +Bls12_381_mulMlResult/144/144,3.1505546964285325e-6,3.1478854290602947e-6,3.1539065541263822e-6,9.596457639317141e-9,7.959076796997774e-9,1.1213995277379382e-8 +Bls12_381_mulMlResult/144/144,3.180693702664619e-6,3.175788743321471e-6,3.185994729554176e-6,1.6996014303723297e-8,1.4711764919192896e-8,2.017350971393647e-8 +Bls12_381_mulMlResult/144/144,3.178512341911817e-6,3.173977909757939e-6,3.1842516621642354e-6,1.7824988711772812e-8,1.3802396186370278e-8,2.53603980051796e-8 +Bls12_381_mulMlResult/144/144,3.175534732264867e-6,3.1715671593000367e-6,3.179329572434259e-6,1.3247499757344309e-8,1.183473954204884e-8,1.5129308860909847e-8 +Bls12_381_mulMlResult/144/144,3.1782606978622416e-6,3.175027414154079e-6,3.1822799362208567e-6,1.2407119426047714e-8,1.0604548693863413e-8,1.4902812373088216e-8 +Bls12_381_mulMlResult/144/144,3.1633132982291347e-6,3.1592896080089895e-6,3.168276644216577e-6,1.591532511093361e-8,1.322964610586498e-8,1.9318941019746873e-8 +Bls12_381_mulMlResult/144/144,3.162293264336585e-6,3.1593996937188436e-6,3.1655664186420456e-6,1.037774129324289e-8,8.773742806731935e-9,1.2688603267781083e-8 +Bls12_381_mulMlResult/144/144,3.1732120705174972e-6,3.168896181124404e-6,3.178963132280994e-6,1.7585148456125987e-8,1.4721199598577915e-8,2.211227392462175e-8 +Bls12_381_mulMlResult/144/144,3.154286923191072e-6,3.152381083619655e-6,3.1571193972313448e-6,7.91051486150099e-9,5.789675876522367e-9,1.1623516988321456e-8 +Bls12_381_mulMlResult/144/144,3.1608354858699195e-6,3.1575711507160645e-6,3.1649882973757506e-6,1.2208569845545414e-8,9.93715952849094e-9,1.4867353206413229e-8 +Bls12_381_mulMlResult/144/144,3.165079644948014e-6,3.159985993228749e-6,3.1718474679548723e-6,1.942719455750839e-8,1.663554871516396e-8,2.319691187941915e-8 +Bls12_381_mulMlResult/144/144,3.148788602789847e-6,3.146878067750738e-6,3.1518258577973766e-6,8.455900919460393e-9,6.428703342486141e-9,1.0920739713085953e-8 +Bls12_381_mulMlResult/144/144,3.1638124389457836e-6,3.159975349993909e-6,3.1683276014439336e-6,1.4284656591431473e-8,1.233163964035893e-8,1.6888427241442423e-8 +Bls12_381_mulMlResult/144/144,3.1732061550204596e-6,3.1681035668341786e-6,3.179045644595488e-6,1.8298209986871486e-8,1.567707172541116e-8,2.1645746118018172e-8 +Bls12_381_mulMlResult/144/144,3.1634630316464692e-6,3.1598093007756358e-6,3.1677896229852368e-6,1.3897177159665167e-8,1.1027866005769439e-8,1.7134586642807048e-8 +Bls12_381_mulMlResult/144/144,3.1681904241601714e-6,3.1646117906439457e-6,3.172240212791877e-6,1.3484549172910179e-8,1.1232329569989821e-8,1.6135490084901334e-8 +Bls12_381_mulMlResult/144/144,3.1661161095110967e-6,3.1627369691009756e-6,3.1707549206763915e-6,1.3498324490523272e-8,1.0986672983653033e-8,1.6716917651488844e-8 +Bls12_381_mulMlResult/144/144,3.1665172143466013e-6,3.162129966068053e-6,3.1726299740222605e-6,1.702857099087188e-8,1.409159993424233e-8,2.3514898300812786e-8 +Bls12_381_mulMlResult/144/144,3.1688801865902153e-6,3.1639902641476547e-6,3.1736955730650154e-6,1.630187679303213e-8,1.4360461943579942e-8,1.922240083557104e-8 +Bls12_381_mulMlResult/144/144,3.1673929995030292e-6,3.163419168355165e-6,3.1711166497036804e-6,1.2369117784776915e-8,1.0381641692807926e-8,1.4586781243000524e-8 +Bls12_381_mulMlResult/144/144,3.1677058010306363e-6,3.16399043326124e-6,3.171857970729691e-6,1.3102796206207634e-8,1.0797956873684928e-8,1.6894875284112638e-8 +Bls12_381_mulMlResult/144/144,3.174482571952418e-6,3.1704394606680966e-6,3.180107925030493e-6,1.6260404148792194e-8,1.3489457218811759e-8,1.9984166475885184e-8 +Bls12_381_mulMlResult/144/144,3.1611412027370113e-6,3.1577428147635883e-6,3.165206931951452e-6,1.3282535934269835e-8,1.0969067577489207e-8,1.6039304355188036e-8 +Bls12_381_mulMlResult/144/144,3.1549316654312245e-6,3.152516798720918e-6,3.1583421968923103e-6,9.792417352207248e-9,8.382269108679532e-9,1.2055430928452412e-8 +Bls12_381_mulMlResult/144/144,3.1816663878162057e-6,3.1774600347155202e-6,3.1868150421961117e-6,1.5309205774812633e-8,1.2580963152651843e-8,1.9044199540111306e-8 +Bls12_381_mulMlResult/144/144,3.1550201281927106e-6,3.1534640427265304e-6,3.1574322691664696e-6,6.248819335301975e-9,4.400639851004124e-9,9.755139519975509e-9 +Bls12_381_mulMlResult/144/144,3.1685444907906333e-6,3.164461419583586e-6,3.173730964736474e-6,1.5822816836589666e-8,1.2410541708518216e-8,2.119913698947708e-8 +Bls12_381_mulMlResult/144/144,3.160239834738212e-6,3.157048069102598e-6,3.1643658078538023e-6,1.2519773862688114e-8,1.0381823146236903e-8,1.5427958039199574e-8 +Bls12_381_mulMlResult/144/144,3.17684104663703e-6,3.171564311926605e-6,3.183346230808408e-6,1.992489893333657e-8,1.5591441516729143e-8,2.4980914875955552e-8 +Bls12_381_mulMlResult/144/144,3.170409250479184e-6,3.1665088868125895e-6,3.1752745356165442e-6,1.5415593961308055e-8,1.3144561776341824e-8,1.947339669439728e-8 +Bls12_381_mulMlResult/144/144,3.1827646745753118e-6,3.1763419865798093e-6,3.189937962789863e-6,2.278699403013474e-8,1.8850600352972555e-8,2.789469795936881e-8 +Bls12_381_mulMlResult/144/144,3.1576434314671977e-6,3.153757726330517e-6,3.1616389407760352e-6,1.3809905661181432e-8,1.1846313177410427e-8,1.6741227895045207e-8 +Bls12_381_mulMlResult/144/144,3.1556008842698e-6,3.152489563395496e-6,3.1590803388825118e-6,1.125568868574914e-8,9.668420039779115e-9,1.3528697199328325e-8 +Bls12_381_mulMlResult/144/144,3.1735867326889395e-6,3.168959090632279e-6,3.1796935859056465e-6,1.7423056379488903e-8,1.4655369717995453e-8,2.198869982249551e-8 +Bls12_381_mulMlResult/144/144,3.1591605673595206e-6,3.1555132519332325e-6,3.1637162758984078e-6,1.3461669435672982e-8,1.1085137550605886e-8,1.6681477832793234e-8 +Bls12_381_mulMlResult/144/144,3.1600201490251378e-6,3.1559591525362726e-6,3.164249535403385e-6,1.3649156605611607e-8,1.1632337897859607e-8,1.609460540879479e-8 +Bls12_381_mulMlResult/144/144,3.163624173843904e-6,3.1602457163670707e-6,3.167786584015913e-6,1.1857588453154807e-8,9.670329689677673e-9,1.5042073707302988e-8 +Bls12_381_mulMlResult/144/144,3.156095407154485e-6,3.154113539378448e-6,3.1585327410374295e-6,7.720592719357867e-9,6.298133352798016e-9,9.551582951473163e-9 +Bls12_381_mulMlResult/144/144,3.168200903766938e-6,3.1643616185202214e-6,3.172680629427053e-6,1.39908750839697e-8,1.1889927641312498e-8,1.723860212668586e-8 +Bls12_381_mulMlResult/144/144,3.1588804346448647e-6,3.1554405999552273e-6,3.1620451879349246e-6,1.1228301500651357e-8,9.535086580647643e-9,1.4155309040038914e-8 +Bls12_381_mulMlResult/144/144,3.168075261654159e-6,3.1638453555082244e-6,3.1729682241864217e-6,1.555650073405374e-8,1.29137139183454e-8,1.913406196682043e-8 +Bls12_381_mulMlResult/144/144,3.1769314404759945e-6,3.1733323763011896e-6,3.1817620690073778e-6,1.4287848485705416e-8,1.169753640859062e-8,2.0119323005209183e-8 +Bls12_381_mulMlResult/144/144,3.1789519596681085e-6,3.175474751010889e-6,3.1827677986800295e-6,1.2449664861767548e-8,1.0681523437164093e-8,1.489467696970385e-8 +Bls12_381_mulMlResult/144/144,3.1546483254776526e-6,3.152806187575659e-6,3.157978563696213e-6,8.161721676374791e-9,5.546693505415707e-9,1.2150060213168238e-8 +Bls12_381_mulMlResult/144/144,3.1740936532645716e-6,3.1685469996552026e-6,3.1806353851288155e-6,2.0806109906697097e-8,1.6138567856693968e-8,2.626789535481785e-8 +Bls12_381_mulMlResult/144/144,3.1729211315618834e-6,3.1691528048825126e-6,3.1779059110744542e-6,1.4034239641377616e-8,1.0883410963242598e-8,1.8930196908262396e-8 +Bls12_381_mulMlResult/144/144,3.177184134178048e-6,3.172177636937756e-6,3.1838157183843204e-6,2.0229528407554943e-8,1.6527350394701666e-8,2.5413433921006104e-8 +Bls12_381_mulMlResult/144/144,3.1998988720350204e-6,3.1953542407082495e-6,3.2054652775072734e-6,1.755941448671574e-8,1.4495192800775998e-8,2.3194586482511737e-8 +Bls12_381_mulMlResult/144/144,3.163976074110646e-6,3.1593620326142964e-6,3.1694221956605267e-6,1.6384446245620423e-8,1.3782570808555794e-8,1.9642564352281356e-8 +Bls12_381_mulMlResult/144/144,3.1592534415323953e-6,3.1557392179462285e-6,3.1633977243283988e-6,1.2639681970685476e-8,1.0680228661940332e-8,1.538911408695326e-8 +Bls12_381_mulMlResult/144/144,3.167533999286323e-6,3.163037245136136e-6,3.172160876998618e-6,1.52165444200115e-8,1.329672726012519e-8,1.7418397332756243e-8 +Bls12_381_mulMlResult/144/144,3.1499409573819474e-6,3.1462641367128678e-6,3.154763786603122e-6,1.3769032361951026e-8,1.0306886053939365e-8,1.780378927260946e-8 +Bls12_381_mulMlResult/144/144,3.1574090781380703e-6,3.154982478550571e-6,3.1603725221779247e-6,8.995367725073279e-9,6.842492744483524e-9,1.1624319674564391e-8 +Bls12_381_mulMlResult/144/144,3.156212663951262e-6,3.152125625423378e-6,3.1605999327367523e-6,1.4589515146055545e-8,1.2047348608241888e-8,1.70854483929515e-8 +Bls12_381_mulMlResult/144/144,3.1729953652870548e-6,3.1684055340909116e-6,3.1782586580638403e-6,1.6814190179535613e-8,1.4122975651903536e-8,2.002367188727685e-8 +Bls12_381_mulMlResult/144/144,3.1719997584116886e-6,3.167590769586857e-6,3.1763468606091083e-6,1.5426142591991946e-8,1.2737283080930485e-8,1.8508264376794326e-8 +Bls12_381_mulMlResult/144/144,3.1833264002650376e-6,3.1773466064442526e-6,3.1902958429460292e-6,2.2784655272096775e-8,1.9425327594520675e-8,2.681672846312722e-8 +Bls12_381_mulMlResult/144/144,3.152895795602162e-6,3.1502408180061384e-6,3.156492253336336e-6,1.0887629575457266e-8,9.180435605060665e-9,1.3071786580532153e-8 +Bls12_381_mulMlResult/144/144,3.1781480366001147e-6,3.1736825730610567e-6,3.183217364426968e-6,1.604968283630383e-8,1.3997831973393368e-8,1.901658033410925e-8 +Bls12_381_mulMlResult/144/144,3.169473170087299e-6,3.1663761249112055e-6,3.173669003611015e-6,1.2126050404470865e-8,9.673953577505877e-9,1.7813612519111936e-8 +Bls12_381_mulMlResult/144/144,3.1573435269738803e-6,3.154613318329714e-6,3.1605971787945656e-6,9.84122949328858e-9,8.327665321274602e-9,1.1904776493937459e-8 +Bls12_381_mulMlResult/144/144,3.168527298767444e-6,3.163473526840626e-6,3.1738522854660285e-6,1.7816408223416653e-8,1.570567908496236e-8,2.0258243928780874e-8 +Bls12_381_mulMlResult/144/144,3.1579350185011407e-6,3.1557578376194083e-6,3.160401049139783e-6,8.119631937461486e-9,6.769910797792344e-9,1.000011490152995e-8 +Bls12_381_mulMlResult/144/144,3.164108671255331e-6,3.159132569293629e-6,3.172059054943961e-6,2.150857883543313e-8,1.510509445109647e-8,3.3254011385764574e-8 +Bls12_381_mulMlResult/144/144,3.156936802379792e-6,3.1537162064405364e-6,3.160713493538884e-6,1.1953717292501472e-8,9.17364560441851e-9,1.5241267608055363e-8 +Bls12_381_mulMlResult/144/144,3.1450386729511062e-6,3.1437585862436657e-6,3.1470980756320736e-6,5.430996938139707e-9,3.700253259068577e-9,8.869609563487292e-9 +Bls12_381_mulMlResult/144/144,3.1557200173164945e-6,3.154627951771261e-6,3.1575367291552285e-6,4.652561133797728e-9,3.403167497398014e-9,6.778978668152994e-9 +Bls12_381_mulMlResult/144/144,3.163850156611497e-6,3.1595148628884943e-6,3.1708375545026584e-6,1.874479181644284e-8,1.4311299127027821e-8,2.4861950153359628e-8 +Bls12_381_mulMlResult/144/144,3.163340862514623e-6,3.160084939411298e-6,3.16675817370026e-6,1.0592289903515377e-8,8.52360837114163e-9,1.2976615852539268e-8 +Bls12_381_mulMlResult/144/144,3.1567313270748066e-6,3.1531176442814305e-6,3.1609665387574853e-6,1.3805595274923283e-8,1.141631397250261e-8,1.7471259714406852e-8 +Bls12_381_mulMlResult/144/144,3.18574122703799e-6,3.179324631431232e-6,3.191355222634411e-6,2.029615008312844e-8,1.754770332616082e-8,2.387354795021655e-8 +Bls12_381_mulMlResult/144/144,3.1488703057125828e-6,3.1468352092067343e-6,3.1520544010762113e-6,8.178515541237123e-9,5.876334751321753e-9,1.1876773931743604e-8 +Bls12_381_mulMlResult/144/144,3.1551961191114953e-6,3.152012844311216e-6,3.1592030917571205e-6,1.2654851165210078e-8,1.000869579194329e-8,1.6228040013341713e-8 +Bls12_381_mulMlResult/144/144,3.1519020515502036e-6,3.149502885393835e-6,3.155480435468436e-6,9.586829019180141e-9,7.6647461575882e-9,1.2648969331500856e-8 +Bls12_381_mulMlResult/144/144,3.154773648485201e-6,3.151149933262564e-6,3.160032323302884e-6,1.3955323302153739e-8,1.0504109835192491e-8,1.9595686953244832e-8 +Bls12_381_mulMlResult/144/144,3.173258485424001e-6,3.168580881721742e-6,3.1804066700223578e-6,1.9394552642161253e-8,1.3909537412742122e-8,2.9346656134912653e-8 +Bls12_381_mulMlResult/144/144,3.175238820644582e-6,3.1701277861773142e-6,3.180741853861578e-6,1.8318347662756546e-8,1.4874384329533254e-8,2.2856838108976134e-8 +Bls12_381_mulMlResult/144/144,3.156476920938538e-6,3.1532212315729803e-6,3.1597316761132734e-6,1.0953240270063023e-8,8.516426326160616e-9,1.2798124372107e-8 +Bls12_381_mulMlResult/144/144,3.1535706301842065e-6,3.1509812236227066e-6,3.1569648622500795e-6,1.0550306506112987e-8,8.687480950982992e-9,1.2888258343481803e-8 +Bls12_381_mulMlResult/144/144,3.160241521061932e-6,3.1573585356768057e-6,3.1630593030487786e-6,1.0051682522053407e-8,8.714721064668326e-9,1.1829480293915735e-8 +Bls12_381_mulMlResult/144/144,3.1577649415122536e-6,3.1551552734973114e-6,3.160804875344177e-6,8.832310795338008e-9,7.200019137092453e-9,1.085974187567824e-8 +Bls12_381_mulMlResult/144/144,3.1663087183842406e-6,3.1615453553433855e-6,3.1716540844156958e-6,1.7314354416484127e-8,1.4027984860834477e-8,2.1182311246976206e-8 +Bls12_381_mulMlResult/144/144,3.1857264773845797e-6,3.1801455033342517e-6,3.1914802888227815e-6,1.9128588569862495e-8,1.642262667978011e-8,2.2325731682238655e-8 +Bls12_381_mulMlResult/144/144,3.1570363177106635e-6,3.154230478197264e-6,3.160167644176273e-6,9.737516370537017e-9,8.384469305854738e-9,1.172397776179852e-8 +Bls12_381_mulMlResult/144/144,3.146933532625629e-6,3.144680874585541e-6,3.1497648366755675e-6,8.606209787856074e-9,6.5631669729426054e-9,1.0828374691346202e-8 +Bls12_381_mulMlResult/144/144,3.1505951738411237e-6,3.1499571745373914e-6,3.1513422926913935e-6,2.3097465135638293e-9,1.7305402540123762e-9,3.29553144688206e-9 +Bls12_381_mulMlResult/144/144,3.1525818579626612e-6,3.1499503162317166e-6,3.155953700641439e-6,9.599209199017434e-9,6.781631083732558e-9,1.3422917089904481e-8 +Bls12_381_mulMlResult/144/144,3.1602804564999297e-6,3.155850153851638e-6,3.166229313369925e-6,1.7178761343093357e-8,1.4138193295970928e-8,2.0734210148784483e-8 +Bls12_381_mulMlResult/144/144,3.1544675839786757e-6,3.1519418949116967e-6,3.157761205634358e-6,1.0080837216361118e-8,8.351324462122825e-9,1.2170423607412352e-8 +Bls12_381_mulMlResult/144/144,3.1444672689838647e-6,3.1431231142199527e-6,3.1459852633056116e-6,4.748859922836764e-9,3.8364870919238735e-9,6.746249731058942e-9 +Bls12_381_mulMlResult/144/144,3.1554873854082216e-6,3.15192210916313e-6,3.1601919445080608e-6,1.319314749545649e-8,1.0330256584880956e-8,1.7067885361635827e-8 +Bls12_381_mulMlResult/144/144,3.151437128854515e-6,3.1488516107626368e-6,3.1542025497476117e-6,8.532434985539865e-9,7.322400590831476e-9,9.932159123964486e-9 +Bls12_381_mulMlResult/144/144,3.1461739740526654e-6,3.143737594460205e-6,3.1497519901246024e-6,1.021075001500318e-8,7.665995542399633e-9,1.6050544377876277e-8 +Bls12_381_mulMlResult/144/144,3.1993990868568696e-6,3.1913786362339514e-6,3.208430094911807e-6,2.8915543479745564e-8,2.3362674811675004e-8,3.663876741297768e-8 +Bls12_381_mulMlResult/144/144,3.1823340910452003e-6,3.1763888265942357e-6,3.1903040866589217e-6,2.1959564233630232e-8,1.8610512390202245e-8,2.734489521998604e-8 +Bls12_381_mulMlResult/144/144,3.176324502130737e-6,3.172467284424679e-6,3.1803206055621817e-6,1.3035332324797054e-8,1.1290857419441174e-8,1.513861566161078e-8 +Bls12_381_mulMlResult/144/144,3.164155036152964e-6,3.1600435317821073e-6,3.168984154997055e-6,1.5466161895198215e-8,1.2885285593054402e-8,1.9761149171991604e-8 +Bls12_381_finalVerify/144/144,3.891878442985181e-4,3.8914937695136903e-4,3.8922010353489134e-4,1.1687438758270898e-7,9.804382965318747e-8,1.4617325671802175e-7 +Bls12_381_finalVerify/144/144,3.891916773011772e-4,3.8915489453518297e-4,3.892214287111078e-4,1.1574114479787401e-7,9.135280959384622e-8,1.543627722891332e-7 +Bls12_381_finalVerify/144/144,3.8924538662202447e-4,3.892088586406574e-4,3.89276456759861e-4,1.0896550384163164e-7,8.513114552300898e-8,1.4130630643413608e-7 +Bls12_381_finalVerify/144/144,3.892327880433497e-4,3.89197872208535e-4,3.892683247470032e-4,1.1578742803990638e-7,9.604521237377457e-8,1.4113451267118857e-7 +Bls12_381_finalVerify/144/144,3.891640708625151e-4,3.891253004080901e-4,3.89202217544451e-4,1.2701344990812032e-7,1.0738486961552592e-7,1.4964802946173523e-7 +Bls12_381_finalVerify/144/144,3.892222020583385e-4,3.8918712835718245e-4,3.892536399737859e-4,1.1785930055185429e-7,9.443489659261673e-8,1.4907333950488252e-7 +Bls12_381_finalVerify/144/144,3.89211978849137e-4,3.891687163756916e-4,3.892604447849131e-4,1.4361488730110983e-7,1.2021774767250094e-7,1.7684229730268207e-7 +Bls12_381_finalVerify/144/144,3.8919065260673914e-4,3.8914853194932624e-4,3.892324343177999e-4,1.4724644290076658e-7,1.1820130054702345e-7,1.9537005864568613e-7 +Bls12_381_finalVerify/144/144,3.892575463823997e-4,3.8922031456983276e-4,3.892997583621694e-4,1.3657171883941468e-7,1.0875735477499821e-7,1.8023935957858135e-7 +Bls12_381_finalVerify/144/144,3.892280478701064e-4,3.8919506248447566e-4,3.8927601297959307e-4,1.2626600382321476e-7,8.912729120666423e-8,1.9979718185723948e-7 +Bls12_381_finalVerify/144/144,3.8916638081638546e-4,3.891213635497179e-4,3.8920162214445405e-4,1.3153837014643025e-7,1.0732228231075201e-7,1.6094842244156446e-7 +Bls12_381_finalVerify/144/144,3.8921189405319474e-4,3.891832883403048e-4,3.892422699575216e-4,9.885448511891413e-8,8.164964180039705e-8,1.3752009676012512e-7 +Bls12_381_finalVerify/144/144,3.8921978588984653e-4,3.891729374465072e-4,3.8926170150510033e-4,1.4594136716914992e-7,1.166914824837239e-7,1.8478238028467726e-7 +Bls12_381_finalVerify/144/144,3.8920869295902896e-4,3.89176123099066e-4,3.8923250181456596e-4,8.946041049900604e-8,7.2453761391798e-8,1.1960254497699337e-7 +Bls12_381_finalVerify/144/144,3.8922241561609964e-4,3.8919693337561613e-4,3.892505233876352e-4,9.021281234181932e-8,7.651212905857864e-8,1.0842018243678482e-7 +Bls12_381_finalVerify/144/144,3.8921514497799206e-4,3.891726704959457e-4,3.8926392364387367e-4,1.5118201417032976e-7,1.1855546584701628e-7,2.0356467052968245e-7 +Bls12_381_finalVerify/144/144,3.891695162370953e-4,3.8913329036157837e-4,3.892070558699914e-4,1.2238198514524483e-7,1.0101967668282987e-7,1.5090857048667918e-7 +Bls12_381_finalVerify/144/144,3.892203389429974e-4,3.891835735680077e-4,3.8925948538431193e-4,1.2808783566301391e-7,1.0944387600536978e-7,1.5826067658609614e-7 +Bls12_381_finalVerify/144/144,3.891869243413188e-4,3.891524487094176e-4,3.8921960458559193e-4,1.1100913738816344e-7,9.18654753713665e-8,1.3624499582441986e-7 +Bls12_381_finalVerify/144/144,3.891673474973655e-4,3.8913564851097645e-4,3.8919995342573215e-4,1.1004745855757679e-7,9.173143318686791e-8,1.3574100773029894e-7 +Bls12_381_finalVerify/144/144,3.8920921694461386e-4,3.8916189005796544e-4,3.892432665900584e-4,1.3059137223492272e-7,1.0221783012228984e-7,1.6781366558006743e-7 +Bls12_381_finalVerify/144/144,3.891923390163571e-4,3.8915187247951665e-4,3.8924145418628284e-4,1.5138520881031935e-7,1.1121557385489325e-7,2.4124618830733236e-7 +Bls12_381_finalVerify/144/144,3.8915737386192157e-4,3.891197901604083e-4,3.892000711751826e-4,1.3589272906410224e-7,1.1366499470909772e-7,1.7202601810218361e-7 +Bls12_381_finalVerify/144/144,3.891569898933255e-4,3.8911210291029454e-4,3.8919998011755104e-4,1.4795776957336819e-7,1.2536632760187528e-7,1.8637538000758447e-7 +Bls12_381_finalVerify/144/144,3.8920298338829013e-4,3.8916586614377467e-4,3.892450244838427e-4,1.3451751240689887e-7,1.0743249915361246e-7,1.799693867257131e-7 +Bls12_381_finalVerify/144/144,3.89164713411303e-4,3.891366217385213e-4,3.891898954218397e-4,9.570125646293436e-8,8.050428216902678e-8,1.1812070303460391e-7 +Bls12_381_finalVerify/144/144,3.8922123583428394e-4,3.891833431385116e-4,3.892565663317076e-4,1.1902433903969557e-7,9.615017167602775e-8,1.567408239279168e-7 +Bls12_381_finalVerify/144/144,3.891641993977574e-4,3.8912480836491176e-4,3.8919882462442446e-4,1.2152864880115727e-7,1.0324591672272292e-7,1.445798169200229e-7 +Bls12_381_finalVerify/144/144,3.8915626189076617e-4,3.891241015433832e-4,3.8918930146943873e-4,1.1426224890868977e-7,9.381182168923138e-8,1.4497899121790172e-7 +Bls12_381_finalVerify/144/144,3.891949296286132e-4,3.8915925885208547e-4,3.892273690248724e-4,1.1508698726794336e-7,9.565852300384856e-8,1.3890409010552037e-7 +Bls12_381_finalVerify/144/144,3.892087393561061e-4,3.8916822595651626e-4,3.89267054947681e-4,1.5943193745422142e-7,1.1911217880403847e-7,2.2217286164913914e-7 +Bls12_381_finalVerify/144/144,3.893356868221302e-4,3.892939203247711e-4,3.893716284782025e-4,1.29714261184982e-7,1.1040227914732815e-7,1.5630739433892276e-7 +Bls12_381_finalVerify/144/144,3.893791693359708e-4,3.893365918989791e-4,3.89472340068608e-4,1.9790037937417616e-7,1.1601841533716701e-7,3.737098048379719e-7 +Bls12_381_finalVerify/144/144,3.8930561248998955e-4,3.8926829517668866e-4,3.893429492303411e-4,1.2547909873345233e-7,9.519748119632311e-8,1.7710171932005448e-7 +Bls12_381_finalVerify/144/144,3.8932024394991e-4,3.892785977338845e-4,3.893535851982747e-4,1.222986572856267e-7,9.32744559945987e-8,1.7284607494293234e-7 +Bls12_381_finalVerify/144/144,3.892488096127607e-4,3.892140523972655e-4,3.892880487646059e-4,1.2013747615942848e-7,9.96997826989733e-8,1.5401135108191856e-7 +Bls12_381_finalVerify/144/144,3.893018628470641e-4,3.8926577257618995e-4,3.893360845196614e-4,1.2091573773194237e-7,9.843274358555291e-8,1.5607304117037037e-7 +Bls12_381_finalVerify/144/144,3.893006443783128e-4,3.8925735621174576e-4,3.8934322078369455e-4,1.4759060427467545e-7,1.2087523058001922e-7,1.8279512956501752e-7 +Bls12_381_finalVerify/144/144,3.8936203938839546e-4,3.8932611794552347e-4,3.8942042706790016e-4,1.460806700257125e-7,1.069016089908307e-7,2.0565994140191372e-7 +Bls12_381_finalVerify/144/144,3.8925447174632555e-4,3.8920637508008387e-4,3.8929728927314183e-4,1.462126440895562e-7,1.2642192858044965e-7,1.7159830883772403e-7 +Bls12_381_finalVerify/144/144,3.89322463416428e-4,3.892833501769744e-4,3.893733833387225e-4,1.4783487586202725e-7,1.1179095716110966e-7,2.0211676058985533e-7 +Bls12_381_finalVerify/144/144,3.893344027657367e-4,3.892970456283079e-4,3.893690695543062e-4,1.168347901707963e-7,9.941091584812876e-8,1.446488528270936e-7 +Bls12_381_finalVerify/144/144,3.893167695960439e-4,3.892859663054663e-4,3.8934527055398236e-4,1.0047765326428016e-7,8.331916506639957e-8,1.2192222385765806e-7 +Bls12_381_finalVerify/144/144,3.8940752731125454e-4,3.8936615155812796e-4,3.894456959436036e-4,1.403646711327095e-7,1.1771695745078832e-7,1.8090003358059582e-7 +Bls12_381_finalVerify/144/144,3.893895721146816e-4,3.8935399260591456e-4,3.894239507928001e-4,1.1196432991603413e-7,9.255147179282041e-8,1.4281594633209392e-7 +Bls12_381_finalVerify/144/144,3.8934532692494895e-4,3.892942223643141e-4,3.8939029127177594e-4,1.58276696643012e-7,1.3375969920095512e-7,1.8941511333224504e-7 +Bls12_381_finalVerify/144/144,3.893133585111149e-4,3.892759223656869e-4,3.8935036610079953e-4,1.2528998341870196e-7,1.014890791104949e-7,1.6185612839249654e-7 +Bls12_381_finalVerify/144/144,3.8936787584888967e-4,3.8932420507141403e-4,3.894067867736339e-4,1.40400685005338e-7,1.1597328198905831e-7,1.7662698610079598e-7 +Bls12_381_finalVerify/144/144,3.8927039009275854e-4,3.8922359364107354e-4,3.893106529547512e-4,1.4902581072580077e-7,1.2451240124031637e-7,1.9363703897708102e-7 +Bls12_381_finalVerify/144/144,3.8933923051450483e-4,3.8929925179593085e-4,3.893757217454786e-4,1.2250861771292655e-7,9.677746503639636e-8,1.7345275563571657e-7 +Bls12_381_finalVerify/144/144,3.893668270675778e-4,3.8932274816825337e-4,3.894023512766521e-4,1.343876685746739e-7,1.0440413019094867e-7,1.9110408657763947e-7 +Bls12_381_finalVerify/144/144,3.893501986451073e-4,3.8931155638952255e-4,3.893845896375171e-4,1.1354041079799423e-7,9.543899448756252e-8,1.3650303451388934e-7 +Bls12_381_finalVerify/144/144,3.893473255741391e-4,3.8930381853550063e-4,3.8938180690225086e-4,1.3300818237552525e-7,1.1281723946157037e-7,1.611328857757167e-7 +Bls12_381_finalVerify/144/144,3.892890745771365e-4,3.892440370297009e-4,3.893335582439948e-4,1.4882132490332725e-7,1.1906953050783078e-7,2.0504587276642528e-7 +Bls12_381_finalVerify/144/144,3.8932087663617334e-4,3.892952032586232e-4,3.893464120898321e-4,9.412747814070016e-8,7.071895785261679e-8,1.4049797863349323e-7 +Bls12_381_finalVerify/144/144,3.893711941474217e-4,3.893306548856354e-4,3.8941725218239793e-4,1.3549901820379957e-7,9.92225149749313e-8,1.9269285389258907e-7 +Bls12_381_finalVerify/144/144,3.8937370247449143e-4,3.8932625101486054e-4,3.894574654017813e-4,2.0856837258367322e-7,1.1867434277361084e-7,4.1361639413543063e-7 +Bls12_381_finalVerify/144/144,3.892885043613132e-4,3.892461704048774e-4,3.8932851331396716e-4,1.3802710569108649e-7,1.1716464901111434e-7,1.684926887746145e-7 +Bls12_381_finalVerify/144/144,3.8933685709277387e-4,3.8929008850548233e-4,3.893831460594569e-4,1.4815099557738816e-7,1.2000089831075187e-7,1.9243104340156748e-7 +Bls12_381_finalVerify/144/144,3.893031162444304e-4,3.8925735341382805e-4,3.8934879223421104e-4,1.5207969672825267e-7,1.246517984059637e-7,1.9493919344642126e-7 +Bls12_381_finalVerify/144/144,3.89291541549229e-4,3.892368575913674e-4,3.89340960228634e-4,1.7900215092519574e-7,1.4278632673049933e-7,2.3005139090574984e-7 +Bls12_381_finalVerify/144/144,3.8933031432962517e-4,3.892822830922277e-4,3.893766264088197e-4,1.549326058935774e-7,1.2333167948468963e-7,2.1441006550197803e-7 +Bls12_381_finalVerify/144/144,3.893419862107554e-4,3.892911270331338e-4,3.8938356515326537e-4,1.4437192541942772e-7,1.1376963133765993e-7,1.9144089849334516e-7 +Bls12_381_finalVerify/144/144,3.8929534025084584e-4,3.892505098639288e-4,3.893325712488714e-4,1.3906839758537555e-7,1.1591370837437497e-7,1.820628586988964e-7 +Bls12_381_finalVerify/144/144,3.892914410973503e-4,3.8925221148228e-4,3.8933033080325297e-4,1.3378936247508974e-7,1.1417063404934556e-7,1.613774400453356e-7 +Bls12_381_finalVerify/144/144,3.893859710503075e-4,3.8934609767090706e-4,3.8942976445073736e-4,1.3843097212674893e-7,1.1357713202927136e-7,1.657885375540462e-7 +Bls12_381_finalVerify/144/144,3.8933756783421955e-4,3.892935509239669e-4,3.893722335753185e-4,1.3224080962135107e-7,9.919897339318548e-8,1.7158427079559341e-7 +Bls12_381_finalVerify/144/144,3.893740385036861e-4,3.8932970511184435e-4,3.894332399806997e-4,1.7168183560390807e-7,1.373734504582307e-7,2.31485046999821e-7 +Bls12_381_finalVerify/144/144,3.8931991845565203e-4,3.8927956077715385e-4,3.893550655610233e-4,1.2390009523842767e-7,1.0097418054499372e-7,1.593897972763703e-7 +Bls12_381_finalVerify/144/144,3.8920860210523236e-4,3.891745344614035e-4,3.8925260498371696e-4,1.2948167994267662e-7,1.0340192123969928e-7,1.8822877473993162e-7 +Bls12_381_finalVerify/144/144,3.8918120670070766e-4,3.8913895967397524e-4,3.8922670938173446e-4,1.469810889726229e-7,1.2210423914701232e-7,1.7661779286557885e-7 +Bls12_381_finalVerify/144/144,3.892442107099791e-4,3.89209110468118e-4,3.8928234464336513e-4,1.1779959703810806e-7,9.715649084170849e-8,1.4865070055332056e-7 +Bls12_381_finalVerify/144/144,3.8922647998413084e-4,3.8918872536552833e-4,3.892575456820406e-4,1.105446750843587e-7,8.873750378763306e-8,1.422341648002371e-7 +Bls12_381_finalVerify/144/144,3.891669903964679e-4,3.8912439893908475e-4,3.892094030403914e-4,1.430361679883513e-7,1.2603625560847957e-7,1.7511894334520703e-7 +Bls12_381_finalVerify/144/144,3.8920502122731526e-4,3.89167394188041e-4,3.89241806612835e-4,1.3135011342018732e-7,1.0838901412977094e-7,1.6528677408461326e-7 +Bls12_381_finalVerify/144/144,3.89159555753221e-4,3.891258473552927e-4,3.8919536374130124e-4,1.1458204585324164e-7,9.979844989196832e-8,1.3778653859561473e-7 +Bls12_381_finalVerify/144/144,3.8918766056361594e-4,3.891559069859136e-4,3.892180611742132e-4,1.0425132986105497e-7,8.425150059869306e-8,1.4187982438345747e-7 +Bls12_381_finalVerify/144/144,3.8915752481423954e-4,3.8912169033165456e-4,3.891936136721553e-4,1.1647502319725966e-7,8.889525421446957e-8,1.5319800263169017e-7 +Bls12_381_finalVerify/144/144,3.8919628231595796e-4,3.891570587467707e-4,3.892313850974068e-4,1.2555717041760548e-7,1.0532835293678156e-7,1.5527227733927684e-7 +Bls12_381_finalVerify/144/144,3.892052131457548e-4,3.891600836876914e-4,3.892566509238906e-4,1.584870630864649e-7,1.3714719551071182e-7,1.9440076654086033e-7 +Bls12_381_finalVerify/144/144,3.89350082437859e-4,3.893094881483728e-4,3.893974510682591e-4,1.48015963026536e-7,1.2120276965705432e-7,1.9183271886774942e-7 +Bls12_381_finalVerify/144/144,3.8928974328034577e-4,3.892481118912304e-4,3.89329057885923e-4,1.3784814828926978e-7,1.1768314960509323e-7,1.6553200153292863e-7 +Bls12_381_finalVerify/144/144,3.8936297942325043e-4,3.893200065703773e-4,3.894011108684737e-4,1.3534016287900913e-7,1.0998324413045347e-7,1.7616465062641426e-7 +Bls12_381_finalVerify/144/144,3.893268498024921e-4,3.8927859134232126e-4,3.8936865933822255e-4,1.4276970325068079e-7,1.1744692629998469e-7,1.82587795267996e-7 +Bls12_381_finalVerify/144/144,3.8937900678319675e-4,3.8934299590782456e-4,3.8941853532931147e-4,1.3077717872596805e-7,1.0787275359749169e-7,1.676069961109244e-7 +Bls12_381_finalVerify/144/144,3.893248461520557e-4,3.892780051860371e-4,3.893639568641109e-4,1.4365971219737463e-7,1.23990016734151e-7,1.7242474200916154e-7 +Bls12_381_finalVerify/144/144,3.893270067723136e-4,3.8928591617211523e-4,3.89379621431496e-4,1.6008940504293598e-7,1.1862809704020471e-7,2.3256278534957063e-7 +Bls12_381_finalVerify/144/144,3.893284113450403e-4,3.8928698934411697e-4,3.8936865631998145e-4,1.3466182782227664e-7,1.1393788398656062e-7,1.657366748033852e-7 +Bls12_381_finalVerify/144/144,3.893082097137973e-4,3.892600269177761e-4,3.89353366843637e-4,1.6176952938133813e-7,1.3283224439243864e-7,1.9646829360509756e-7 +Bls12_381_finalVerify/144/144,3.893313872944283e-4,3.892836727508778e-4,3.8937638494555995e-4,1.5124988770110102e-7,1.16295643087535e-7,2.0481310240291186e-7 +Bls12_381_finalVerify/144/144,3.89339102831731e-4,3.893038125597519e-4,3.89374963287876e-4,1.1943444660764366e-7,1.0113364494087913e-7,1.3970690672579752e-7 +Bls12_381_finalVerify/144/144,3.8936828597569854e-4,3.893271275194112e-4,3.8941274820919095e-4,1.456707568481221e-7,1.2099329966009246e-7,1.812996407678753e-7 +Bls12_381_finalVerify/144/144,3.893260166566899e-4,3.892909357077075e-4,3.893587781174513e-4,1.1608956212836908e-7,9.730442933176699e-8,1.532500066825097e-7 +Bls12_381_finalVerify/144/144,3.8933604774550487e-4,3.8928990841222366e-4,3.893782781606102e-4,1.4615810379312796e-7,1.2209376122452587e-7,1.8460490769214883e-7 +Bls12_381_finalVerify/144/144,3.8932460657078056e-4,3.8927736948761167e-4,3.8937103180236495e-4,1.4859958309718905e-7,1.2727133225168707e-7,1.8347200799821683e-7 +Bls12_381_finalVerify/144/144,3.893449611152876e-4,3.892932970468517e-4,3.893952419493251e-4,1.6363136267327688e-7,1.379524745390588e-7,2.0286088918929146e-7 +Bls12_381_finalVerify/144/144,3.893638163153168e-4,3.8932718699586884e-4,3.893980358465763e-4,1.1710570295628066e-7,1.0013431993826968e-7,1.4078183320699124e-7 +Bls12_381_finalVerify/144/144,3.8935809012677336e-4,3.893163556106507e-4,3.8940180897875415e-4,1.3672568179374042e-7,1.1419776810882229e-7,1.6756640281674552e-7 +Bls12_381_finalVerify/144/144,3.893903919983267e-4,3.8935251695071713e-4,3.8943177546640277e-4,1.331919933030265e-7,1.0707031265434441e-7,1.9442092847789942e-7 +Bls12_381_finalVerify/144/144,3.89331303011924e-4,3.8928745917080315e-4,3.893782922686834e-4,1.478631847856309e-7,1.2099955113474393e-7,1.8478626942417138e-7 +Bls12_381_millerLoop/12/24,4.0269920469519804e-4,4.0266606558037076e-4,4.027323377275452e-4,1.1020551619589482e-7,9.096992962890941e-8,1.3408523535410358e-7 +Bls12_381_millerLoop/12/24,4.027298878304816e-4,4.0269869345519035e-4,4.027726217349043e-4,1.254988045603359e-7,9.486450569348696e-8,1.7523409446407042e-7 +Bls12_381_millerLoop/12/24,4.0273615359684266e-4,4.026898033633995e-4,4.0277747405116323e-4,1.4904956192777162e-7,1.2003358538027876e-7,1.9794116872827058e-7 +Bls12_381_millerLoop/12/24,4.0280589391581903e-4,4.027507397487579e-4,4.028559149359812e-4,1.7963862619002226e-7,1.501150375757341e-7,2.1769896358950912e-7 +Bls12_381_millerLoop/12/24,4.0274468320457214e-4,4.0271144289829236e-4,4.0277762022148197e-4,1.1531393799368662e-7,9.583480368803128e-8,1.4258936457229128e-7 +Bls12_381_millerLoop/12/24,4.0283117223453645e-4,4.027856722280473e-4,4.0287988084871437e-4,1.548253510104617e-7,1.220315888666383e-7,1.9882306037377188e-7 +Bls12_381_millerLoop/12/24,4.0280606463244893e-4,4.027708729975222e-4,4.028492623852188e-4,1.3319890897937135e-7,9.666296678600938e-8,1.8707810755305703e-7 +Bls12_381_millerLoop/12/24,4.027543940832082e-4,4.027082797635177e-4,4.0279564120949545e-4,1.4803048589211497e-7,1.190210820338297e-7,1.8594682154488804e-7 +Bls12_381_millerLoop/12/24,4.028125688391853e-4,4.0275317081583993e-4,4.0288449527899626e-4,2.0956277078199696e-7,1.6376018317918477e-7,3.0901231331990355e-7 +Bls12_381_millerLoop/12/24,4.02767703083951e-4,4.0271834025489266e-4,4.0282023545315537e-4,1.7642411316083875e-7,1.4215704756959597e-7,2.3088410567117845e-7 +Bls12_381_millerLoop/12/24,4.027599778296002e-4,4.0271843082788876e-4,4.0281097448459206e-4,1.4608464246744598e-7,1.1703182389386734e-7,1.8172039807319215e-7 +Bls12_381_millerLoop/12/24,4.0279100176496307e-4,4.027502085713439e-4,4.0282652032812055e-4,1.2913060383356301e-7,1.0837613531112113e-7,1.5579369779695274e-7 +Bls12_381_millerLoop/12/24,4.0274798600796783e-4,4.0269871307097726e-4,4.0278560670749865e-4,1.441551545597928e-7,1.1747807709039361e-7,1.8977783342618314e-7 +Bls12_381_millerLoop/12/24,4.027930743662034e-4,4.027597936569783e-4,4.0282467217378444e-4,1.1272632450833116e-7,8.965026926663289e-8,1.4427438744649906e-7 +Bls12_381_millerLoop/12/24,4.0282516288976547e-4,4.027920623474426e-4,4.02857791548489e-4,1.1279919529012994e-7,9.5928169582335e-8,1.337728307584227e-7 +Bls12_381_millerLoop/12/24,4.0274634134850545e-4,4.027023981779617e-4,4.0278013482283366e-4,1.2397911897759612e-7,9.856689466332716e-8,1.6884545786926536e-7 +Bls12_381_millerLoop/12/24,4.027545201707096e-4,4.0271054808806953e-4,4.0279549220831567e-4,1.5011332558557765e-7,1.1914233320011827e-7,2.075106919876271e-7 +Bls12_381_millerLoop/12/24,4.027638961780892e-4,4.02721389825388e-4,4.0280060799062706e-4,1.3445352708625302e-7,1.1138305177178655e-7,1.6433849668592582e-7 +Bls12_381_millerLoop/12/24,4.027140918670161e-4,4.026753014810554e-4,4.027599399301969e-4,1.3985076458871886e-7,1.0886371418417384e-7,1.8494554877439209e-7 +Bls12_381_millerLoop/12/24,4.027017825603998e-4,4.026671025467258e-4,4.0274253484813474e-4,1.2569303845645241e-7,1.0177330652238731e-7,1.583230135730096e-7 +Bls12_381_millerLoop/12/24,4.026861664846744e-4,4.0264225890821977e-4,4.027219660498363e-4,1.3022220005969501e-7,1.0482677698493945e-7,2.006728143096887e-7 +Bls12_381_millerLoop/12/24,4.0277064333391657e-4,4.0273028806594817e-4,4.0281318137942214e-4,1.415424114252815e-7,1.1039793024624421e-7,2.001913933988902e-7 +Bls12_381_millerLoop/12/24,4.027093884073756e-4,4.0267669950348945e-4,4.027436215425381e-4,1.0933755528215448e-7,9.016906759511705e-8,1.393358079963037e-7 +Bls12_381_millerLoop/12/24,4.026765255738445e-4,4.026303946706958e-4,4.0271509743308303e-4,1.377158564794444e-7,1.1592392861676956e-7,1.6974154567231586e-7 +Bls12_381_millerLoop/12/24,4.027197801224638e-4,4.0267815760709595e-4,4.0276369719053983e-4,1.4785759179968134e-7,1.1297707366705616e-7,2.0529969696023146e-7 +Bls12_381_millerLoop/12/24,4.026123042651203e-4,4.025810314205871e-4,4.026437344416108e-4,1.0751470226664442e-7,9.40828230881948e-8,1.2669541880629828e-7 +Bls12_381_millerLoop/12/24,4.026350985802908e-4,4.0260255052485325e-4,4.0267090089909506e-4,1.1958978846355376e-7,1.0094793249740276e-7,1.4366328178209392e-7 +Bls12_381_millerLoop/12/24,4.0257488595818344e-4,4.025390352674788e-4,4.0261265659804725e-4,1.2271303143906422e-7,9.995767928981243e-8,1.4996271739148784e-7 +Bls12_381_millerLoop/12/24,4.0258472419073054e-4,4.025506718310444e-4,4.0262638153935735e-4,1.272962688904237e-7,9.934673625022779e-8,1.6920286096293938e-7 +Bls12_381_millerLoop/12/24,4.0245371903681966e-4,4.024059903041672e-4,4.0249639352710003e-4,1.414489542202145e-7,1.1876983065724425e-7,1.7899753232551097e-7 +Bls12_381_millerLoop/12/24,4.024981650631049e-4,4.0244882788745864e-4,4.025383133337029e-4,1.568944731512028e-7,1.2319655081142762e-7,2.1509373938938545e-7 +Bls12_381_millerLoop/12/24,4.025262068465674e-4,4.0247560218820594e-4,4.025839857124976e-4,1.8481640081477462e-7,1.522604644888764e-7,2.2941326783780847e-7 +Bls12_381_millerLoop/12/24,4.0250461894947694e-4,4.0245084161644315e-4,4.025632749456907e-4,1.9598545246720753e-7,1.6173414487012908e-7,2.316527567374965e-7 +Bls12_381_millerLoop/12/24,4.0274205382036585e-4,4.0268534449760916e-4,4.0280060095171144e-4,1.9298640492551747e-7,1.6004775406883115e-7,2.3127503181479404e-7 +Bls12_381_millerLoop/12/24,4.0283587199079504e-4,4.028022378995082e-4,4.028720855004499e-4,1.1510307639703639e-7,9.026342334209766e-8,1.4569306723869204e-7 +Bls12_381_millerLoop/12/24,4.0285075636318677e-4,4.028113655752374e-4,4.028791160942219e-4,1.105136990189701e-7,9.034976561630597e-8,1.536492170602267e-7 +Bls12_381_millerLoop/12/24,4.0279424310791536e-4,4.027500660809785e-4,4.028413034654512e-4,1.4745002412374613e-7,1.1790405925492274e-7,1.9012254905104855e-7 +Bls12_381_millerLoop/12/24,4.0256906524650023e-4,4.0253183408444824e-4,4.02609423988187e-4,1.2798057782922168e-7,1.0639807442038509e-7,1.649437768441026e-7 +Bls12_381_millerLoop/12/24,4.025526102574011e-4,4.0251409878380837e-4,4.02602226744731e-4,1.3937835723234309e-7,1.0930593831734463e-7,2.0351440789331536e-7 +Bls12_381_millerLoop/12/24,4.0257019241968396e-4,4.025244554493092e-4,4.026195716184026e-4,1.6811161836024892e-7,1.3882595668405264e-7,2.122977705609697e-7 +Bls12_381_millerLoop/12/24,4.0280255152039837e-4,4.0275832519649345e-4,4.028448169384819e-4,1.5438984969490334e-7,1.2491144332887432e-7,2.0508915303889998e-7 +Bls12_381_millerLoop/12/24,4.0283205958372364e-4,4.02802929796344e-4,4.028610577535525e-4,9.90922873482846e-8,8.066136829506338e-8,1.2899246028220615e-7 +Bls12_381_millerLoop/12/24,4.026464352297138e-4,4.026142244453331e-4,4.026811905001224e-4,1.1206258638496693e-7,9.637090801564456e-8,1.378087870514307e-7 +Bls12_381_millerLoop/12/24,4.0246184891741516e-4,4.0242649248895744e-4,4.024963516312286e-4,1.2005754580668971e-7,9.718485888183318e-8,1.5502423358373924e-7 +Bls12_381_millerLoop/12/24,4.024909970597634e-4,4.024493960330777e-4,4.025305411308869e-4,1.4131991241486644e-7,1.200085068878707e-7,1.6736404855299388e-7 +Bls12_381_millerLoop/12/24,4.025973282166456e-4,4.0253991931401255e-4,4.0265072755071873e-4,1.8245979962062127e-7,1.5640651325594618e-7,2.287844688184136e-7 +Bls12_381_millerLoop/12/24,4.027415042389026e-4,4.0269335089539176e-4,4.027833325049437e-4,1.4649785487601007e-7,1.209141713828627e-7,1.7924093910877645e-7 +Bls12_381_millerLoop/12/24,4.027771252776286e-4,4.0274277864517236e-4,4.028318934929446e-4,1.5081470248346202e-7,1.1047640260963044e-7,2.512122915587773e-7 +Bls12_381_millerLoop/12/24,4.0276471864445103e-4,4.0273828678501217e-4,4.027964379502971e-4,9.450554334266855e-8,7.821333401198105e-8,1.1558104209990158e-7 +Bls12_381_millerLoop/12/24,4.028550990952871e-4,4.0280408547431284e-4,4.029003492050992e-4,1.6532709654362896e-7,1.3483864127497792e-7,2.1563959030295924e-7 +Bls12_381_millerLoop/12/24,4.029289985793933e-4,4.028882587336635e-4,4.029627036760448e-4,1.2106395966703264e-7,9.967133091028816e-8,1.505430661334614e-7 +Bls12_381_millerLoop/12/24,4.028945498998296e-4,4.0285903545550766e-4,4.0293597363677775e-4,1.2875368655931686e-7,1.0071730696828874e-7,1.768712053333806e-7 +Bls12_381_millerLoop/12/24,4.029210152496994e-4,4.028784652868767e-4,4.0298405383997637e-4,1.747391932175822e-7,1.2717260742380354e-7,2.66517737484114e-7 +Bls12_381_millerLoop/12/24,4.0272934539510087e-4,4.02701398543592e-4,4.0275598936209255e-4,9.08417267568007e-8,7.3496758206423e-8,1.2030661457732606e-7 +Bls12_381_millerLoop/12/24,4.0253666473654895e-4,4.0249921755568295e-4,4.025706730445294e-4,1.235985432411487e-7,9.658163339404686e-8,1.9336501073352473e-7 +Bls12_381_millerLoop/12/24,4.0255006914952806e-4,4.025158808344657e-4,4.0257945514184763e-4,1.045880123000436e-7,8.517135146071746e-8,1.4366587204259556e-7 +Bls12_381_millerLoop/12/24,4.025413941278019e-4,4.024969889132798e-4,4.0257805444855694e-4,1.3162760087187166e-7,9.974166086476666e-8,1.873008774622906e-7 +Bls12_381_millerLoop/12/24,4.025596760369672e-4,4.02527100733853e-4,4.025855128455059e-4,9.611323378734747e-8,8.020989446581075e-8,1.1790798475825128e-7 +Bls12_381_millerLoop/12/24,4.0272588109373746e-4,4.026953095526156e-4,4.0275990489630994e-4,1.1342333133031035e-7,9.285078420166876e-8,1.4545266690666958e-7 +Bls12_381_millerLoop/12/24,4.02711669603158e-4,4.0268688176917365e-4,4.027365231126891e-4,8.615125522129401e-8,7.416060481814861e-8,1.054494825145661e-7 +Bls12_381_millerLoop/12/24,4.0272312829124174e-4,4.026924806208942e-4,4.027574461586118e-4,1.1191524221706466e-7,8.925155749684466e-8,1.592277336005462e-7 +Bls12_381_millerLoop/12/24,4.027115825021438e-4,4.026767612994304e-4,4.02743413744976e-4,1.1688901302825415e-7,9.458031693642458e-8,1.5306252828502363e-7 +Bls12_381_millerLoop/12/24,4.026706552490329e-4,4.026466490162801e-4,4.0269621598595825e-4,8.608736514209618e-8,7.269761454179967e-8,1.1217520483911087e-7 +Bls12_381_millerLoop/12/24,4.026428547811217e-4,4.026034340611868e-4,4.0267555539656697e-4,1.1893341988832714e-7,1.0023058351632781e-7,1.5284482881395861e-7 +Bls12_381_millerLoop/12/24,4.0266429084281696e-4,4.02629118386927e-4,4.027006475776635e-4,1.275300378482567e-7,1.0734951767759859e-7,1.5911046814645033e-7 +Bls12_381_millerLoop/12/24,4.027403382378383e-4,4.0270283128397916e-4,4.0278032046931205e-4,1.295237506664589e-7,1.0545312108706746e-7,1.641391871569684e-7 +Bls12_381_millerLoop/12/24,4.0267912598047857e-4,4.026361695696606e-4,4.027185973882657e-4,1.4089540587520712e-7,1.196035572350871e-7,1.6776783021365508e-7 +Bls12_381_millerLoop/12/24,4.027557003136531e-4,4.02719873277066e-4,4.0279149288006256e-4,1.212308719061081e-7,1.0153510277469104e-7,1.5662150127414145e-7 +Bls12_381_millerLoop/12/24,4.0274019060748613e-4,4.0271708694802026e-4,4.02768146132393e-4,9.026311156708116e-8,7.32548843156277e-8,1.199382550361642e-7 +Bls12_381_millerLoop/12/24,4.0269577563750296e-4,4.0265405439227124e-4,4.0274963297697036e-4,1.612253774241617e-7,1.2084981565477652e-7,2.198349071999122e-7 +Bls12_381_millerLoop/12/24,4.0260873743854484e-4,4.025675470898967e-4,4.0265454975989696e-4,1.4567647199668535e-7,1.1621671847759765e-7,1.8785494083048614e-7 +Bls12_381_millerLoop/12/24,4.0261946479397523e-4,4.0257613714638526e-4,4.026571215079504e-4,1.4013366418613565e-7,1.2113021528774192e-7,1.6510094211677577e-7 +Bls12_381_millerLoop/12/24,4.0268558108756116e-4,4.02645191079827e-4,4.027354078572169e-4,1.4335654062663813e-7,1.1846417646430664e-7,1.775512271881079e-7 +Bls12_381_millerLoop/12/24,4.027132501715169e-4,4.026755559463795e-4,4.0275563131556593e-4,1.3226375930374297e-7,1.1176922379784089e-7,1.7424258193478132e-7 +Bls12_381_millerLoop/12/24,4.02831497759406e-4,4.027948745619342e-4,4.028749163546979e-4,1.3588760807670546e-7,1.0884920690706143e-7,1.958637519920269e-7 +Bls12_381_millerLoop/12/24,4.0280717310157185e-4,4.027733355481861e-4,4.028546087242368e-4,1.3584774535046932e-7,1.0122292901643254e-7,2.2252339019841133e-7 +Bls12_381_millerLoop/12/24,4.028150897096745e-4,4.0278565579967006e-4,4.0284216951488096e-4,1.0048306250981198e-7,8.330300999169195e-8,1.2424955689506747e-7 +Bls12_381_millerLoop/12/24,4.0281929251063806e-4,4.027844198046185e-4,4.028541459353438e-4,1.2416407543179324e-7,1.0260966146438168e-7,1.6155427232789466e-7 +Bls12_381_millerLoop/12/24,4.028414506148533e-4,4.027956199743616e-4,4.0287483284499464e-4,1.3493412058006213e-7,1.0728561958908569e-7,1.8482468131839097e-7 +Bls12_381_millerLoop/12/24,4.027870559040542e-4,4.0274399479398384e-4,4.028311518432012e-4,1.4924796831041328e-7,1.2072410948507757e-7,1.8637157364373488e-7 +Bls12_381_millerLoop/12/24,4.0279043832134904e-4,4.027581399050022e-4,4.0282856053496755e-4,1.267219381974857e-7,9.386691672589644e-8,1.7932917895537157e-7 +Bls12_381_millerLoop/12/24,4.0276082882244985e-4,4.027170033636756e-4,4.0279976335628575e-4,1.4059887663499884e-7,1.1630285620147282e-7,1.8895184943987879e-7 +Bls12_381_millerLoop/12/24,4.027964701567902e-4,4.02767828914008e-4,4.028214066482962e-4,9.27422195468302e-8,8.163831792059639e-8,1.0663125094072338e-7 +Bls12_381_millerLoop/12/24,4.027661261667847e-4,4.0272871530961583e-4,4.028027288512027e-4,1.2734802632739454e-7,1.0539031865364604e-7,1.6498808473649992e-7 +Bls12_381_millerLoop/12/24,4.027228187764124e-4,4.026899312112613e-4,4.0275851257219115e-4,1.1595843727666831e-7,9.740951079274776e-8,1.4502975659598158e-7 +Bls12_381_millerLoop/12/24,4.0279164061712044e-4,4.0275751591645865e-4,4.0282389224548156e-4,1.1553773475017821e-7,9.237822839570497e-8,1.4385406293129208e-7 +Bls12_381_millerLoop/12/24,4.0278590867256337e-4,4.0275113749991425e-4,4.028358657027564e-4,1.319385024616035e-7,9.66384443711341e-8,2.032710494951269e-7 +Bls12_381_millerLoop/12/24,4.027932405221913e-4,4.0275563123182606e-4,4.0282643049271944e-4,1.2127534489340624e-7,9.907277796618184e-8,1.4879769991688294e-7 +Bls12_381_millerLoop/12/24,4.02775219229894e-4,4.027412577865304e-4,4.0281458780210905e-4,1.2266618546683742e-7,1.0050321003079799e-7,1.6022234418082644e-7 +Bls12_381_millerLoop/12/24,4.028354339377594e-4,4.0279279200027457e-4,4.0288641094270015e-4,1.555339154109825e-7,1.2370373149721603e-7,2.2875028780981714e-7 +Bls12_381_millerLoop/12/24,4.0285888749553753e-4,4.028142674113628e-4,4.028991771898893e-4,1.4337125351337636e-7,1.2285303323270346e-7,1.7913001198654907e-7 +Bls12_381_millerLoop/12/24,4.028653321621655e-4,4.028239858749401e-4,4.0290234614379116e-4,1.400617609093174e-7,1.1779378409992908e-7,1.757603092874443e-7 +Bls12_381_millerLoop/12/24,4.02802275303249e-4,4.0276515854132533e-4,4.0284247246416186e-4,1.242945760192563e-7,1.0279172328624874e-7,1.7113473568963537e-7 +Bls12_381_millerLoop/12/24,4.0265944990075086e-4,4.026200266546043e-4,4.027024211216421e-4,1.4569147824284087e-7,1.1376037824267198e-7,1.816687361995503e-7 +Bls12_381_millerLoop/12/24,4.025859836594174e-4,4.025437303220096e-4,4.0262991139187044e-4,1.5493698671634697e-7,1.2871771835663143e-7,1.9203127417214028e-7 +Bls12_381_millerLoop/12/24,4.0269263725501754e-4,4.026395254177339e-4,4.027443844924812e-4,1.7646157168815478e-7,1.4753498201970767e-7,2.2270752413777005e-7 +Bls12_381_millerLoop/12/24,4.0264924175544204e-4,4.025987024236373e-4,4.0269534402374434e-4,1.6428676216359433e-7,1.3546537204867118e-7,2.1385903900028264e-7 +Bls12_381_millerLoop/12/24,4.027123727288838e-4,4.026735375482401e-4,4.027586519355395e-4,1.3877132573990727e-7,1.128886448763521e-7,1.935819537828162e-7 +Bls12_381_millerLoop/12/24,4.0271438219446464e-4,4.026857778192279e-4,4.027477880752452e-4,1.0209044100353529e-7,8.569636827368697e-8,1.3090446219301398e-7 +Bls12_381_millerLoop/12/24,4.027384342685791e-4,4.026983535467841e-4,4.0277949038124866e-4,1.3949491546667918e-7,1.0760355526465955e-7,1.9608577262374002e-7 ChooseData/14,1.4406032703670086e-6,1.400881212514136e-6,1.5082201659352195e-6,1.7731432502665767e-7,1.0428329551032584e-7,2.932324145354628e-7 ChooseData/14,1.6582428841091154e-6,1.5714199946972811e-6,1.7725277237071034e-6,3.368420176364276e-7,2.7690608247761677e-7,3.8835797111198545e-7 ChooseData/5,1.7185342728862897e-6,1.6054149195206948e-6,1.8604682276011959e-6,3.9582294118150554e-7,3.3102908049262856e-7,4.7428103683449753e-7 diff --git a/plutus-core/cost-model/data/builtinCostModel.json b/plutus-core/cost-model/data/builtinCostModel.json index a00dcc123bd..b15ea8b805d 100644 --- a/plutus-core/cost-model/data/builtinCostModel.json +++ b/plutus-core/cost-model/data/builtinCostModel.json @@ -70,6 +70,188 @@ "type": "constant_cost" } }, + "bls12_381_G1_add": { + "cpu": { + "arguments": 1046420, + "type": "constant_cost" + }, + "memory": { + "arguments": 18, + "type": "constant_cost" + } + }, + "bls12_381_G1_compress": { + "cpu": { + "arguments": 3387741, + "type": "constant_cost" + }, + "memory": { + "arguments": 6, + "type": "constant_cost" + } + }, + "bls12_381_G1_equal": { + "cpu": { + "arguments": 545063, + "type": "constant_cost" + }, + "memory": { + "arguments": 1, + "type": "constant_cost" + } + }, + "bls12_381_G1_hashToGroup": { + "cpu": { + "arguments": { + "intercept": 66311195, + "slope": 23097 + }, + "type": "linear_in_x" + }, + "memory": { + "arguments": 18, + "type": "constant_cost" + } + }, + "bls12_381_G1_neg": { + "cpu": { + "arguments": 292890, + "type": "constant_cost" + }, + "memory": { + "arguments": 18, + "type": "constant_cost" + } + }, + "bls12_381_G1_scalarMul": { + "cpu": { + "arguments": { + "intercept": 94607019, + "slope": 87060 + }, + "type": "linear_in_x" + }, + "memory": { + "arguments": 18, + "type": "constant_cost" + } + }, + "bls12_381_G1_uncompress": { + "cpu": { + "arguments": 16598737, + "type": "constant_cost" + }, + "memory": { + "arguments": 18, + "type": "constant_cost" + } + }, + "bls12_381_G2_add": { + "cpu": { + "arguments": 2359410, + "type": "constant_cost" + }, + "memory": { + "arguments": 36, + "type": "constant_cost" + } + }, + "bls12_381_G2_compress": { + "cpu": { + "arguments": 3973992, + "type": "constant_cost" + }, + "memory": { + "arguments": 12, + "type": "constant_cost" + } + }, + "bls12_381_G2_equal": { + "cpu": { + "arguments": 1102635, + "type": "constant_cost" + }, + "memory": { + "arguments": 1, + "type": "constant_cost" + } + }, + "bls12_381_G2_hashToGroup": { + "cpu": { + "arguments": { + "intercept": 204557793, + "slope": 23271 + }, + "type": "linear_in_x" + }, + "memory": { + "arguments": 36, + "type": "constant_cost" + } + }, + "bls12_381_G2_neg": { + "cpu": { + "arguments": 307813, + "type": "constant_cost" + }, + "memory": { + "arguments": 36, + "type": "constant_cost" + } + }, + "bls12_381_G2_scalarMul": { + "cpu": { + "arguments": { + "intercept": 190191402, + "slope": 85902 + }, + "type": "linear_in_x" + }, + "memory": { + "arguments": 36, + "type": "constant_cost" + } + }, + "bls12_381_G2_uncompress": { + "cpu": { + "arguments": 33191512, + "type": "constant_cost" + }, + "memory": { + "arguments": 36, + "type": "constant_cost" + } + }, + "bls12_381_finalVerify": { + "cpu": { + "arguments": 388656972, + "type": "constant_cost" + }, + "memory": { + "arguments": 1, + "type": "constant_cost" + } + }, + "bls12_381_mulMlResult": { + "cpu": { + "arguments": 2544991, + "type": "constant_cost" + }, + "memory": { + "arguments": 72, + "type": "constant_cost" + } + }, + "bls12_381_millerLoop": { + "cpu": { + "arguments": 402099373, + "type": "constant_cost" + }, + "memory": { + "arguments": 72, + "type": "constant_cost" + } + }, "chooseData": { "cpu": { "arguments": 19537, diff --git a/plutus-core/cost-model/data/models.R b/plutus-core/cost-model/data/models.R index 484857e5281..a17a7e91d29 100644 --- a/plutus-core/cost-model/data/models.R +++ b/plutus-core/cost-model/data/models.R @@ -4,6 +4,10 @@ library(stringr, quietly=TRUE, warn.conflicts=FALSE) library(dplyr, quietly=TRUE, warn.conflicts=FALSE) library(broom, quietly=TRUE, warn.conflicts=FALSE) +## Let's see any warnings immediately instead of them being saved up to surprise +## us later on. +options(warn=1) + ## See Note [Creation of the Cost Model] ## This R code is used to analyse the data in `benching.csv` produced by @@ -106,7 +110,24 @@ arity <- function(name) { "EqualsData" = 2, "MkPairData" = 2, "MkNilData" = 1, - "MkNilPairData" = 1 + "MkNilPairData" = 1, + "Bls12_381_G1_add" = 2 , + "Bls12_381_G1_neg" = 1, + "Bls12_381_G1_scalarMul" = 2, + "Bls12_381_G1_equal" = 2, + "Bls12_381_G1_hashToGroup" = 2, + "Bls12_381_G1_compress" = 1, + "Bls12_381_G1_uncompress" = 1, + "Bls12_381_G2_add" = 2, + "Bls12_381_G2_neg" = 1, + "Bls12_381_G2_scalarMul" = 2, + "Bls12_381_G2_equal" = 2, + "Bls12_381_G2_hashToGroup" = 2, + "Bls12_381_G2_compress" = 1, + "Bls12_381_G2_uncompress" = 1, + "Bls12_381_millerLoop" = 2, + "Bls12_381_mulMlResult" = 2, + "Bls12_381_finalVerify" = 2 ) } @@ -324,9 +345,25 @@ modelFun <- function(path) { discard.upper.outliers () %>% discard.overhead () m <- lm(t ~ 1, filtered) - adjustModel (m,fname) + adjustModel(m,fname) } + linearInX <- function (fname) { + filtered <- data %>% + filter.and.check.nonempty (fname) %>% + discard.overhead () + m <- lm(t ~ x_mem, filtered) + adjustModel(m,fname) + } + + linearInY <- function (fname) { + filtered <- data %>% + filter.and.check.nonempty(fname) %>% + discard.overhead () + m <- lm(t ~ y_mem, filtered) + adjustModel(m,fname) + } + ##### Integers ##### @@ -336,7 +373,7 @@ modelFun <- function(path) { filter.and.check.nonempty (fname) %>% discard.overhead () m <- lm(t ~ pmax(x_mem, y_mem), filtered) - adjustModel (m, fname) + adjustModel(m, fname) } subtractIntegerModel <- addIntegerModel @@ -348,7 +385,7 @@ modelFun <- function(path) { filter(x_mem > 0 & y_mem > 0) %>% discard.overhead () m <- lm(t ~ I(x_mem + y_mem), filtered) - adjustModel (m, fname) + adjustModel(m, fname) } ## We do want I(x+y) here ^: the cost is linear, but symmetric. @@ -422,14 +459,7 @@ modelFun <- function(path) { ## Note that this is symmetrical in the arguments: a new bytestring is ## created and the contents of both arguments are copied into it. - consByteStringModel <- { - fname <- "ConsByteString" - filtered <- data %>% - filter.and.check.nonempty(fname) %>% - discard.overhead () - m <- lm(t ~ y_mem, filtered) - adjustModel(m,fname) - } + consByteStringModel <- linearInY ("ConsByteString") ## Depends on the size of the second argument, which has to be copied into ## the destination. @@ -464,64 +494,26 @@ modelFun <- function(path) { ###### Hashing functions ##### - sha2_256Model <- { - fname <- "Sha2_256" - filtered <- data %>% - filter.and.check.nonempty(fname) %>% - discard.overhead () - m <- lm(t ~ x_mem, filtered) - adjustModel(m,fname) - } - - sha3_256Model <- { - fname <- "Sha3_256" - filtered <- data %>% - filter.and.check.nonempty(fname) %>% - discard.overhead () - m <- lm(t ~ x_mem, filtered) - adjustModel(m,fname) - } - - blake2b_256Model <- { - fname <- "Blake2b_256" - filtered <- data %>% - filter.and.check.nonempty(fname) %>% - discard.overhead () - m <- lm(t ~ x_mem, filtered) - adjustModel(m,fname) - } - + sha2_256Model <- linearInX ("Sha2_256") + sha3_256Model <- linearInX ("Sha3_256") + blake2b_256Model <- linearInX ("Blake2b_256") ###### Signature verification ##### ## VerifyEd25519Signature in fact takes three arguments, but the first and ## third are of fixed size so we only gather benchmarking data for ## different sizes of the second argument (the message being signed). - verifyEd25519SignatureModel <- { - fname <- "VerifyEd25519Signature" - filtered <- data %>% - filter.and.check.nonempty(fname) %>% - discard.overhead () - m <- lm(t ~ y_mem, filtered) - adjustModel(m,fname) - } + verifyEd25519SignatureModel <- linearInY ("VerifyEd25519Signature") ## Similar to VerifyEd25519Signature. - verifySchnorrSecp256k1SignatureModel <- { - fname <- "VerifySchnorrSecp256k1Signature" - filtered <- data %>% - filter.and.check.nonempty(fname) %>% - discard.overhead () - m <- lm(t ~ y_mem, filtered) - adjustModel(m,fname) - } + verifySchnorrSecp256k1SignatureModel <- linearInY ("VerifySchnorrSecp256k1Signature") ## All of the arguments of VerifyEcdsaSecp256k1Signature are of fixed size. ## The "message" (usually a hash of the real message) is always 32 bytes ## long. verifyEcdsaSecp256k1SignatureModel <- constantModel ("VerifyEcdsaSecp256k1Signature") - + ##### Strings ##### appendStringModel <- { @@ -544,24 +536,8 @@ modelFun <- function(path) { adjustModel(m,fname) } - decodeUtf8Model <- { - fname <- "DecodeUtf8" - filtered <- data %>% - filter.and.check.nonempty(fname) %>% - discard.overhead () - m <- lm(t ~ x_mem, filtered) - adjustModel(m,fname) - } - - encodeUtf8Model <- { - fname <- "EncodeUtf8" - filtered <- data %>% - filter.and.check.nonempty(fname) %>% - discard.overhead () - m <- lm(t ~ x_mem, filtered) - adjustModel(m,fname) - } - + decodeUtf8Model <- linearInX ("DecodeUtf8") + encodeUtf8Model <- linearInX ("EncodeUtf8") ##### Bool ##### @@ -651,6 +627,26 @@ modelFun <- function(path) { mkNilDataModel <- constantModel ("MkNilData") mkNilPairDataModel <- constantModel ("MkNilPairData") + ##### BLS12_381 operations ##### + + bls12_381_G1_addModel <- constantModel ("Bls12_381_G1_add") + bls12_381_G1_negModel <- constantModel ("Bls12_381_G1_neg") + bls12_381_G1_scalarMulModel <- linearInX ("Bls12_381_G1_scalarMul") + bls12_381_G1_equalModel <- constantModel ("Bls12_381_G1_equal") + bls12_381_G1_hashToGroupModel <- linearInX ("Bls12_381_G1_hashToGroup") + bls12_381_G1_compressModel <- constantModel ("Bls12_381_G1_compress") + bls12_381_G1_uncompressModel <- constantModel ("Bls12_381_G1_uncompress") + bls12_381_G2_addModel <- constantModel ("Bls12_381_G2_add") + bls12_381_G2_negModel <- constantModel ("Bls12_381_G2_neg") + bls12_381_G2_scalarMulModel <- linearInX ("Bls12_381_G2_scalarMul") + bls12_381_G2_equalModel <- constantModel ("Bls12_381_G2_equal") + bls12_381_G2_hashToGroupModel <- linearInX ("Bls12_381_G2_hashToGroup") + bls12_381_G2_compressModel <- constantModel ("Bls12_381_G2_compress") + bls12_381_G2_uncompressModel <- constantModel ("Bls12_381_G2_uncompress") + bls12_381_millerLoopModel <- constantModel ("Bls12_381_millerLoop") + bls12_381_mulMlResultModel <- constantModel ("Bls12_381_mulMlResult") + bls12_381_finalVerifyModel <- constantModel ("Bls12_381_finalVerify") + list( addIntegerModel = addIntegerModel, subtractIntegerModel = subtractIntegerModel, @@ -705,6 +701,23 @@ modelFun <- function(path) { mkPairDataModel = mkPairDataModel, mkNilDataModel = mkNilDataModel, mkNilPairDataModel = mkNilPairDataModel, - serialiseDataModel = serialiseDataModel + serialiseDataModel = serialiseDataModel, + bls12_381_G1_addModel = bls12_381_G1_addModel, + bls12_381_G1_negModel = bls12_381_G1_negModel, + bls12_381_G1_scalarMulModel = bls12_381_G1_scalarMulModel, + bls12_381_G1_equalModel = bls12_381_G1_equalModel, + bls12_381_G1_hashToGroupModel = bls12_381_G1_hashToGroupModel, + bls12_381_G1_compressModel = bls12_381_G1_compressModel, + bls12_381_G1_uncompressModel = bls12_381_G1_uncompressModel, + bls12_381_G2_addModel = bls12_381_G2_addModel, + bls12_381_G2_negModel = bls12_381_G2_negModel, + bls12_381_G2_scalarMulModel = bls12_381_G2_scalarMulModel, + bls12_381_G2_equalModel = bls12_381_G2_equalModel, + bls12_381_G2_hashToGroupModel = bls12_381_G2_hashToGroupModel, + bls12_381_G2_compressModel = bls12_381_G2_compressModel, + bls12_381_G2_uncompressModel = bls12_381_G2_uncompressModel, + bls12_381_millerLoopModel = bls12_381_millerLoopModel, + bls12_381_mulMlResultModel = bls12_381_mulMlResultModel, + bls12_381_finalVerifyModel = bls12_381_finalVerifyModel ) } diff --git a/plutus-core/cost-model/test/TestCostModels.hs b/plutus-core/cost-model/test/TestCostModels.hs index 01a2e3d9b8e..25ebb65884d 100644 --- a/plutus-core/cost-model/test/TestCostModels.hs +++ b/plutus-core/cost-model/test/TestCostModels.hs @@ -52,6 +52,10 @@ import Hedgehog.Range qualified as Range Haskell result agreee to within a factor of 1/100 (one percent). -} +-- | Maximum allowable difference beween R result and Haskell result. +epsilon :: Double +epsilon = 1/100 + {- The tests here use Haskell costing functions (in 'costModelsR' from 'CreateBuiltinCostModel.hs') which are loaded directly from R, based purely @@ -102,7 +106,7 @@ data TestDomain (~=) :: CostingInteger -> CostingInteger -> Bool x ~= y | x==0 && y==0 = True - | otherwise = err < 1/100 + | otherwise = err < epsilon where x' = fromSatInt x :: Double y' = fromSatInt y :: Double err = abs ((x'-y')/y') @@ -396,5 +400,24 @@ main = , $(genTest 2 "mkPairData") Everywhere , $(genTest 1 "mkNilData") , $(genTest 1 "mkNilPairData") + + -- BLS + , $(genTest 2 "bls12_381_G1_add") Everywhere + , $(genTest 1 "bls12_381_G1_neg") + , $(genTest 2 "bls12_381_G1_scalarMul") Everywhere + , $(genTest 2 "bls12_381_G1_equal") Everywhere + , $(genTest 1 "bls12_381_G1_compress") + , $(genTest 1 "bls12_381_G1_uncompress") + , $(genTest 2 "bls12_381_G1_hashToGroup") Everywhere + , $(genTest 2 "bls12_381_G2_add") Everywhere + , $(genTest 1 "bls12_381_G2_neg") + , $(genTest 2 "bls12_381_G2_scalarMul") Everywhere + , $(genTest 2 "bls12_381_G2_equal") Everywhere + , $(genTest 1 "bls12_381_G2_compress") + , $(genTest 1 "bls12_381_G2_uncompress") + , $(genTest 2 "bls12_381_G2_hashToGroup") Everywhere + , $(genTest 2 "bls12_381_millerLoop") Everywhere + , $(genTest 2 "bls12_381_mulMlResult") Everywhere + , $(genTest 2 "bls12_381_finalVerify") Everywhere ] diff --git a/plutus-core/plutus-core.cabal b/plutus-core/plutus-core.cabal index b4fd619085d..764a1ac472c 100644 --- a/plutus-core/plutus-core.cabal +++ b/plutus-core/plutus-core.cabal @@ -71,7 +71,6 @@ common lang library import: lang exposed-modules: - Crypto Data.ByteString.Hash Data.Either.Extras Data.List.Extras @@ -90,6 +89,12 @@ library PlutusCore.Compiler PlutusCore.Compiler.Erase PlutusCore.Core + PlutusCore.Crypto.BLS12_381.Error + PlutusCore.Crypto.BLS12_381.G1 + PlutusCore.Crypto.BLS12_381.G2 + PlutusCore.Crypto.BLS12_381.Pairing + PlutusCore.Crypto.Ed25519 + PlutusCore.Crypto.Secp256k1 PlutusCore.Data PlutusCore.DataFilePaths PlutusCore.DeBruijn @@ -199,6 +204,7 @@ library PlutusCore.Core.Instance.Scoping PlutusCore.Core.Plated PlutusCore.Core.Type + PlutusCore.Crypto.Utils PlutusCore.DeBruijn.Internal PlutusCore.Default.Builtins PlutusCore.Default.Universe @@ -376,6 +382,9 @@ test-suite untyped-plutus-core-test DeBruijn.Spec DeBruijn.UnDeBruijnify Evaluation.Builtins + Evaluation.Builtins.BLS12_381 + Evaluation.Builtins.BLS12_381.TestClasses + Evaluation.Builtins.BLS12_381.Utils Evaluation.Builtins.Common Evaluation.Builtins.Costing Evaluation.Builtins.Definition diff --git a/plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/Error.hs b/plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/Error.hs new file mode 100644 index 00000000000..d8b388244c5 --- /dev/null +++ b/plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/Error.hs @@ -0,0 +1,6 @@ +module PlutusCore.Crypto.BLS12_381.Error +where + +data BLS12_381_Error = + HashToCurveDstTooBig -- DSTs can be at most 255 bytes long. + deriving stock Show diff --git a/plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/G1.hs b/plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/G1.hs new file mode 100644 index 00000000000..a2fea850c6c --- /dev/null +++ b/plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/G1.hs @@ -0,0 +1,148 @@ +-- editorconfig-checker-disable +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TypeApplications #-} + +module PlutusCore.Crypto.BLS12_381.G1 + ( Element (..) + , add + , neg + , scalarMul + , hashToGroup + , compress + , uncompress + , zero + , memSizeBytes + , compressedSizeBytes + ) where + +import Cardano.Crypto.EllipticCurve.BLS12_381 qualified as BlstBindings +import Cardano.Crypto.EllipticCurve.BLS12_381.Internal qualified as BlstBindings.Internal + +import PlutusCore.Crypto.BLS12_381.Error +import PlutusCore.Crypto.Utils (byteStringAsHex) +import PlutusCore.Pretty.PrettyConst (ConstConfig) +import Text.PrettyBy (PrettyBy) + +import Control.DeepSeq (NFData, rnf, rwhnf) +import Data.Bifunctor (second) +import Data.ByteString (ByteString, length, pack) +import Data.Proxy (Proxy (..)) +import Flat +import Prettyprinter + +{- | Note [Wrapping the BLS12-381 types in Plutus Core]. In the Haskell bindings +to the `blst` library, points in G1 and G2 are represented as ForeignPtrs +pointing to C objects, with a phantom type determining which group is +involved. We have to wrap these in a newtype here because otherwise the builtin +machinery spots that they're applications and can't find the relevant type +parameters. In theory I think we could add a couple of phantom types to the +default universe, but it seemed simpler and safer to use monomorphic types +instead, even though it requires a bit of code duplication between G1 and G2. + +See also Note [Wrapping the BLS12-381 types in PlutusTx]. +-} +newtype Element = Element { unElement :: BlstBindings.Point1 } + deriving newtype (Eq) +instance Show Element where + show = byteStringAsHex . compress +instance Pretty Element where + pretty = pretty . show +instance PrettyBy ConstConfig Element +instance Flat Element where + decode = do + x <- decode + case uncompress x of + Left err -> fail $ show err + Right e -> pure e + encode = encode . compress + size = size . compress +instance NFData Element where + rnf (Element x) = rwhnf x -- Just to be on the safe side. + +-- | Add two G1 group elements +add :: Element -> Element -> Element +add (Element a) (Element b) = Element $ BlstBindings.blsAddOrDouble @BlstBindings.Curve1 a b + +-- | Negate a G1 group element +neg :: Element -> Element +neg (Element a) = Element $ BlstBindings.blsNeg @BlstBindings.Curve1 a + +-- | Multiplication of group elements by scalars. In the blst library the +-- arguments are the other way round, but scalars acting on the left is more +-- consistent with standard mathematical practice. +scalarMul :: Integer -> Element -> Element +scalarMul k (Element a) = Element $ BlstBindings.blsMult @BlstBindings.Curve1 a k + +{- | Compress a G1 element to a bytestring. This serialises a curve point to its + x coordinate only. The compressed bytestring is 48 bytes long, with three + spare bits used to convey extra information about the point, including + determining which of two possible y coordinates the point has and whether the + point is the point at infinity. See + https://github.com/supranational/blst#serialization-format +-} +compress :: Element -> ByteString +compress (Element a) = BlstBindings.blsCompress @BlstBindings.Curve1 a + +{- | Uncompress a bytestring to get a G1 point. This will fail if any of the + following are true. + * The bytestring is not exactly 48 bytes long. + * The most significant three bits are used incorrectly. + * The bytestring encodes a field element which is not the + x coordinate of a point on the E1 curve. + * The bytestring does represent a point on the E1 curve, but the + point is not in the G1 subgroup. +-} +-- TODO: perhaps make this emit the error in the Left case. +uncompress :: ByteString -> Either BlstBindings.BLSTError Element +uncompress = second Element . BlstBindings.blsUncompress @BlstBindings.Curve1 + +{- | Note [Hashing and Domain Separation Tags]. The hashToGroup functions take a + btyestring and hash it to obtain an element in the relevant group, as + described in + + https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve. + + In addition to the input bytestring (the "message"), the hashing function + also takes another (possibly empty) bytestring argument, a "Domain Separation + Tag" (DST), which is incorporated in the hashing process; the intention is + that for security purposes different protocols should use different DSTs to + ensure that hashes are unique to the protocol in use: see Section 2.2.5 of + the above specification. In principle, arbitrary-length DSTs can be used, + but we only allow DSTs of up to 255 bytes, failing if a larger DST is + supplied. If a larger DST is required, it should be hashed beforehand to + obtain a hash of accpetable size, as described in Section 5.3.3 of the + specification. + + The hashing functions in the blst library allow a third argument as well (an + "augmentation string"). We don't support this functionality directly because + precisely the same effect can be achieved by prepending the augmentation + string to the message. +-} + +-- | Take an arbitrary bytestring and a Domain Separation Tag (DST) and hash +-- them to a get point in G1. +hashToGroup :: ByteString -> ByteString -> Either BLS12_381_Error Element +hashToGroup msg dst = + if Data.ByteString.length dst > 255 + then Left HashToCurveDstTooBig + else Right . Element $ BlstBindings.blsHash @BlstBindings.Curve1 msg (Just dst) Nothing + +-- Utilities (not exposed as builtins) + +-- | The zero element of G1 +zero :: Element +zero = + let b = pack (0xc0 : replicate 47 0x00) -- Compressed serialised G1 points are bytestrings of length 48: see CIP-0381. + in case uncompress b of + Left err -> error $ "Unexpected failure deserialising point at infinity on BLS12_381.G1: " ++ show err + Right infinity -> infinity -- The zero point on this curve is chosen to be the point at infinity. + +-- | Memory usage of a G1 point (144 bytes) +memSizeBytes :: Int +memSizeBytes = BlstBindings.Internal.sizePoint (Proxy @BlstBindings.Curve1) + +-- | Compressed size of a G1 point (48 bytes) +compressedSizeBytes :: Int +compressedSizeBytes = BlstBindings.Internal.compressedSizePoint (Proxy @BlstBindings.Curve1) + diff --git a/plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/G2.hs b/plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/G2.hs new file mode 100644 index 00000000000..bc29faeb3a5 --- /dev/null +++ b/plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/G2.hs @@ -0,0 +1,111 @@ +-- editorconfig-checker-disable +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TypeApplications #-} + +module PlutusCore.Crypto.BLS12_381.G2 + ( Element (..) + , add + , neg + , scalarMul + , hashToGroup + , compress + , uncompress + , zero + , memSizeBytes + , compressedSizeBytes + ) where + +import Cardano.Crypto.EllipticCurve.BLS12_381 qualified as BlstBindings +import Cardano.Crypto.EllipticCurve.BLS12_381.Internal qualified as BlstBindings.Internal + +import PlutusCore.Crypto.BLS12_381.Error +import PlutusCore.Crypto.Utils (byteStringAsHex) +import PlutusCore.Pretty.PrettyConst (ConstConfig) +import Text.PrettyBy (PrettyBy) + +import Control.DeepSeq (NFData, rnf, rwhnf) +import Data.Bifunctor (second) +import Data.ByteString (ByteString, length, pack) +import Data.Proxy (Proxy (..)) +import Flat +import Prettyprinter + +{- | See Note [Wrapping the BLS12-381 types]. -} +newtype Element = Element { unElement :: BlstBindings.Point2 } + deriving newtype (Eq) +instance Show Element where + show = byteStringAsHex . compress +instance Pretty Element where + pretty = pretty . show +instance PrettyBy ConstConfig Element +instance Flat Element where + decode = do + x <- decode + case uncompress x of + Left err -> fail $ show err + Right e -> pure e + encode = encode . compress + size = size . compress +instance NFData Element where + rnf (Element x) = rwhnf x -- Just to be on the safe side. + +-- | Add two G2 group elements +add :: Element -> Element -> Element +add (Element a) (Element b) = Element $ BlstBindings.blsAddOrDouble @BlstBindings.Curve2 a b + +-- | Negate a G2group element +neg :: Element -> Element +neg (Element a) = Element $ BlstBindings.blsNeg @BlstBindings.Curve2 a + +scalarMul :: Integer -> Element -> Element -- Other way round from library function +scalarMul k (Element a) = Element $ BlstBindings.blsMult @BlstBindings.Curve2 a k + +{- | Compress a G2 element to a bytestring. This serialises a curve point to its x + coordinate only, using an extra bit to determine which of two possible y + coordinates the point has. The compressed bytestring is 96 bytes long. See + https://github.com/supranational/blst#serialization-format +-} +compress :: Element -> ByteString +compress (Element a) = BlstBindings.blsCompress @BlstBindings.Curve2 a + +{- | Uncompress a bytestring to get a G2 point. This will fail if any of the + following are true: + * The bytestring is not exactly 96 bytes long + * The most significant three bits are used incorrectly + * The bytestring encodes a field element which is not the + x coordinate of a point on the E2 curve + * The bytestring does represent a point on the E2 curve, but the + point is not in the G2 subgroup +-} +-- TODO: perhaps make this emit the error in the Left case. +uncompress :: ByteString -> Either BlstBindings.BLSTError Element +uncompress = second Element . BlstBindings.blsUncompress @BlstBindings.Curve2 + +-- Take an arbitrary bytestring and a Domain Separation Tag and hash them to a +-- get point in G2. See Note [Hashing and Domain Separation Tags]. +hashToGroup :: ByteString -> ByteString -> Either BLS12_381_Error Element +hashToGroup msg dst = + if Data.ByteString.length dst > 255 + then Left HashToCurveDstTooBig + else Right . Element $ BlstBindings.blsHash @BlstBindings.Curve2 msg (Just dst) Nothing + + +-- Utilities (not exposed as builtins) + +-- | The zero element of G2 +zero :: Element +zero = + let b = pack (0xc0 : replicate 95 0x00) -- Compressed serialised G2 points are bytestrings of length 96: see CIP-0381. + in case uncompress b of + Left err -> error $ "Unexpected failure deserialising point at infinity on BLS12_381.G2: " ++ show err + Right infinity -> infinity -- The zero point on this curve is chosen to be the point at infinity. + +-- | Memory usage of a G2 point (288 bytes) +memSizeBytes :: Int +memSizeBytes = BlstBindings.Internal.sizePoint (Proxy @BlstBindings.Curve2) + +-- | Compressed size of a G2 point (96 bytes) +compressedSizeBytes :: Int +compressedSizeBytes = BlstBindings.Internal.compressedSizePoint (Proxy @BlstBindings.Curve2) + diff --git a/plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/Pairing.hs b/plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/Pairing.hs new file mode 100644 index 00000000000..8a425f6ff7b --- /dev/null +++ b/plutus-core/plutus-core/src/PlutusCore/Crypto/BLS12_381/Pairing.hs @@ -0,0 +1,70 @@ +{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE TypeApplications #-} +module PlutusCore.Crypto.BLS12_381.Pairing + ( + MlResult (..), + millerLoop, + mulMlResult, + finalVerify, + mlResultMemSizeBytes, + identityMlResult + ) where + +import Cardano.Crypto.EllipticCurve.BLS12_381 qualified as BlstBindings +import Cardano.Crypto.EllipticCurve.BLS12_381.Internal qualified as BlstBindings.Internal + +import PlutusCore.Crypto.BLS12_381.G1 qualified as G1 +import PlutusCore.Crypto.BLS12_381.G2 qualified as G2 +import PlutusCore.Pretty.PrettyConst (ConstConfig) +import Text.PrettyBy (PrettyBy, prettyBy) + +import Control.DeepSeq (NFData, rnf) +import Flat +import Prettyprinter + +{- | This type represents the result of computing a pairing using the Miller + loop. Values of this type are ephemeral, only created during script + execution. We do not provide any means of serialising, deserialising, + printing, or parsing MlResult values. -} +newtype MlResult = MlResult { unMlResult :: BlstBindings.PT } + deriving newtype (Eq) +instance Show MlResult where + show _ = "" +instance Pretty MlResult where + pretty = pretty . show +instance PrettyBy ConstConfig MlResult where + prettyBy _ = pretty +-- We need a Flat instance to get everything to build properly; however we'll +-- never want MlResult values in serialised scripts, so the decoding and +-- encoding functions just raise errors. +instance Flat MlResult where + -- This might happen on the chain, so `fail` rather than `error`. + decode = fail "BLS12_381.Pairing.MlResult: flat decoding disallowed" + -- This will be a Haskell runtime error, but encoding doesn't happen on chain, + -- so it's not too bad. + encode = error "BLS12_381.Pairing.MlResult: flat encoding disallowed" + size _ = id +instance NFData MlResult where + rnf _ = () + +millerLoop :: G1.Element -> G2.Element -> MlResult +millerLoop (G1.Element e1) (G2.Element e2) = MlResult $ BlstBindings.millerLoop e1 e2 + +mulMlResult :: MlResult -> MlResult -> MlResult +mulMlResult (MlResult a) (MlResult b) = MlResult $ BlstBindings.ptMult a b + +finalVerify :: MlResult -> MlResult -> Bool +finalVerify (MlResult a) (MlResult b) = BlstBindings.ptFinalVerify a b + + +-- Not exposed as builtins + +-- | Memory usage of an MlResult point (576 bytes) +mlResultMemSizeBytes :: Int +mlResultMemSizeBytes = BlstBindings.Internal.sizePT + +-- | For some of the tests we need a small element of the MlResult type. We can +-- get the identity element by pairing the zero elements of G1 and G2. +identityMlResult :: MlResult +identityMlResult = millerLoop G1.zero G2.zero diff --git a/plutus-core/plutus-core/src/PlutusCore/Crypto/Ed25519.hs b/plutus-core/plutus-core/src/PlutusCore/Crypto/Ed25519.hs new file mode 100644 index 00000000000..e50b48378a4 --- /dev/null +++ b/plutus-core/plutus-core/src/PlutusCore/Crypto/Ed25519.hs @@ -0,0 +1,61 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TypeApplications #-} + +module PlutusCore.Crypto.Ed25519 ( + verifyEd25519Signature_V1, + verifyEd25519Signature_V2 + ) where + +import PlutusCore.Crypto.Utils + +import Cardano.Crypto.DSIGN.Class qualified as DSIGN +import Cardano.Crypto.DSIGN.Ed25519 (Ed25519DSIGN) +import Crypto.ECC.Ed25519Donna (publicKey, signature, verify) +import Crypto.Error (CryptoFailable (..)) +import Data.ByteString qualified as BS +import Data.Text (Text, pack) +import PlutusCore.Builtin.Emitter (Emitter) +import PlutusCore.Evaluation.Result (EvaluationResult) + +-- | Ed25519 signature verification +-- This will fail if the key or the signature are not of the expected length. +-- This version uses the cardano-crypto implementation of the verification function. +verifyEd25519Signature_V1 + :: BS.ByteString -- ^ Public Key (32 bytes) + -> BS.ByteString -- ^ Message (arbitrary length) + -> BS.ByteString -- ^ Signature (64 bytes) + -> Emitter (EvaluationResult Bool) +verifyEd25519Signature_V1 pubKey msg sig = + case verify + <$> publicKey pubKey + <*> pure msg + <*> signature sig + of CryptoPassed r -> pure $ pure r + CryptoFailed err -> failWithMessage loc $ pack (show err) + where + loc :: Text + loc = "Ed25519 signature verification" + +-- | Ed25519 signature verification +-- This will fail if the key or the signature are not of the expected length. +-- This version uses the cardano-crypto-class implementation of the verification +-- function (using libsodium). +verifyEd25519Signature_V2 + :: BS.ByteString -- ^ Public Key (32 bytes) + -> BS.ByteString -- ^ Message (arbitrary length) + -> BS.ByteString -- ^ Signature (64 bytes) + -> Emitter (EvaluationResult Bool) +verifyEd25519Signature_V2 pk msg sig = + case DSIGN.rawDeserialiseVerKeyDSIGN @Ed25519DSIGN pk of + Nothing -> failWithMessage loc "Invalid verification key." + Just pk' -> case DSIGN.rawDeserialiseSigDSIGN @Ed25519DSIGN sig of + Nothing -> failWithMessage loc "Invalid signature." + Just sig' -> + pure . pure $ + case DSIGN.verifyDSIGN () pk' msg sig' of + Left _ -> False + Right () -> True + where + loc :: Text + loc = "Ed25519 signature verification" + diff --git a/plutus-core/plutus-core/src/Crypto.hs b/plutus-core/plutus-core/src/PlutusCore/Crypto/Secp256k1.hs similarity index 56% rename from plutus-core/plutus-core/src/Crypto.hs rename to plutus-core/plutus-core/src/PlutusCore/Crypto/Secp256k1.hs index bef325fa7e4..ef16f3ae123 100644 --- a/plutus-core/plutus-core/src/Crypto.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Crypto/Secp256k1.hs @@ -1,67 +1,20 @@ -{-# LANGUAGE KindSignatures #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications #-} -module Crypto ( - verifyEd25519Signature_V1, - verifyEd25519Signature_V2, - verifyEcdsaSecp256k1Signature, - verifySchnorrSecp256k1Signature, - ) where +module PlutusCore.Crypto.Secp256k1 ( + verifyEcdsaSecp256k1Signature, + verifySchnorrSecp256k1Signature + ) where + +import PlutusCore.Crypto.Utils import Cardano.Crypto.DSIGN.Class qualified as DSIGN import Cardano.Crypto.DSIGN.EcdsaSecp256k1 (EcdsaSecp256k1DSIGN, toMessageHash) -import Cardano.Crypto.DSIGN.Ed25519 (Ed25519DSIGN) import Cardano.Crypto.DSIGN.SchnorrSecp256k1 (SchnorrSecp256k1DSIGN) -import Crypto.ECC.Ed25519Donna (publicKey, signature, verify) -import Crypto.Error (CryptoFailable (..)) import Data.ByteString qualified as BS -import Data.Kind (Type) -import Data.Text (Text, pack) -import PlutusCore.Builtin.Emitter (Emitter, emit) -import PlutusCore.Evaluation.Result (EvaluationResult (EvaluationFailure)) - --- | Ed25519 signature verification --- This will fail if the key or the signature are not of the expected length. --- This version uses the cardano-crypto implementation of the verification function. -verifyEd25519Signature_V1 - :: BS.ByteString -- ^ Public Key (32 bytes) - -> BS.ByteString -- ^ Message (arbitrary length) - -> BS.ByteString -- ^ Signature (64 bytes) - -> Emitter (EvaluationResult Bool) -verifyEd25519Signature_V1 pubKey msg sig = - case verify - <$> publicKey pubKey - <*> pure msg - <*> signature sig - of CryptoPassed r -> pure $ pure r - CryptoFailed err -> failWithMessage loc $ pack (show err) - where - loc :: Text - loc = "Ed25519 signature verification" - --- | Ed25519 signature verification --- This will fail if the key or the signature are not of the expected length. --- This version uses the cardano-crypto-class implementation of the verification --- function (using libsodium). -verifyEd25519Signature_V2 - :: BS.ByteString -- ^ Public Key (32 bytes) - -> BS.ByteString -- ^ Message (arbitrary length) - -> BS.ByteString -- ^ Signature (64 bytes) - -> Emitter (EvaluationResult Bool) -verifyEd25519Signature_V2 pk msg sig = - case DSIGN.rawDeserialiseVerKeyDSIGN @Ed25519DSIGN pk of - Nothing -> failWithMessage loc "Invalid verification key." - Just pk' -> case DSIGN.rawDeserialiseSigDSIGN @Ed25519DSIGN sig of - Nothing -> failWithMessage loc "Invalid signature." - Just sig' -> - pure . pure $ - case DSIGN.verifyDSIGN () pk' msg sig' of - Left _ -> False - Right () -> True - where - loc :: Text - loc = "Ed25519 signature verification" +import Data.Text (Text) +import PlutusCore.Builtin.Emitter (Emitter) +import PlutusCore.Evaluation.Result (EvaluationResult) -- | Verify an ECDSA signature made using the SECP256k1 curve. -- @@ -138,15 +91,3 @@ verifySchnorrSecp256k1Signature pk msg sig = loc :: Text loc = "Schnorr SECP256k1 signature verification" --- Helpers - --- TODO: Something like 'failWithMessage x y *> foo' should really fail with --- 'EvaluationFailure' without evaluating 'foo', but currently it will. This --- requires a fix to how Emitter and EvaluationResult work, and since we don't --- expect 'failWithMessage' to be used this way, we note this for future --- reference only for when such fixes are made. -failWithMessage :: forall (a :: Type) . - Text -> Text -> Emitter (EvaluationResult a) -failWithMessage location reason = do - emit $ location <> ": " <> reason - pure EvaluationFailure diff --git a/plutus-core/plutus-core/src/PlutusCore/Crypto/Utils.hs b/plutus-core/plutus-core/src/PlutusCore/Crypto/Utils.hs new file mode 100644 index 00000000000..d8ebf8ec11b --- /dev/null +++ b/plutus-core/plutus-core/src/PlutusCore/Crypto/Utils.hs @@ -0,0 +1,27 @@ +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE OverloadedStrings #-} + +module PlutusCore.Crypto.Utils (failWithMessage, byteStringAsHex) +where + +import Data.ByteString (ByteString, foldr') +import Data.Kind (Type) +import Data.Text (Text) +import Text.Printf (printf) + +import PlutusCore.Builtin.Emitter (Emitter, emit) +import PlutusCore.Evaluation.Result (EvaluationResult (EvaluationFailure)) + +-- TODO: Something like 'failWithMessage x y *> foo' should really fail with +-- 'EvaluationFailure' without evaluating 'foo', but currently it will. This +-- requires a fix to how Emitter and EvaluationResult work, and since we don't +-- expect 'failWithMessage' to be used this way, we note this for future +-- reference only for when such fixes are made. +failWithMessage :: forall (a :: Type) . + Text -> Text -> Emitter (EvaluationResult a) +failWithMessage location reason = do + emit $ location <> ": " <> reason + pure EvaluationFailure + +byteStringAsHex :: ByteString -> String +byteStringAsHex bs = "0x" ++ (Prelude.concat $ foldr' (\w s -> (printf "%02x" w):s) [] bs) diff --git a/plutus-core/plutus-core/src/PlutusCore/Default/Builtins.hs b/plutus-core/plutus-core/src/PlutusCore/Default/Builtins.hs index 5fe087ac3a6..85a8a7a08c7 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Default/Builtins.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Default/Builtins.hs @@ -25,15 +25,19 @@ import PlutusCore.Evaluation.Machine.ExMemoryUsage import PlutusCore.Evaluation.Result import PlutusCore.Pretty +import PlutusCore.Crypto.BLS12_381.G1 qualified as BLS12_381.G1 +import PlutusCore.Crypto.BLS12_381.G2 qualified as BLS12_381.G2 +import PlutusCore.Crypto.BLS12_381.Pairing qualified as BLS12_381.Pairing +import PlutusCore.Crypto.Ed25519 (verifyEd25519Signature_V1, verifyEd25519Signature_V2) +import PlutusCore.Crypto.Secp256k1 (verifyEcdsaSecp256k1Signature, verifySchnorrSecp256k1Signature) + import Codec.Serialise (serialise) -import Crypto (verifyEcdsaSecp256k1Signature, verifyEd25519Signature_V1, verifyEd25519Signature_V2, - verifySchnorrSecp256k1Signature) import Data.ByteString qualified as BS import Data.ByteString.Hash qualified as Hash import Data.ByteString.Lazy qualified as BSL import Data.Char import Data.Ix -import Data.Text (Text) +import Data.Text (Text, pack) import Data.Text.Encoding (decodeUtf8', encodeUtf8) import Flat hiding (from, to) import Flat.Decoder @@ -119,6 +123,28 @@ data DefaultFun | MkPairData | MkNilData | MkNilPairData + -- BLS12_381 operations + -- G1 + | Bls12_381_G1_add + | Bls12_381_G1_neg + | Bls12_381_G1_scalarMul + | Bls12_381_G1_equal + | Bls12_381_G1_hashToGroup + | Bls12_381_G1_compress + | Bls12_381_G1_uncompress + -- G2 + | Bls12_381_G2_add + | Bls12_381_G2_neg + | Bls12_381_G2_scalarMul + | Bls12_381_G2_equal + | Bls12_381_G2_hashToGroup + | Bls12_381_G2_compress + | Bls12_381_G2_uncompress + -- Pairing + | Bls12_381_millerLoop + | Bls12_381_mulMlResult + | Bls12_381_finalVerify + deriving stock (Show, Eq, Ord, Enum, Bounded, Generic, Ix) deriving anyclass (NFData, Hashable, PrettyBy PrettyConfigPlc) @@ -137,13 +163,21 @@ instance Pretty DefaultFun where instance ExMemoryUsage DefaultFun where memoryUsage _ = singletonRose 1 --- | Turn a function into another function that returns 'EvaluationFailure' when its second argument --- is 0 or calls the original function otherwise and wraps the result in 'EvaluationSuccess'. --- Useful for correctly handling `div`, `mod`, etc. +-- | Turn a function into another function that returns 'EvaluationFailure' when +-- its second argument is 0 or calls the original function otherwise and wraps +-- the result in 'EvaluationSuccess'. Useful for correctly handling `div`, +-- `mod`, etc. nonZeroArg :: (Integer -> Integer -> Integer) -> Integer -> Integer -> EvaluationResult Integer nonZeroArg _ _ 0 = EvaluationFailure nonZeroArg f x y = EvaluationSuccess $ f x y +-- | Turn a function returning 'Either' into another function that emits an +-- error message and returns 'EvaluationFailure' in the 'Left' case and wraps +-- the result in 'EvaluationSuccess' in the 'Right' case. +eitherToEmitter :: Show e => Either e r -> Emitter (EvaluationResult r) +eitherToEmitter (Left e) = (emit . pack . show $ e) >> pure EvaluationFailure +eitherToEmitter (Right r) = pure . pure $ r + {- Note [Constants vs built-in functions] A constant is any value of a built-in type. For example, 'Integer' is a built-in type, so anything of type 'Integer' is a constant. @@ -1363,6 +1397,77 @@ instance uni ~ DefaultUni => ToBuiltinMeaning uni DefaultFun where makeBuiltinMeaning (\() -> [] @(Data,Data)) (runCostingFunOneArgument . paramMkNilPairData) + -- BLS12_381.G1 + toBuiltinMeaning _var Bls12_381_G1_add = + makeBuiltinMeaning + BLS12_381.G1.add + (runCostingFunTwoArguments . paramBls12_381_G1_add) + toBuiltinMeaning _var Bls12_381_G1_neg = + makeBuiltinMeaning + BLS12_381.G1.neg + (runCostingFunOneArgument . paramBls12_381_G1_neg) + toBuiltinMeaning _var Bls12_381_G1_scalarMul = + makeBuiltinMeaning + BLS12_381.G1.scalarMul + (runCostingFunTwoArguments . paramBls12_381_G1_scalarMul) + toBuiltinMeaning _var Bls12_381_G1_compress = + makeBuiltinMeaning + BLS12_381.G1.compress + (runCostingFunOneArgument . paramBls12_381_G1_compress) + toBuiltinMeaning _var Bls12_381_G1_uncompress = + makeBuiltinMeaning + (eitherToEmitter . BLS12_381.G1.uncompress) + (runCostingFunOneArgument . paramBls12_381_G1_uncompress) + toBuiltinMeaning _var Bls12_381_G1_hashToGroup = + makeBuiltinMeaning + (eitherToEmitter .* BLS12_381.G1.hashToGroup) + (runCostingFunTwoArguments . paramBls12_381_G1_hashToGroup) + toBuiltinMeaning _var Bls12_381_G1_equal = + makeBuiltinMeaning + ((==) @BLS12_381.G1.Element) + (runCostingFunTwoArguments . paramBls12_381_G1_equal) + -- BLS12_381.G2 + toBuiltinMeaning _var Bls12_381_G2_add = + makeBuiltinMeaning + BLS12_381.G2.add + (runCostingFunTwoArguments . paramBls12_381_G2_add) + toBuiltinMeaning _var Bls12_381_G2_neg = + makeBuiltinMeaning + BLS12_381.G2.neg + (runCostingFunOneArgument . paramBls12_381_G2_neg) + toBuiltinMeaning _var Bls12_381_G2_scalarMul = + makeBuiltinMeaning + BLS12_381.G2.scalarMul + (runCostingFunTwoArguments . paramBls12_381_G2_scalarMul) + toBuiltinMeaning _var Bls12_381_G2_compress = + makeBuiltinMeaning + BLS12_381.G2.compress + (runCostingFunOneArgument . paramBls12_381_G2_compress) + toBuiltinMeaning _var Bls12_381_G2_uncompress = + makeBuiltinMeaning + (eitherToEmitter . BLS12_381.G2.uncompress) + (runCostingFunOneArgument . paramBls12_381_G2_uncompress) + toBuiltinMeaning _var Bls12_381_G2_hashToGroup = + makeBuiltinMeaning + (eitherToEmitter .* BLS12_381.G2.hashToGroup) + (runCostingFunTwoArguments . paramBls12_381_G2_hashToGroup) + toBuiltinMeaning _var Bls12_381_G2_equal = + makeBuiltinMeaning + ((==) @BLS12_381.G2.Element) + (runCostingFunTwoArguments . paramBls12_381_G2_equal) + -- BLS12_381.Pairing + toBuiltinMeaning _var Bls12_381_millerLoop = + makeBuiltinMeaning + BLS12_381.Pairing.millerLoop + (runCostingFunTwoArguments . paramBls12_381_millerLoop) + toBuiltinMeaning _var Bls12_381_mulMlResult = + makeBuiltinMeaning + BLS12_381.Pairing.mulMlResult + (runCostingFunTwoArguments . paramBls12_381_mulMlResult) + toBuiltinMeaning _var Bls12_381_finalVerify = + makeBuiltinMeaning + BLS12_381.Pairing.finalVerify + (runCostingFunTwoArguments . paramBls12_381_finalVerify) -- See Note [Inlining meanings of builtins]. {-# INLINE toBuiltinMeaning #-} @@ -1412,8 +1517,6 @@ instance Flat DefaultFun where Sha3_256 -> 19 Blake2b_256 -> 20 VerifyEd25519Signature -> 21 - VerifyEcdsaSecp256k1Signature -> 52 - VerifySchnorrSecp256k1Signature -> 53 AppendString -> 22 EqualsString -> 23 @@ -1451,6 +1554,25 @@ instance Flat DefaultFun where MkNilData -> 49 MkNilPairData -> 50 SerialiseData -> 51 + VerifyEcdsaSecp256k1Signature -> 52 + VerifySchnorrSecp256k1Signature -> 53 + Bls12_381_G1_add -> 54 + Bls12_381_G1_neg -> 55 + Bls12_381_G1_scalarMul -> 56 + Bls12_381_G1_equal -> 57 + Bls12_381_G1_compress -> 58 + Bls12_381_G1_uncompress -> 59 + Bls12_381_G1_hashToGroup -> 60 + Bls12_381_G2_add -> 61 + Bls12_381_G2_neg -> 62 + Bls12_381_G2_scalarMul -> 63 + Bls12_381_G2_equal -> 64 + Bls12_381_G2_compress -> 65 + Bls12_381_G2_uncompress -> 66 + Bls12_381_G2_hashToGroup -> 67 + Bls12_381_millerLoop -> 68 + Bls12_381_mulMlResult -> 69 + Bls12_381_finalVerify -> 70 decode = go =<< decodeBuiltin where go 0 = pure AddInteger @@ -1507,6 +1629,23 @@ instance Flat DefaultFun where go 51 = pure SerialiseData go 52 = pure VerifyEcdsaSecp256k1Signature go 53 = pure VerifySchnorrSecp256k1Signature + go 54 = pure Bls12_381_G1_add + go 55 = pure Bls12_381_G1_neg + go 56 = pure Bls12_381_G1_scalarMul + go 57 = pure Bls12_381_G1_equal + go 58 = pure Bls12_381_G1_compress + go 59 = pure Bls12_381_G1_uncompress + go 60 = pure Bls12_381_G1_hashToGroup + go 61 = pure Bls12_381_G2_add + go 62 = pure Bls12_381_G2_neg + go 63 = pure Bls12_381_G2_scalarMul + go 64 = pure Bls12_381_G2_equal + go 65 = pure Bls12_381_G2_compress + go 66 = pure Bls12_381_G2_uncompress + go 67 = pure Bls12_381_G2_hashToGroup + go 68 = pure Bls12_381_millerLoop + go 69 = pure Bls12_381_mulMlResult + go 70 = pure Bls12_381_finalVerify go t = fail $ "Failed to decode builtin tag, got: " ++ show t size _ n = n + builtinTagWidth diff --git a/plutus-core/plutus-core/src/PlutusCore/Default/Universe.hs b/plutus-core/plutus-core/src/PlutusCore/Default/Universe.hs index 2ae95e8620c..471defd5681 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Default/Universe.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Default/Universe.hs @@ -1,3 +1,5 @@ +-- editorconfig-checker-disable-file + -- | The universe used by default and its instances. {-# OPTIONS -fno-warn-missing-pattern-synonym-signatures #-} @@ -42,6 +44,9 @@ module PlutusCore.Default.Universe ) where import PlutusCore.Builtin +import PlutusCore.Crypto.BLS12_381.G1 qualified as BLS12_381.G1 +import PlutusCore.Crypto.BLS12_381.G2 qualified as BLS12_381.G2 +import PlutusCore.Crypto.BLS12_381.Pairing qualified as BLS12_381.Pairing import PlutusCore.Data import PlutusCore.Evaluation.Machine.Exception import PlutusCore.Evaluation.Result @@ -97,15 +102,18 @@ feature and have meta-constructors as built-in functions. -- See Note [Representing polymorphism]. -- | The universe used by default. data DefaultUni a where - DefaultUniInteger :: DefaultUni (Esc Integer) - DefaultUniByteString :: DefaultUni (Esc BS.ByteString) - DefaultUniString :: DefaultUni (Esc Text.Text) - DefaultUniUnit :: DefaultUni (Esc ()) - DefaultUniBool :: DefaultUni (Esc Bool) - DefaultUniProtoList :: DefaultUni (Esc []) - DefaultUniProtoPair :: DefaultUni (Esc (,)) - DefaultUniApply :: !(DefaultUni (Esc f)) -> !(DefaultUni (Esc a)) -> DefaultUni (Esc (f a)) - DefaultUniData :: DefaultUni (Esc Data) + DefaultUniInteger :: DefaultUni (Esc Integer) + DefaultUniByteString :: DefaultUni (Esc BS.ByteString) + DefaultUniString :: DefaultUni (Esc Text.Text) + DefaultUniUnit :: DefaultUni (Esc ()) + DefaultUniBool :: DefaultUni (Esc Bool) + DefaultUniProtoList :: DefaultUni (Esc []) + DefaultUniProtoPair :: DefaultUni (Esc (,)) + DefaultUniApply :: !(DefaultUni (Esc f)) -> !(DefaultUni (Esc a)) -> DefaultUni (Esc (f a)) + DefaultUniData :: DefaultUni (Esc Data) + DefaultUniBLS12_381_G1_Element :: DefaultUni (Esc BLS12_381.G1.Element) + DefaultUniBLS12_381_G2_Element :: DefaultUni (Esc BLS12_381.G2.Element) + DefaultUniBLS12_381_MlResult :: DefaultUni (Esc BLS12_381.Pairing.MlResult) -- GHC infers crazy types for these two and the straightforward ones break pattern matching, -- so we just leave GHC with its craziness. @@ -156,6 +164,15 @@ instance GEq DefaultUni where geqStep DefaultUniData a2 = do DefaultUniData <- Just a2 Just Refl + geqStep DefaultUniBLS12_381_G1_Element a2 = do + DefaultUniBLS12_381_G1_Element <- Just a2 + Just Refl + geqStep DefaultUniBLS12_381_G2_Element a2 = do + DefaultUniBLS12_381_G2_Element <- Just a2 + Just Refl + geqStep DefaultUniBLS12_381_MlResult a2 = do + DefaultUniBLS12_381_MlResult <- Just a2 + Just Refl {-# INLINE geqStep #-} geqRec :: DefaultUni a1 -> DefaultUni a2 -> Maybe (a1 :~: a2) @@ -169,15 +186,18 @@ noMoreTypeFunctions :: DefaultUni (Esc (f :: a -> b -> c -> d)) -> any noMoreTypeFunctions (f `DefaultUniApply` _) = noMoreTypeFunctions f instance ToKind DefaultUni where - toSingKind DefaultUniInteger = knownKind - toSingKind DefaultUniByteString = knownKind - toSingKind DefaultUniString = knownKind - toSingKind DefaultUniUnit = knownKind - toSingKind DefaultUniBool = knownKind - toSingKind DefaultUniProtoList = knownKind - toSingKind DefaultUniProtoPair = knownKind - toSingKind (DefaultUniApply uniF _) = case toSingKind uniF of _ `SingKindArrow` cod -> cod - toSingKind DefaultUniData = knownKind + toSingKind DefaultUniInteger = knownKind + toSingKind DefaultUniByteString = knownKind + toSingKind DefaultUniString = knownKind + toSingKind DefaultUniUnit = knownKind + toSingKind DefaultUniBool = knownKind + toSingKind DefaultUniProtoList = knownKind + toSingKind DefaultUniProtoPair = knownKind + toSingKind (DefaultUniApply uniF _) = case toSingKind uniF of _ `SingKindArrow` cod -> cod + toSingKind DefaultUniData = knownKind + toSingKind DefaultUniBLS12_381_G1_Element = knownKind + toSingKind DefaultUniBLS12_381_G2_Element = knownKind + toSingKind DefaultUniBLS12_381_MlResult = knownKind instance HasUniApply DefaultUni where uniApply = DefaultUniApply @@ -190,15 +210,18 @@ instance GShow DefaultUni where gshowsPrec = showsPrec instance HasRenderContext config => PrettyBy config (DefaultUni a) where prettyBy = inContextM $ \case - DefaultUniInteger -> "integer" - DefaultUniByteString -> "bytestring" - DefaultUniString -> "string" - DefaultUniUnit -> "unit" - DefaultUniBool -> "bool" - DefaultUniProtoList -> "list" - DefaultUniProtoPair -> "pair" - DefaultUniApply uniF uniA -> uniF `juxtPrettyM` uniA - DefaultUniData -> "data" + DefaultUniInteger -> "integer" + DefaultUniByteString -> "bytestring" + DefaultUniString -> "string" + DefaultUniUnit -> "unit" + DefaultUniBool -> "bool" + DefaultUniProtoList -> "list" + DefaultUniProtoPair -> "pair" + DefaultUniApply uniF uniA -> uniF `juxtPrettyM` uniA + DefaultUniData -> "data" + DefaultUniBLS12_381_G1_Element -> "bls12_381_G1_element" + DefaultUniBLS12_381_G2_Element -> "bls12_381_G2_element" + DefaultUniBLS12_381_MlResult -> "bls12_381_mlresult" instance HasRenderContext config => PrettyBy config (SomeTypeIn DefaultUni) where prettyBy config (SomeTypeIn uni) = prettyBy config uni @@ -210,26 +233,32 @@ instance Pretty (DefaultUni a) where instance Pretty (SomeTypeIn DefaultUni) where pretty (SomeTypeIn uni) = pretty uni -instance DefaultUni `Contains` Integer where knownUni = DefaultUniInteger -instance DefaultUni `Contains` BS.ByteString where knownUni = DefaultUniByteString -instance DefaultUni `Contains` Text.Text where knownUni = DefaultUniString -instance DefaultUni `Contains` () where knownUni = DefaultUniUnit -instance DefaultUni `Contains` Bool where knownUni = DefaultUniBool -instance DefaultUni `Contains` [] where knownUni = DefaultUniProtoList -instance DefaultUni `Contains` (,) where knownUni = DefaultUniProtoPair -instance DefaultUni `Contains` Data where knownUni = DefaultUniData +instance DefaultUni `Contains` Integer where knownUni = DefaultUniInteger +instance DefaultUni `Contains` BS.ByteString where knownUni = DefaultUniByteString +instance DefaultUni `Contains` Text.Text where knownUni = DefaultUniString +instance DefaultUni `Contains` () where knownUni = DefaultUniUnit +instance DefaultUni `Contains` Bool where knownUni = DefaultUniBool +instance DefaultUni `Contains` [] where knownUni = DefaultUniProtoList +instance DefaultUni `Contains` (,) where knownUni = DefaultUniProtoPair +instance DefaultUni `Contains` Data where knownUni = DefaultUniData +instance DefaultUni `Contains` BLS12_381.G1.Element where knownUni = DefaultUniBLS12_381_G1_Element +instance DefaultUni `Contains` BLS12_381.G2.Element where knownUni = DefaultUniBLS12_381_G2_Element +instance DefaultUni `Contains` BLS12_381.Pairing.MlResult where knownUni = DefaultUniBLS12_381_MlResult instance (DefaultUni `Contains` f, DefaultUni `Contains` a) => DefaultUni `Contains` f a where knownUni = knownUni `DefaultUniApply` knownUni -instance KnownBuiltinTypeAst DefaultUni Integer => KnownTypeAst DefaultUni Integer -instance KnownBuiltinTypeAst DefaultUni BS.ByteString => KnownTypeAst DefaultUni BS.ByteString -instance KnownBuiltinTypeAst DefaultUni Text.Text => KnownTypeAst DefaultUni Text.Text -instance KnownBuiltinTypeAst DefaultUni () => KnownTypeAst DefaultUni () -instance KnownBuiltinTypeAst DefaultUni Bool => KnownTypeAst DefaultUni Bool -instance KnownBuiltinTypeAst DefaultUni [a] => KnownTypeAst DefaultUni [a] -instance KnownBuiltinTypeAst DefaultUni (a, b) => KnownTypeAst DefaultUni (a, b) -instance KnownBuiltinTypeAst DefaultUni Data => KnownTypeAst DefaultUni Data +instance KnownBuiltinTypeAst DefaultUni Integer => KnownTypeAst DefaultUni Integer +instance KnownBuiltinTypeAst DefaultUni BS.ByteString => KnownTypeAst DefaultUni BS.ByteString +instance KnownBuiltinTypeAst DefaultUni Text.Text => KnownTypeAst DefaultUni Text.Text +instance KnownBuiltinTypeAst DefaultUni () => KnownTypeAst DefaultUni () +instance KnownBuiltinTypeAst DefaultUni Bool => KnownTypeAst DefaultUni Bool +instance KnownBuiltinTypeAst DefaultUni [a] => KnownTypeAst DefaultUni [a] +instance KnownBuiltinTypeAst DefaultUni (a, b) => KnownTypeAst DefaultUni (a, b) +instance KnownBuiltinTypeAst DefaultUni Data => KnownTypeAst DefaultUni Data +instance KnownBuiltinTypeAst DefaultUni BLS12_381.G1.Element => KnownTypeAst DefaultUni BLS12_381.G1.Element +instance KnownBuiltinTypeAst DefaultUni BLS12_381.G2.Element => KnownTypeAst DefaultUni BLS12_381.G2.Element +instance KnownBuiltinTypeAst DefaultUni BLS12_381.Pairing.MlResult => KnownTypeAst DefaultUni BLS12_381.Pairing.MlResult {- Note [Constraints of ReadKnownIn and MakeKnownIn instances] For a monomorphic data type @X@ one only needs to add a @HasConstantIn DefaultUni term@ constraint @@ -276,6 +305,9 @@ instance (HasConstantIn DefaultUni term, DefaultUni `Contains` [a]) => MakeKnownIn DefaultUni term [a] instance (HasConstantIn DefaultUni term, DefaultUni `Contains` (a, b)) => MakeKnownIn DefaultUni term (a, b) +instance HasConstantIn DefaultUni term => MakeKnownIn DefaultUni term BLS12_381.G1.Element +instance HasConstantIn DefaultUni term => MakeKnownIn DefaultUni term BLS12_381.G2.Element +instance HasConstantIn DefaultUni term => MakeKnownIn DefaultUni term BLS12_381.Pairing.MlResult -- See Note [Constraints of ReadKnownIn and MakeKnownIn instances]. instance HasConstantIn DefaultUni term => ReadKnownIn DefaultUni term Integer @@ -288,6 +320,9 @@ instance (HasConstantIn DefaultUni term, DefaultUni `Contains` [a]) => ReadKnownIn DefaultUni term [a] instance (HasConstantIn DefaultUni term, DefaultUni `Contains` (a, b)) => ReadKnownIn DefaultUni term (a, b) +instance HasConstantIn DefaultUni term => ReadKnownIn DefaultUni term BLS12_381.G1.Element +instance HasConstantIn DefaultUni term => ReadKnownIn DefaultUni term BLS12_381.G2.Element +instance HasConstantIn DefaultUni term => ReadKnownIn DefaultUni term BLS12_381.Pairing.MlResult -- If this tells you an instance is missing, add it right above, following the pattern. instance TestTypesFromTheUniverseAreAllKnown DefaultUni @@ -398,20 +433,25 @@ instance Closed DefaultUni where , constr `Permits` [] , constr `Permits` (,) , constr `Permits` Data + , constr `Permits` BLS12_381.G1.Element + , constr `Permits` BLS12_381.G2.Element + , constr `Permits` BLS12_381.Pairing.MlResult ) -- See Note [Stable encoding of tags]. -- IF YOU'RE GETTING A WARNING HERE, DON'T FORGET TO AMEND 'withDecodedUni' RIGHT BELOW. - encodeUni DefaultUniInteger = [0] - encodeUni DefaultUniByteString = [1] - encodeUni DefaultUniString = [2] - encodeUni DefaultUniUnit = [3] - encodeUni DefaultUniBool = [4] - encodeUni DefaultUniProtoList = [5] - encodeUni DefaultUniProtoPair = [6] - encodeUni (DefaultUniApply uniF uniA) = 7 : encodeUni uniF ++ encodeUni uniA - encodeUni DefaultUniData = [8] - + encodeUni DefaultUniInteger = [0] + encodeUni DefaultUniByteString = [1] + encodeUni DefaultUniString = [2] + encodeUni DefaultUniUnit = [3] + encodeUni DefaultUniBool = [4] + encodeUni DefaultUniProtoList = [5] + encodeUni DefaultUniProtoPair = [6] + encodeUni (DefaultUniApply uniF uniA) = 7 : encodeUni uniF ++ encodeUni uniA + encodeUni DefaultUniData = [8] + encodeUni DefaultUniBLS12_381_G1_Element = [9] + encodeUni DefaultUniBLS12_381_G2_Element = [10] + encodeUni DefaultUniBLS12_381_MlResult = [11] -- See Note [Decoding universes]. -- See Note [Stable encoding of tags]. withDecodedUni k = peelUniTag >>= \case @@ -427,8 +467,11 @@ instance Closed DefaultUni where withDecodedUni @DefaultUni $ \uniA -> withApplicable uniF uniA $ k $ uniF `DefaultUniApply` uniA - 8 -> k DefaultUniData - _ -> empty + 8 -> k DefaultUniData + 9 -> k DefaultUniBLS12_381_G1_Element + 10 -> k DefaultUniBLS12_381_G2_Element + 11 -> k DefaultUniBLS12_381_MlResult + _ -> empty bring :: forall constr a r proxy. DefaultUni `Everywhere` constr @@ -445,3 +488,7 @@ instance Closed DefaultUni where bring _ (f `DefaultUniApply` _ `DefaultUniApply` _ `DefaultUniApply` _) _ = noMoreTypeFunctions f bring _ DefaultUniData r = r + bring _ DefaultUniBLS12_381_G1_Element r = r + bring _ DefaultUniBLS12_381_G2_Element r = r + bring _ DefaultUniBLS12_381_MlResult r = r + diff --git a/plutus-core/plutus-core/src/PlutusCore/Error.hs b/plutus-core/plutus-core/src/PlutusCore/Error.hs index fb0ab80e02e..37a43c49cc4 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Error.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Error.hs @@ -153,8 +153,8 @@ instance Pretty ParserError where "Expected a type of kind star (to later parse a constant), but got:" <+> squotes (pretty ty) <+> "at" <+> pretty loc pretty (UnknownBuiltinFunction s loc lBuiltin) = - "Unknown built-in function" <+> squotes (pretty s) <+> "at" <+> pretty loc <+> - ". Parsable functions are " <+> pretty lBuiltin + "Unknown built-in function" <+> squotes (pretty s) <+> "at" <+> pretty loc <> + "." <> hardline <> "Parsable functions are " <+> pretty lBuiltin pretty (InvalidBuiltinConstant c s loc) = "Invalid constant" <+> squotes (pretty c) <+> "of type" <+> squotes (pretty s) <+> "at" <+> pretty loc diff --git a/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/BuiltinCostModel.hs b/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/BuiltinCostModel.hs index 7381d4bc9f9..a2326264525 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/BuiltinCostModel.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/BuiltinCostModel.hs @@ -135,6 +135,24 @@ data BuiltinCostModelBase f = , paramMkNilData :: f ModelOneArgument , paramMkNilPairData :: f ModelOneArgument , paramSerialiseData :: f ModelOneArgument + -- BLS12-381 + , paramBls12_381_G1_add :: f ModelTwoArguments + , paramBls12_381_G1_neg :: f ModelOneArgument + , paramBls12_381_G1_scalarMul :: f ModelTwoArguments + , paramBls12_381_G1_equal :: f ModelTwoArguments + , paramBls12_381_G1_compress :: f ModelOneArgument + , paramBls12_381_G1_uncompress :: f ModelOneArgument + , paramBls12_381_G1_hashToGroup :: f ModelTwoArguments + , paramBls12_381_G2_add :: f ModelTwoArguments + , paramBls12_381_G2_neg :: f ModelOneArgument + , paramBls12_381_G2_scalarMul :: f ModelTwoArguments + , paramBls12_381_G2_equal :: f ModelTwoArguments + , paramBls12_381_G2_compress :: f ModelOneArgument + , paramBls12_381_G2_uncompress :: f ModelOneArgument + , paramBls12_381_G2_hashToGroup :: f ModelTwoArguments + , paramBls12_381_millerLoop :: f ModelTwoArguments + , paramBls12_381_mulMlResult :: f ModelTwoArguments + , paramBls12_381_finalVerify :: f ModelTwoArguments } deriving stock (Generic) deriving anyclass (FunctorB, TraversableB, ConstraintsB) diff --git a/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/ExBudgetingDefaults.hs b/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/ExBudgetingDefaults.hs index 8a8800b3e8f..636dd6e8d83 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/ExBudgetingDefaults.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/ExBudgetingDefaults.hs @@ -177,4 +177,23 @@ unitCostBuiltinCostModel = BuiltinCostModelBase , paramMkNilData = unitCostOneArgument , paramMkNilPairData = unitCostOneArgument , paramSerialiseData = unitCostOneArgument + -- BLS12-381 operations + , paramBls12_381_G1_add = unitCostTwoArguments + , paramBls12_381_G1_neg = unitCostOneArgument + , paramBls12_381_G1_scalarMul = unitCostTwoArguments + , paramBls12_381_G1_equal = unitCostTwoArguments + , paramBls12_381_G1_compress = unitCostOneArgument + , paramBls12_381_G1_uncompress = unitCostOneArgument + , paramBls12_381_G1_hashToGroup = unitCostTwoArguments + , paramBls12_381_G2_add = unitCostTwoArguments + , paramBls12_381_G2_neg = unitCostOneArgument + , paramBls12_381_G2_scalarMul = unitCostTwoArguments + , paramBls12_381_G2_equal = unitCostTwoArguments + , paramBls12_381_G2_compress = unitCostOneArgument + , paramBls12_381_G2_uncompress = unitCostOneArgument + , paramBls12_381_G2_hashToGroup = unitCostTwoArguments + , paramBls12_381_millerLoop = unitCostTwoArguments + , paramBls12_381_mulMlResult = unitCostTwoArguments + , paramBls12_381_finalVerify = unitCostTwoArguments } + diff --git a/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/ExMemoryUsage.hs b/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/ExMemoryUsage.hs index 99aef70b1d2..a63fa540469 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/ExMemoryUsage.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/ExMemoryUsage.hs @@ -12,6 +12,9 @@ module PlutusCore.Evaluation.Machine.ExMemoryUsage , flattenCostRose ) where +import PlutusCore.Crypto.BLS12_381.G1 as BLS12_381.G1 +import PlutusCore.Crypto.BLS12_381.G2 as BLS12_381.G2 +import PlutusCore.Crypto.BLS12_381.Pairing as BLS12_381.Pairing import PlutusCore.Data import PlutusCore.Evaluation.Machine.CostStream import PlutusCore.Evaluation.Machine.ExMemory @@ -254,3 +257,15 @@ instance ExMemoryUsage Data where List l -> CostRose 0 $ l <&> sizeData I n -> memoryUsage n B b -> memoryUsage b + +instance ExMemoryUsage BLS12_381.G1.Element where + memoryUsage _ = singletonRose . unsafeToSatInt $ BLS12_381.G1.memSizeBytes `div` 8 + -- Should be 12 + +instance ExMemoryUsage BLS12_381.G2.Element where + memoryUsage _ = singletonRose . unsafeToSatInt $ BLS12_381.G2.memSizeBytes `div` 8 + -- Should be 24 + +instance ExMemoryUsage BLS12_381.Pairing.MlResult where + memoryUsage _ = singletonRose . unsafeToSatInt $ BLS12_381.Pairing.mlResultMemSizeBytes `div` 8 + -- Should be 144 diff --git a/plutus-core/plutus-core/src/PlutusCore/Parser/Builtin.hs b/plutus-core/plutus-core/src/PlutusCore/Parser/Builtin.hs index 22117da936c..f12801a4aed 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Parser/Builtin.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Parser/Builtin.hs @@ -5,6 +5,8 @@ module PlutusCore.Parser.Builtin where import PlutusPrelude (Word8, reoption) +import PlutusCore.Crypto.BLS12_381.G1 qualified as BLS12_381.G1 +import PlutusCore.Crypto.BLS12_381.G2 qualified as BLS12_381.G2 import PlutusCore.Data import PlutusCore.Default import PlutusCore.Error (ParserError (InvalidData, UnknownBuiltinFunction)) @@ -21,7 +23,7 @@ import Data.Map.Strict qualified as Map import Data.Text qualified as T import Data.Text.Internal.Read (hexDigitToInt) import Text.Megaparsec (customFailure, getSourcePos, takeWhileP) -import Text.Megaparsec.Char (char, hexDigitChar) +import Text.Megaparsec.Char (char, hexDigitChar, string) import Text.Megaparsec.Char.Lexer qualified as Lex cachedBuiltin :: Map.Map T.Text DefaultFun @@ -88,18 +90,41 @@ conData = do Right d -> pure d Left err -> getSourcePos >>= customFailure . InvalidData (T.pack (show err)) +-- Serialised BLS12_381 elements are "0x" followed by a hex string of even +-- length. Maybe we should just use the usual bytestring syntax. +con0xBS :: Parser ByteString +con0xBS = lexeme . fmap pack $ string "0x" *> many hexByte + +conBLS12_381_G1_Element :: Parser BLS12_381.G1.Element +conBLS12_381_G1_Element = do + s <- con0xBS + case BLS12_381.G1.uncompress s of + Left err -> fail $ "Failed to decode value of type bls12_381_G1_element: " ++ show err + Right e -> pure e + +conBLS12_381_G2_Element :: Parser BLS12_381.G2.Element +conBLS12_381_G2_Element = do + s <- con0xBS + case BLS12_381.G2.uncompress s of + Left err -> fail $ "Failed to decode value of type bls12_381_G2_element: " ++ show err + Right e -> pure e + -- | Parser for constants of the given type. constantOf :: DefaultUni (Esc a) -> Parser a constantOf uni = case uni of - DefaultUniInteger -> conInteger - DefaultUniByteString -> conBS - DefaultUniString -> conText - DefaultUniUnit -> conUnit - DefaultUniBool -> conBool - DefaultUniProtoList `DefaultUniApply` uniA -> conList uniA - DefaultUniProtoPair `DefaultUniApply` uniA `DefaultUniApply` uniB -> conPair uniA uniB - f `DefaultUniApply` _ `DefaultUniApply` _ `DefaultUniApply` _ -> noMoreTypeFunctions f - DefaultUniData -> conData + DefaultUniInteger -> conInteger + DefaultUniByteString -> conBS + DefaultUniString -> conText + DefaultUniUnit -> conUnit + DefaultUniBool -> conBool + DefaultUniProtoList `DefaultUniApply` uniA -> conList uniA + DefaultUniProtoPair `DefaultUniApply` uniA `DefaultUniApply` uniB -> conPair uniA uniB + f `DefaultUniApply` _ `DefaultUniApply` _ `DefaultUniApply` _ -> noMoreTypeFunctions f + DefaultUniData -> conData + DefaultUniBLS12_381_G1_Element -> conBLS12_381_G1_Element + DefaultUniBLS12_381_G2_Element -> conBLS12_381_G2_Element + DefaultUniBLS12_381_MlResult + -> fail "Constants of type bls12_381_mlresult are not supported" -- | Parser of constants whose type is in 'DefaultUni'. constant :: Parser (Some (ValueOf DefaultUni)) diff --git a/plutus-core/plutus-core/src/PlutusCore/Parser/Type.hs b/plutus-core/plutus-core/src/PlutusCore/Parser/Type.hs index 74b1665db97..9f686e8bf9f 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Parser/Type.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Parser/Type.hs @@ -10,6 +10,9 @@ import PlutusPrelude import PlutusCore.Annotation import PlutusCore.Core.Type +import PlutusCore.Crypto.BLS12_381.G1 as BLS12_381.G1 +import PlutusCore.Crypto.BLS12_381.G2 as BLS12_381.G2 +import PlutusCore.Crypto.BLS12_381.Pairing as BLS12_381.Pairing import PlutusCore.Data import PlutusCore.Default import PlutusCore.MkPlc (mkIterTyApp) @@ -82,7 +85,8 @@ pType = choice $ map try , sopType ] --- | Parser for built-in type applications. +-- | Parser for built-in type applications. The textual names here should match +-- the ones in the PrettyBy instance for DefaultUni in PlutusCore.Default.Universe. defaultUniApplication :: Parser (SomeTypeIn (Kinded DefaultUni)) defaultUniApplication = do -- Parse the head of the application. @@ -128,14 +132,17 @@ defaultUniApplication = do defaultUni :: Parser (SomeTypeIn (Kinded DefaultUni)) defaultUni = choice $ map try [ trailingWhitespace (inParens defaultUniApplication) - , someType @_ @Integer <$ symbol "integer" - , someType @_ @ByteString <$ symbol "bytestring" - , someType @_ @Text <$ symbol "string" - , someType @_ @() <$ symbol "unit" - , someType @_ @Bool <$ symbol "bool" - , someType @_ @[] <$ symbol "list" - , someType @_ @(,) <$ symbol "pair" - , someType @_ @Data <$ symbol "data" + , someType @_ @Integer <$ symbol "integer" + , someType @_ @ByteString <$ symbol "bytestring" + , someType @_ @Text <$ symbol "string" + , someType @_ @() <$ symbol "unit" + , someType @_ @Bool <$ symbol "bool" + , someType @_ @[] <$ symbol "list" + , someType @_ @(,) <$ symbol "pair" + , someType @_ @Data <$ symbol "data" + , someType @_ @BLS12_381.G1.Element <$ symbol "bls12_381_G1_element" + , someType @_ @BLS12_381.G2.Element <$ symbol "bls12_381_G2_element" + , someType @_ @BLS12_381.Pairing.MlResult <$ symbol "bls12_381_mlresult" ] tyName :: Parser TyName diff --git a/plutus-core/plutus-core/src/PlutusCore/Pretty/PrettyConst.hs b/plutus-core/plutus-core/src/PlutusCore/Pretty/PrettyConst.hs index 60d3105d38f..9e3b127a604 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Pretty/PrettyConst.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Pretty/PrettyConst.hs @@ -113,8 +113,6 @@ deriving via PrettyAny Integer instance NonDefaultPrettyBy ConstConfig Integer instance PrettyConst a => NonDefaultPrettyBy ConstConfig [a] instance (PrettyConst a, PrettyConst b) => NonDefaultPrettyBy ConstConfig (a, b) -instance PrettyBy ConstConfig BS.ByteString where - prettyBy _ b = "#" <> fold (asBytes <$> BS.unpack b) -- Special instance for bytestrings asBytes :: Word8 -> Doc ann @@ -124,6 +122,12 @@ asBytes x = Text 2 $ T.pack $ addLeadingZero $ showHex x mempty | x < 16 = ('0' :) | otherwise = id +toBytes :: BS.ByteString -> Doc ann +toBytes b = fold (asBytes <$> BS.unpack b) + +instance PrettyBy ConstConfig BS.ByteString where + prettyBy _ b = "#" <> toBytes b + instance PrettyBy ConstConfig Data where prettyBy c d = prettyBy c $ BSL.toStrict $ serialise d diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_add.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_add.plc.golden new file mode 100644 index 00000000000..75ed5ddeb82 --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_add.plc.golden @@ -0,0 +1,4 @@ +(fun + (con bls12_381_G1_element) + (fun (con bls12_381_G1_element) (con bls12_381_G1_element)) +) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_compress.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_compress.plc.golden new file mode 100644 index 00000000000..f3ec6262955 --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_compress.plc.golden @@ -0,0 +1 @@ +(fun (con bls12_381_G1_element) (con bytestring)) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_equal.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_equal.plc.golden new file mode 100644 index 00000000000..4cdd5f1f023 --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_equal.plc.golden @@ -0,0 +1 @@ +(fun (con bls12_381_G1_element) (fun (con bls12_381_G1_element) (con bool))) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_hashToGroup.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_hashToGroup.plc.golden new file mode 100644 index 00000000000..4d4f41435f3 --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_hashToGroup.plc.golden @@ -0,0 +1 @@ +(fun (con bytestring) (fun (con bytestring) (con bls12_381_G1_element))) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_neg.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_neg.plc.golden new file mode 100644 index 00000000000..2e8fc68ea6a --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_neg.plc.golden @@ -0,0 +1 @@ +(fun (con bls12_381_G1_element) (con bls12_381_G1_element)) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_scalarMul.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_scalarMul.plc.golden new file mode 100644 index 00000000000..de02cb7d99b --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_scalarMul.plc.golden @@ -0,0 +1 @@ +(fun (con integer) (fun (con bls12_381_G1_element) (con bls12_381_G1_element))) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_uncompress.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_uncompress.plc.golden new file mode 100644 index 00000000000..2d0c44c612c --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G1_uncompress.plc.golden @@ -0,0 +1 @@ +(fun (con bytestring) (con bls12_381_G1_element)) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_add.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_add.plc.golden new file mode 100644 index 00000000000..13b06daf64e --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_add.plc.golden @@ -0,0 +1,4 @@ +(fun + (con bls12_381_G2_element) + (fun (con bls12_381_G2_element) (con bls12_381_G2_element)) +) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_compress.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_compress.plc.golden new file mode 100644 index 00000000000..46e11f7a2e9 --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_compress.plc.golden @@ -0,0 +1 @@ +(fun (con bls12_381_G2_element) (con bytestring)) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_equal.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_equal.plc.golden new file mode 100644 index 00000000000..ba15b4e2685 --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_equal.plc.golden @@ -0,0 +1 @@ +(fun (con bls12_381_G2_element) (fun (con bls12_381_G2_element) (con bool))) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_hashToGroup.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_hashToGroup.plc.golden new file mode 100644 index 00000000000..9b8b740d851 --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_hashToGroup.plc.golden @@ -0,0 +1 @@ +(fun (con bytestring) (fun (con bytestring) (con bls12_381_G2_element))) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_neg.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_neg.plc.golden new file mode 100644 index 00000000000..a4fd2a35be0 --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_neg.plc.golden @@ -0,0 +1 @@ +(fun (con bls12_381_G2_element) (con bls12_381_G2_element)) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_scalarMul.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_scalarMul.plc.golden new file mode 100644 index 00000000000..6ea38c75e2b --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_scalarMul.plc.golden @@ -0,0 +1 @@ +(fun (con integer) (fun (con bls12_381_G2_element) (con bls12_381_G2_element))) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_uncompress.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_uncompress.plc.golden new file mode 100644 index 00000000000..1ead91b7c5e --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_G2_uncompress.plc.golden @@ -0,0 +1 @@ +(fun (con bytestring) (con bls12_381_G2_element)) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_finalVerify.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_finalVerify.plc.golden new file mode 100644 index 00000000000..778007979a3 --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_finalVerify.plc.golden @@ -0,0 +1 @@ +(fun (con bls12_381_mlresult) (fun (con bls12_381_mlresult) (con bool))) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_millerLoop.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_millerLoop.plc.golden new file mode 100644 index 00000000000..d0eb117fa87 --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_millerLoop.plc.golden @@ -0,0 +1,4 @@ +(fun + (con bls12_381_G1_element) + (fun (con bls12_381_G2_element) (con bls12_381_mlresult)) +) \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_mulMlResult.plc.golden b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_mulMlResult.plc.golden new file mode 100644 index 00000000000..adb450981db --- /dev/null +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Bls12_381_mulMlResult.plc.golden @@ -0,0 +1,4 @@ +(fun + (con bls12_381_mlresult) + (fun (con bls12_381_mlresult) (con bls12_381_mlresult)) +) \ No newline at end of file diff --git a/plutus-core/testlib/PlutusCore/Generators/Hedgehog/Builtin.hs b/plutus-core/testlib/PlutusCore/Generators/Hedgehog/Builtin.hs index a5c9377d7c5..5e85256ccbb 100644 --- a/plutus-core/testlib/PlutusCore/Generators/Hedgehog/Builtin.hs +++ b/plutus-core/testlib/PlutusCore/Generators/Hedgehog/Builtin.hs @@ -1,5 +1,6 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE LambdaCase #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeOperators #-} @@ -17,10 +18,16 @@ module PlutusCore.Generators.Hedgehog.Builtin ( genList, genMap, genConstr, + genBls12_381_G1_Element, + genBls12_381_G2_Element, + genBls12_381_MlResult ) where import PlutusCore hiding (Constr) import PlutusCore.Builtin +import PlutusCore.Crypto.BLS12_381.G1 qualified as BLS12_381.G1 +import PlutusCore.Crypto.BLS12_381.G2 qualified as BLS12_381.G2 +import PlutusCore.Crypto.BLS12_381.Pairing qualified as BLS12_381.Pairing import PlutusCore.Data (Data (..)) import PlutusCore.Generators.Hedgehog.AST hiding (genConstant) @@ -77,6 +84,12 @@ genConstant tr | Just HRefl <- eqTypeRep tr (typeRep @BS.ByteString) = SomeGen genByteString | Just HRefl <- eqTypeRep tr (typeRep @Text) = SomeGen genText | Just HRefl <- eqTypeRep tr (typeRep @Data) = SomeGen $ genData 5 + | Just HRefl <- eqTypeRep tr (typeRep @BLS12_381.G1.Element) = + SomeGen $ genBls12_381_G1_Element + | Just HRefl <- eqTypeRep tr (typeRep @BLS12_381.G2.Element) = + SomeGen $ genBls12_381_G2_Element + | Just HRefl <- eqTypeRep tr (typeRep @BLS12_381.Pairing.MlResult) = + SomeGen $ genBls12_381_MlResult | trPair `App` tr1 `App` tr2 <- tr , Just HRefl <- eqTypeRep trPair (typeRep @(,)) = case (genConstant tr1, genConstant tr2) of @@ -145,3 +158,23 @@ genConstr depth = <*> Gen.list (Range.linear 0 5) (genData (depth - 1)) + +genBls12_381_G1_Element :: Gen BLS12_381.G1.Element +genBls12_381_G1_Element = + BLS12_381.G1.hashToGroup <$> genByteString <*> pure BS.empty >>= \case + -- We should only get a failure if the second argument is greater than 255 bytes, which it isn't. + Left err -> fail $ show err -- This should never happen + Right p -> pure p + +genBls12_381_G2_Element :: Gen BLS12_381.G2.Element +genBls12_381_G2_Element = + BLS12_381.G2.hashToGroup <$> genByteString <*> pure BS.empty >>= \case + -- We should only get a failure if the second argument is greater than 255 bytes, which it isn't. + Left err -> fail $ show err + Right p -> pure p + +genBls12_381_MlResult :: Gen BLS12_381.Pairing.MlResult +genBls12_381_MlResult = do + p1 <- genBls12_381_G1_Element + p2 <- genBls12_381_G2_Element + pure $ BLS12_381.Pairing.millerLoop p1 p2 diff --git a/plutus-core/testlib/PlutusCore/Generators/QuickCheck/Builtin.hs b/plutus-core/testlib/PlutusCore/Generators/QuickCheck/Builtin.hs index 508407efa4d..c001c29e3a0 100644 --- a/plutus-core/testlib/PlutusCore/Generators/QuickCheck/Builtin.hs +++ b/plutus-core/testlib/PlutusCore/Generators/QuickCheck/Builtin.hs @@ -1,3 +1,4 @@ +-- editorconfig-checker-disable {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} @@ -11,10 +12,13 @@ module PlutusCore.Generators.QuickCheck.Builtin where import PlutusCore hiding (Constr) import PlutusCore.Builtin +import PlutusCore.Crypto.BLS12_381.G1 qualified as BLS12_381.G1 +import PlutusCore.Crypto.BLS12_381.G2 qualified as BLS12_381.G2 +import PlutusCore.Crypto.BLS12_381.Pairing qualified as BLS12_381.Pairing import PlutusCore.Data import PlutusCore.Generators.QuickCheck.Common (genList) -import Data.ByteString (ByteString) +import Data.ByteString (ByteString, empty) import Data.Coerce import Data.Int import Data.Kind qualified as GHC @@ -30,7 +34,6 @@ import Universe instance Arbitrary Data where arbitrary = sized genData - shrink = genericShrink genData :: Int -> Gen Data @@ -122,6 +125,35 @@ instance ArbitraryBuiltin ByteString where arbitraryBuiltin = Text.encodeUtf8 <$> arbitraryBuiltin shrinkBuiltin = map Text.encodeUtf8 . shrinkBuiltin . Text.decodeUtf8 +instance ArbitraryBuiltin BLS12_381.G1.Element where + arbitraryBuiltin = + BLS12_381.G1.hashToGroup <$> arbitrary <*> pure Data.ByteString.empty >>= \case + -- We should only get a failure if the second argument is greater than 255 bytes, which it isn't. + Left err -> error $ show err + Right p -> pure p + -- It's difficult to come up with a sensible shrinking function here given + -- that there's no sensible order on the elements of G1, let alone one + -- that's compatible with the group structure. We can't try shrinking the + -- x-coordinate of a known point for example because only about only about + -- 1/10^39 of the field elements are the x-coordinate of a point in G1, so + -- we're highly unlikely to find a suitable x value. + shrinkBuiltin _ = [] + +instance ArbitraryBuiltin BLS12_381.G2.Element where + arbitraryBuiltin = + BLS12_381.G2.hashToGroup <$> arbitrary <*> pure Data.ByteString.empty >>= \case + -- We should only get a failure if the second argument is greater than 255 bytes, which it isn't. + Left err -> error $ show err + Right p -> pure p + -- See the comment about shrinking for G1; G2 is even worse. + shrinkBuiltin _ = [] + +instance ArbitraryBuiltin BLS12_381.Pairing.MlResult where + arbitraryBuiltin = BLS12_381.Pairing.millerLoop <$> arbitraryBuiltin <*> arbitraryBuiltin + -- Shrinking here is even more difficult than for G1 and G2 since we don't + -- have direct access to elements of MlResult. + shrinkBuiltin _ = [] + -- | For providing an 'Arbitrary' instance deferring to 'ArbitraryBuiltin'. Useful for implementing -- 'ArbitraryBuiltin' for a polymorphic built-in type by taking the logic for handling spines from -- the 'Arbitrary' class and the logic for handling elements from 'ArbitraryBuiltin'. @@ -245,6 +277,9 @@ instance KnownKind k => Arbitrary (MaybeSomeTypeOf k) where , JustSomeType DefaultUniUnit , JustSomeType DefaultUniBool , JustSomeType DefaultUniData + , JustSomeType DefaultUniBLS12_381_G1_Element + , JustSomeType DefaultUniBLS12_381_G2_Element + , JustSomeType DefaultUniBLS12_381_MlResult ] SingType `SingKindArrow` SingType -> [genDefaultUniApply | size > 10] ++ diff --git a/plutus-core/testlib/PlutusIR/Generators/QuickCheck/ShrinkTerms.hs b/plutus-core/testlib/PlutusIR/Generators/QuickCheck/ShrinkTerms.hs index 46f54a61d17..1ed19404fee 100644 --- a/plutus-core/testlib/PlutusIR/Generators/QuickCheck/ShrinkTerms.hs +++ b/plutus-core/testlib/PlutusIR/Generators/QuickCheck/ShrinkTerms.hs @@ -18,6 +18,9 @@ import PlutusCore.Generators.QuickCheck.Substitutions import PlutusCore.Generators.QuickCheck.Utils import PlutusCore.Builtin +import PlutusCore.Crypto.BLS12_381.G1 qualified as BLS12_381.G1 (zero) +import PlutusCore.Crypto.BLS12_381.G2 qualified as BLS12_381.G2 (zero) +import PlutusCore.Crypto.BLS12_381.Pairing qualified as BLS12_381.Pairing (identityMlResult) import PlutusCore.Data import PlutusCore.Default import PlutusCore.MkPlc (mkConstantOf, mkTyBuiltin, mkTyBuiltinOf) @@ -122,6 +125,9 @@ minimalBuiltin (SomeTypeIn uni) = case toSingKind uni of go (DefaultUniProtoList `DefaultUniApply` _) = [] go (DefaultUniProtoPair `DefaultUniApply` a `DefaultUniApply` b) = (go a, go b) go (f `DefaultUniApply` _ `DefaultUniApply` _ `DefaultUniApply` _) = noMoreTypeFunctions f + go DefaultUniBLS12_381_G1_Element = BLS12_381.G1.zero + go DefaultUniBLS12_381_G2_Element = BLS12_381.G2.zero + go DefaultUniBLS12_381_MlResult = BLS12_381.Pairing.identityMlResult shrinkBind :: HasCallStack => Recursivity diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/Internal.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/Internal.hs index 88f73d60528..5041ec5e031 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/Internal.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/Internal.hs @@ -69,7 +69,6 @@ import PlutusPrelude import UntypedPlutusCore.Core - import Data.RandomAccessList.Class qualified as Env import Data.RandomAccessList.SkewBinary qualified as Env import PlutusCore.Builtin diff --git a/plutus-core/untyped-plutus-core/test/Evaluation/Builtins/BLS12_381.hs b/plutus-core/untyped-plutus-core/test/Evaluation/Builtins/BLS12_381.hs new file mode 100644 index 00000000000..6c74839dd2b --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Evaluation/Builtins/BLS12_381.hs @@ -0,0 +1,471 @@ +-- editorconfig-checker-disable +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TypeApplications #-} + +{- | Property tests for the BLS12-381 builtins -} +module Evaluation.Builtins.BLS12_381 +where + +import Evaluation.Builtins.BLS12_381.TestClasses +import Evaluation.Builtins.BLS12_381.Utils +import PlutusCore.Crypto.BLS12_381.G1 qualified as G1 +import PlutusCore.Crypto.BLS12_381.G2 qualified as G2 +import PlutusCore.Default +import UntypedPlutusCore qualified as UPLC + +import Cardano.Crypto.EllipticCurve.BLS12_381 (scalarPeriod) +import Control.Monad (replicateM) +import Data.ByteString as BS (empty, length, pack) +import Data.List as List (foldl', genericReplicate, length, nub) +import Text.Printf (printf) + +import Test.QuickCheck +import Test.Tasty +import Test.Tasty.QuickCheck + +-- QuickCheck utilities + +mkTestName :: forall g. TestableAbelianGroup g => String -> String +mkTestName s = printf "%s_%s" (groupName @g) s + +withNTests :: Testable prop => prop -> Property +withNTests = withMaxSuccess 200 + +-- QuickCheck generators for scalars and group elements as PLC terms + +arbitraryConstant :: forall g. TestableAbelianGroup g => Gen PlcTerm +arbitraryConstant = toTerm <$> (arbitrary @g) + +arbitraryScalar :: Gen PlcTerm +arbitraryScalar = integer <$> (arbitrary @Integer) + +-- Constructing pairing terms + +millerLoopTerm :: PlcTerm -> PlcTerm -> PlcTerm +millerLoopTerm = mkApp2 Bls12_381_millerLoop + +mulMlResultTerm :: PlcTerm -> PlcTerm -> PlcTerm +mulMlResultTerm = mkApp2 Bls12_381_mulMlResult + +finalVerifyTerm :: PlcTerm -> PlcTerm -> PlcTerm +finalVerifyTerm = mkApp2 Bls12_381_finalVerify + + +{- Generic tests for the TestableAbelianGroup class. Later these are instantiated + at the G1 and G2 types. -} + +---------------- G is an Abelian group ---------------- + +-- | Group addition is associative. +test_add_assoc :: forall g. TestableAbelianGroup g => TestTree +test_add_assoc = + testProperty + (mkTestName @g "add_assoc") . + withNTests $ do + p1 <- arbitraryConstant @g + p2 <- arbitraryConstant @g + p3 <- arbitraryConstant @g + let e = eqTerm @g (addTerm @g p1 (addTerm @g p2 p3)) (addTerm @g (addTerm @g p1 p2) p3) + pure $ evalTerm e === uplcTrue + +-- | Zero is an identity for addition. +test_add_zero :: forall g. TestableAbelianGroup g => TestTree +test_add_zero = + testProperty + (mkTestName @g "add_zero") . + withNTests $ do + p <- arbitraryConstant @g + let e = eqTerm @g (addTerm @g p $ zeroTerm @g) p + pure $ evalTerm e === uplcTrue + +-- | Every element has an inverse +-- | a+(-a) = 0 for all group elements. +test_neg :: forall g. TestableAbelianGroup g => TestTree +test_neg = + testProperty + (mkTestName @g "additive_inverse") . + withNTests $ do + p <- arbitraryConstant @g + let e = eqTerm @g (addTerm @g p (negTerm @g p)) $ zeroTerm @g + pure $ evalTerm e === uplcTrue + +-- | Group addition is commutative. +test_add_commutative :: forall g. TestableAbelianGroup g => TestTree +test_add_commutative= + testProperty + (mkTestName @g "add_commutative") . + withNTests $ do + p1 <- arbitraryConstant @g + p2 <- arbitraryConstant @g + let e = eqTerm @g (addTerm @g p1 p2) (addTerm @g p2 p1) + pure $ evalTerm e === uplcTrue + +test_is_an_abelian_group :: forall g. TestableAbelianGroup g => TestTree +test_is_an_abelian_group = + testGroup (mkTestName @g "is_an_abelian_group") + [ test_add_assoc @g + , test_add_zero @g + , test_neg @g + , test_add_commutative @g + ] + +---------------- Z acts on G correctly ---------------- + +-- | (ab)p = a(bp) for all scalars a and b and all group elements p. +test_scalarMul_assoc :: forall g. TestableAbelianGroup g => TestTree +test_scalarMul_assoc = + testProperty + (mkTestName @g "scalarMul_mul_assoc") . + withNTests $ do + m <- arbitraryScalar + n <- arbitraryScalar + p <- arbitraryConstant @g + let e1 = scalarMulTerm @g (mkApp2 MultiplyInteger m n) p + e2 = scalarMulTerm @g m (scalarMulTerm @g n p) + e3 = eqTerm @g e1 e2 + pure $ evalTerm e3 === uplcTrue + +-- | (a+b)p = ap +bp for all scalars a and b and all group elements p. +test_scalarMul_distributive_left :: forall g. TestableAbelianGroup g => TestTree +test_scalarMul_distributive_left = + testProperty + (mkTestName @g "scalarMul_distributive_left") . + withNTests $ do + m <- arbitraryScalar + n <- arbitraryScalar + p <- arbitraryConstant @g + let e1 = scalarMulTerm @g (mkApp2 AddInteger m n) p + e2 = addTerm @g (scalarMulTerm @g m p) (scalarMulTerm @g n p) + e3 = eqTerm @g e1 e2 + pure $ evalTerm e3 === uplcTrue + +-- | a(p+q) = ap + aq for all scalars a and all group elements p and q. +test_scalarMul_distributive_right :: forall g. TestableAbelianGroup g => TestTree +test_scalarMul_distributive_right = + testProperty + (mkTestName @g "scalarMul_distributive_right") . + withNTests $ do + n <- arbitraryScalar + p <- arbitraryConstant @g + q <- arbitraryConstant @g + let e1 = scalarMulTerm @g n (addTerm @g p q) + e2 = addTerm @g (scalarMulTerm @g n p) (scalarMulTerm @g n q) + e3 = eqTerm @g e1 e2 + pure $ evalTerm e3 === uplcTrue + +-- | 0p = 0 for all group elements p. +test_scalarMul_zero :: forall g. TestableAbelianGroup g => TestTree +test_scalarMul_zero = + testProperty + (mkTestName @g "scalarMul_zero") . + withNTests $ do + p <- arbitraryConstant @g + let e = eqTerm @g (scalarMulTerm @g (integer 0) p) $ zeroTerm @g + pure $ evalTerm e === uplcTrue + +-- | 1p = p for all group elements p. +test_scalarMul_one :: forall g. TestableAbelianGroup g => TestTree +test_scalarMul_one = + testProperty + (mkTestName @g "scalarMul_one") . + withNTests $ do + p <- arbitraryConstant @g + let e = eqTerm @g (scalarMulTerm @g (integer 1) p) p + pure $ evalTerm e === uplcTrue + +-- | (-1)p = -p for all group elements p. +test_scalarMul_inverse :: forall g. TestableAbelianGroup g => TestTree +test_scalarMul_inverse = + testProperty + (mkTestName @g "scalarMul_inverse") . + withNTests $ do + p <- arbitraryConstant @g + let e = eqTerm @g (scalarMulTerm @g (integer (-1)) p) (negTerm @g p) + pure $ evalTerm e == uplcTrue + +-- Check that scalar multiplication is repeated addition (including negative +-- scalars). We should really check this for scalars greater than the group +-- order, but that would be prohibitively slow because the order of G1 and G2 +-- has 256 bits (about 5*10^76). +test_scalarMul_repeated_addition :: forall g. TestableAbelianGroup g => TestTree +test_scalarMul_repeated_addition = + testProperty + (mkTestName @g "scalarMul_repeated_addition") . + withNTests $ do + n <- resize 100 arbitrary + p <- arbitraryConstant @g + let e1 = repeatedAdd n p + e2 = eqTerm @g (scalarMulTerm @g (integer n) p) e1 + pure $ evalTerm e2 === uplcTrue + where + repeatedAdd :: Integer -> PlcTerm -> PlcTerm + repeatedAdd n t = + if n>=0 + then foldl' (addTerm @g) (zeroTerm @g) $ genericReplicate n t + else repeatedAdd (-n) (negTerm @g t) + +-- (m + n|G|)p = mp for all group elements p and integers m and n. +-- We have |G1| = |G2| = scalarPeriod +test_scalarMul_periodic :: forall g. TestableAbelianGroup g => TestTree +test_scalarMul_periodic = + testProperty + (mkTestName @g "scalarMul_periodic") . + withNTests $ do + m <- arbitraryScalar + n <- arbitraryScalar + p <- arbitraryConstant @g + let e1 = scalarMulTerm @g m p + k = mkApp2 AddInteger m (mkApp2 MultiplyInteger n (integer scalarPeriod)) + e2 = scalarMulTerm @g k p -- k = m+n|G| + e = eqTerm @g e1 e2 + pure $ evalTerm e === uplcTrue + +test_Z_action_good :: forall g. TestableAbelianGroup g => TestTree +test_Z_action_good = + testGroup (printf "Z acts correctly on %s" $ groupName @g) + [ test_scalarMul_assoc @g + , test_scalarMul_distributive_left @g + , test_scalarMul_distributive_right @g + , test_scalarMul_zero @g + , test_scalarMul_one @g + , test_scalarMul_inverse @g + , test_scalarMul_repeated_addition @g + , test_scalarMul_periodic @g + ] + + +{- Generic tests for the HashAndCompress class. Later these are instantiated at + the G1 and G2 types. -} + +test_roundtrip_compression :: forall g. HashAndCompress g => TestTree +test_roundtrip_compression = + testProperty + (mkTestName @g "roundtrip_compression") . + withNTests $ do + p <- arbitraryConstant @g + let e = eqTerm @g (uncompressTerm @g (compressTerm @g p)) p + pure $ evalTerm e === uplcTrue + +-- | Uncompression should only accept inputs of the expected length, so we check +-- it on random inputs of the incorrect length. Inputs of the expected length +-- are excluded by the incorrectSize predicate; however even if an input did +-- have the expected length it would be very unlikely to deserialise to a point +-- in the group because the cofactors are very big (7.6*10^37 for G1 and +-- 3.1*10^152 for G2). +test_uncompression_wrong_size :: forall g. HashAndCompress g => TestTree +test_uncompression_wrong_size = + testProperty + (mkTestName @g "uncompression_wrong_size") . + withNTests $ do + b <- suchThat (resize 128 arbitrary) incorrectSize + let e = uncompressTerm @g (bytestring b) + pure $ evalTerm e === CekError + where incorrectSize s = BS.length s /= compressedSize @g + +-- | This tests the case we've omitted in the previous test, and should fail +-- with very high probablity. It's quite difficult to test this with random +-- inputs. We can improve our chances of getting a bytestring which encodes a +-- point on the curve by setting the compression bit and clearing the infinity +-- bit, but about 50% of the samples will still not be the x-coordinate of a +-- point on the curve. We can also generate points with an x-coordinate that's +-- bigger than the field size (especially for G2), which will give us a bad +-- encoding. Maybe this just isn't a very good test. +test_uncompress_out_of_group :: forall g. HashAndCompress g => TestTree +test_uncompress_out_of_group = + testProperty + (mkTestName @g "uncompress_out_of_group") . + withMaxSuccess 400 $ do + b <- suchThat (resize 128 arbitrary) correctSize + let b' = setBits compressionBit $ clearBits infinityBit b + let e = uncompressTerm @g (bytestring b') + pure $ evalTerm e === CekError + where correctSize s = BS.length s == compressedSize @g + +-- | Check that the most significant bit is set for all compressed points +test_compression_bit_set :: forall g. HashAndCompress g => TestTree +test_compression_bit_set = + testProperty + (mkTestName @g "compression_bit_set") . + withNTests $ do + p <- arbitraryConstant @g + case evalTerm (compressTerm @g p) of + CekSuccess (UPLC.Constant _ (Some (ValueOf DefaultUniByteString bs))) + -> pure $ isSet compressionBit bs + _ -> pure False + +-- | Check that bytestrings with the compression bit clear fail to uncompress. +test_clear_compression_bit :: forall g. HashAndCompress g => TestTree +test_clear_compression_bit = + testProperty + (mkTestName @g "clear_compression_bit") . + withNTests $ do + p <- arbitrary @g + let b = clearBits compressionBit $ compress @g p + e = uncompressTerm @g (bytestring b) + pure $ evalTerm e === CekError + +-- | Check that flipping the sign bit in a compressed point gives the inverse of +-- the point. +test_flip_sign_bit :: forall g. HashAndCompress g => TestTree +test_flip_sign_bit = + testProperty + (mkTestName @g "flip_sign_bit") . + withNTests $ do + p <- arbitrary @g + let b1 = compress @g p + b2 = flipBits signBit b1 + e1 = uncompressTerm @g (bytestring b1) + e2 = uncompressTerm @g (bytestring b2) + e = eqTerm @g e2 (negTerm @g e1) + pure $ evalTerm e === uplcTrue + +-- | Check that bytestrings with the infinity bit set fail to uncompress. +test_set_infinity_bit :: forall g. HashAndCompress g => TestTree +test_set_infinity_bit = + testProperty + (mkTestName @g "set_infinity_bit") . + withNTests $ do + p <- arbitrary @g + let b = setBits infinityBit $ compress @g p + e = uncompressTerm @g (bytestring b) + pure $ evalTerm e === CekError + + +-- We test for hash collisions by generating a list of `numHashCollisionTests` +-- bytestrings, discarding duplicates, hashing the remaining bytestrings, and +-- then checking that no two of the resulting group elements are equal. The time +-- taken by the tests increases quadratically with the number of bytestrings, +-- and is quite long even for numHashCollisionTests = 50. +numHashCollisionInputs :: Int +numHashCollisionInputs = 50 + +-- | Hashing into G1 or G2 should be collision-free. A failure here would +-- suggest an implementation error somewhere. Here we test multiple messages +-- but always use an empty Domain Separation Tag. +test_no_hash_collisions :: forall g. HashAndCompress g => TestTree +test_no_hash_collisions = + let emptyBS = bytestring BS.empty + in testProperty + (mkTestName @g "no_hash_collisions") $ do + msgs <- nub <$> replicateM numHashCollisionInputs arbitrary + let terms = fmap (\msg -> hashToGroupTerm @g (bytestring msg) emptyBS) msgs + hashed = fmap evalTerm terms + noErrors = conjoin $ fmap (=/= CekError) hashed -- Just in case + noDuplicates = List.length hashed === List.length (nub hashed) + pure $ noErrors .&. noDuplicates + +-- | Test that we get no collisions if we keep the message constant but vary the +-- DST. DSTs can be at most 255 bytes long in Plutus Core; there's a test +-- elsewhere that we get a failure for longer DSTs. This test could fail (but +-- not because of a hash collision) if we let it generate longer DSTs because +-- the final list could contain multiple occurrences of CekError. +test_no_hash_collisions_dst :: forall g. HashAndCompress g => TestTree +test_no_hash_collisions_dst = + let msg = bytestring $ pack [0x01, 0x02] + maxDstSize = 255 + in testProperty + (mkTestName @g "no_hash_collisions_dst") $ do + dsts <- nub <$> replicateM numHashCollisionInputs (resize maxDstSize arbitrary) + let terms = fmap (\dst -> hashToGroupTerm @g msg (bytestring dst)) dsts + hashed = fmap evalTerm terms + noErrors = conjoin $ fmap (=/= CekError) hashed + noDuplicates = List.length hashed === List.length (nub hashed) + pure $ noErrors .&. noDuplicates + +test_compress_hash :: forall g. HashAndCompress g => TestTree +test_compress_hash = + testGroup (printf "Uncompression and hashing behave properly for %s" $ groupName @g) + [ test_roundtrip_compression @g + , test_uncompression_wrong_size @g + , test_compression_bit_set @g + , test_clear_compression_bit @g + , test_flip_sign_bit @g + , test_set_infinity_bit @g + , test_uncompress_out_of_group @g + , test_no_hash_collisions @g + , test_no_hash_collisions_dst @g + ] + + +---------------- Pairing properties ---------------- + +-- = . +test_pairing_left_additive :: TestTree +test_pairing_left_additive = + testProperty + "pairing_left_additive" . + withNTests $ do + p1 <- arbitraryConstant @G1.Element + p2 <- arbitraryConstant @G1.Element + q <- arbitraryConstant @G2.Element + let e1 = millerLoopTerm (addTerm @G1.Element p1 p2) q + e2 = mulMlResultTerm (millerLoopTerm p1 q) (millerLoopTerm p2 q) + e3 = finalVerifyTerm e1 e2 + pure $ evalTerm e3 === uplcTrue + +-- = . +test_pairing_right_additive :: TestTree +test_pairing_right_additive = + testProperty + "pairing_right_additive" . + withNTests $ do + p <- arbitraryConstant @G1.Element + q1 <- arbitraryConstant @G2.Element + q2 <- arbitraryConstant @G2.Element + let e1 = millerLoopTerm p (addTerm @G2.Element q1 q2) + e2 = mulMlResultTerm (millerLoopTerm p q1) (millerLoopTerm p q2) + e3 = finalVerifyTerm e1 e2 + pure $ evalTerm e3 === uplcTrue + +-- <[n]p,q> = +test_pairing_balanced :: TestTree +test_pairing_balanced = + testProperty + "pairing_balanced" . + withNTests $ do + n <- arbitraryScalar + p <- arbitraryConstant @G1.Element + q <- arbitraryConstant @G2.Element + let e1 = millerLoopTerm (scalarMulTerm @G1.Element n p) q + e2 = millerLoopTerm p (scalarMulTerm @G2.Element n q) + e3 = finalVerifyTerm e1 e2 + pure $ evalTerm e3 === uplcTrue + +-- finalVerify returns False for random inputs +test_random_pairing :: TestTree +test_random_pairing = + testProperty + "pairing_random_unequal" . + withNTests $ do + p1 <- arbitraryConstant @G1.Element + p2 <- arbitraryConstant @G1.Element + q1 <- arbitraryConstant @G2.Element + q2 <- arbitraryConstant @G2.Element + pure $ p1 /= p2 && q1 /= q2 ==> + let e = finalVerifyTerm (millerLoopTerm p1 q1) (millerLoopTerm p2 q2) + in evalTerm e === uplcFalse + + +-- All of the tests + +test_BLS12_381 :: TestTree +test_BLS12_381 = testGroup "BLS12-381" [ + testGroup "G1 properties" + [ test_is_an_abelian_group @G1.Element + , test_Z_action_good @G1.Element + , test_compress_hash @G1.Element + ] + , testGroup "G2 properties" + [ test_is_an_abelian_group @G2.Element + , test_Z_action_good @G2.Element + , test_compress_hash @G2.Element + ] + , testGroup "Pairing properties" + [ test_pairing_left_additive + , test_pairing_right_additive + , test_pairing_balanced + , test_random_pairing + ] + ] diff --git a/plutus-core/untyped-plutus-core/test/Evaluation/Builtins/BLS12_381/TestClasses.hs b/plutus-core/untyped-plutus-core/test/Evaluation/Builtins/BLS12_381/TestClasses.hs new file mode 100644 index 00000000000..c36d590896b --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Evaluation/Builtins/BLS12_381/TestClasses.hs @@ -0,0 +1,101 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE LambdaCase #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} + +module Evaluation.Builtins.BLS12_381.TestClasses +where + +import Evaluation.Builtins.BLS12_381.Utils (PlcTerm, bytestring, mkApp1, mkApp2) + +import PlutusCore.Crypto.BLS12_381.G1 qualified as G1 +import PlutusCore.Crypto.BLS12_381.G2 qualified as G2 +import PlutusCore.Default +import PlutusCore.Generators.QuickCheck.Builtin (ArbitraryBuiltin) +import PlutusCore.MkPlc (mkConstant) + +import Data.ByteString as BS (ByteString, empty, pack) +import Test.QuickCheck (Arbitrary (..)) + +---------------- Typeclasses for groups ---------------- + +{- | The code for the property tests for G1 and G2 is essentially identical, so + it's worth abstracting over the common features. The blst Haskell FFI uses a + phantom type to do this but unfortunately we have to hide that to stop the + builtin machinery spotting it and then we have to re-abstract here. -} + +-- We could re-use the AbelianGroup class here, but that uses <> and `mempty` +-- and that's confusing. +class (Eq a, Show a, Arbitrary a, ArbitraryBuiltin a) => TestableAbelianGroup a + where + groupName :: String + zeroTerm :: PlcTerm + addTerm :: PlcTerm -> PlcTerm -> PlcTerm + negTerm :: PlcTerm -> PlcTerm + scalarMulTerm :: PlcTerm -> PlcTerm -> PlcTerm + eqTerm :: PlcTerm -> PlcTerm -> PlcTerm + toTerm :: a -> PlcTerm + +class TestableAbelianGroup a => HashAndCompress a + where + compressedSize :: Int + compress :: a -> ByteString + compressTerm :: PlcTerm -> PlcTerm + uncompressTerm :: PlcTerm -> PlcTerm + hashToGroupTerm :: PlcTerm -> PlcTerm -> PlcTerm + + +{- | Generate an arbitrary element of G1. It's tricky to construct such an + element directly without using quite low-level operations on the curve + because a random point on the curve is highly unlikely to be in the subgroup + G1, but fortunately `hashToGroup` always produces an element of the subgroup, + so we can produce random elements of G1 by hasing random bytestrings. -} +instance Arbitrary G1.Element + where + arbitrary = + G1.hashToGroup <$> arbitrary <*> pure BS.empty >>= \case + Left err -> error $ "Arbitrary instance for G1.Element:" ++ show err + Right p -> pure p + +instance TestableAbelianGroup G1.Element + where + groupName = "G1" + zeroTerm = mkApp1 Bls12_381_G1_uncompress $ bytestring $ pack (0xc0 : replicate 47 0x00) + addTerm = mkApp2 Bls12_381_G1_add + negTerm = mkApp1 Bls12_381_G1_neg + scalarMulTerm = mkApp2 Bls12_381_G1_scalarMul + eqTerm = mkApp2 Bls12_381_G1_equal + toTerm = mkConstant () + +instance HashAndCompress G1.Element + where + compressedSize = 48 + compress = G1.compress + compressTerm = mkApp1 Bls12_381_G1_compress + uncompressTerm = mkApp1 Bls12_381_G1_uncompress + hashToGroupTerm = mkApp2 Bls12_381_G1_hashToGroup + +-- | See the comment for the Arbitrary instance for G1. +instance Arbitrary G2.Element + where + arbitrary = + G2.hashToGroup <$> arbitrary <*> pure BS.empty >>= \case + Left err -> error $ "Arbitrary instance for G2.Element:" ++ show err + Right p -> pure p + +instance TestableAbelianGroup G2.Element + where + groupName = "G2" + zeroTerm = mkApp1 Bls12_381_G2_uncompress $ bytestring $ pack (0xc0 : replicate 95 0x00) + addTerm = mkApp2 Bls12_381_G2_add + negTerm = mkApp1 Bls12_381_G2_neg + scalarMulTerm = mkApp2 Bls12_381_G2_scalarMul + eqTerm = mkApp2 Bls12_381_G2_equal + toTerm = mkConstant () + +instance HashAndCompress G2.Element + where + compressedSize = 96 + compress = G2.compress + compressTerm = mkApp1 Bls12_381_G2_compress + uncompressTerm = mkApp1 Bls12_381_G2_uncompress + hashToGroupTerm = mkApp2 Bls12_381_G2_hashToGroup diff --git a/plutus-core/untyped-plutus-core/test/Evaluation/Builtins/BLS12_381/Utils.hs b/plutus-core/untyped-plutus-core/test/Evaluation/Builtins/BLS12_381/Utils.hs new file mode 100644 index 00000000000..8849bf2dfb6 --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Evaluation/Builtins/BLS12_381/Utils.hs @@ -0,0 +1,112 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE TypeApplications #-} + +module Evaluation.Builtins.BLS12_381.Utils +where + +import Evaluation.Builtins.Common + +import PlutusCore qualified as PLC +import PlutusCore.Default qualified as PLC +import PlutusCore.Evaluation.Machine.ExBudgetingDefaults (defaultBuiltinCostModel) +import PlutusCore.MkPlc (builtin, mkConstant, mkIterAppNoAnn) +import UntypedPlutusCore qualified as UPLC + +import Data.Bits (complement, xor, (.&.), (.|.)) +import Data.ByteString as BS (ByteString, cons, uncons) +import Data.Word (Word8) + +-- PLC utilities + +-- Evaluating PLC terms + +type PlcTerm = PLC.Term PLC.TyName PLC.Name PLC.DefaultUni PLC.DefaultFun () +type PlcError = PLC.Error PLC.DefaultUni PLC.DefaultFun () +type UplcTerm = UPLC.Term PLC.Name PLC.DefaultUni PLC.DefaultFun () + +data CekResult = + TypeCheckError PlcError + | CekError + | CekSuccess UplcTerm + deriving stock (Eq, Show) + +evalTerm :: PlcTerm -> CekResult +evalTerm term = + case typecheckEvaluateCekNoEmit PLC.DefaultFunV1 defaultBuiltinCostModel term + of Left e -> TypeCheckError e + Right x -> + case x of + PLC.EvaluationFailure -> CekError + PLC.EvaluationSuccess s -> CekSuccess s + +-- Constructing PLC constants and applications + +uplcTrue :: CekResult +uplcTrue = CekSuccess $ mkConstant () True + +uplcFalse :: CekResult +uplcFalse = CekSuccess $ mkConstant () False + +integer :: Integer -> PlcTerm +integer = mkConstant () + +bytestring :: ByteString -> PlcTerm +bytestring = mkConstant () + +mkApp1 :: PLC.DefaultFun -> PlcTerm -> PlcTerm +mkApp1 b x = mkIterAppNoAnn (builtin () b) [x] + +mkApp2 :: PLC.DefaultFun -> PlcTerm -> PlcTerm -> PlcTerm +mkApp2 b x y = mkIterAppNoAnn (builtin () b) [x,y] + +{- | ByteString utilities. These are used in tests to check that the format of + compressed points conforms to the specification at + https://github.com/supranational/blst#serialization-format . -} + +-- The most signiificant bit of a serialised curve point is set if the +-- serialised point is in compressed form (x-coordinate only) +compressionBit :: Word8 +compressionBit = 0x80 + +-- The second most significant bit is set if and only if the point is the point +-- at infinity (the zero of the group); if it is set, all other bits should be zero. +infinityBit :: Word8 +infinityBit = 0x40 + +-- The third most significant bit of a compressed point denotes the "sign" of +-- the y-coordinate of the associated point: it is set if and only if the point +-- is not the point at infinity and the y-coordinate is the lexicographically +-- larger one with the given x coordinate. +signBit :: Word8 +signBit = 0x20 + +unsafeUnconsBS :: ByteString -> (Word8, ByteString) +unsafeUnconsBS b = + case BS.uncons b of + Nothing -> error "Tried to uncons empty bytestring" + Just p -> p + +-- | Apply some function to the most significant byte of a bytestring +modifyMSB :: (Word8 -> Word8) -> ByteString -> ByteString +modifyMSB f s = + let (w,rest) = unsafeUnconsBS s + in BS.cons (f w) rest + +-- | Flip a specified set of bits in the most significant byte of a bytestring. +flipBits :: Word8 -> ByteString -> ByteString +flipBits mask = modifyMSB (mask `xor`) + +-- | Clear a specified set of bits in the most significant byte of a bytestring. +clearBits :: Word8 -> ByteString -> ByteString +clearBits mask = modifyMSB ((complement mask) .&.) + +-- | Set a specified set of bits in the most significant byte of a bytestring. +setBits :: Word8 -> ByteString -> ByteString +setBits mask = modifyMSB (mask .|.) + +-- | Check that a specified set of bits is set in the most significant byte of a +-- bytestring. +isSet :: Word8 -> ByteString -> Bool +isSet mask s = + let (w,_) = unsafeUnconsBS s + in w .&. mask == mask diff --git a/plutus-core/untyped-plutus-core/test/Evaluation/Builtins/Definition.hs b/plutus-core/untyped-plutus-core/test/Evaluation/Builtins/Definition.hs index e7922d3b561..628eda1e098 100644 --- a/plutus-core/untyped-plutus-core/test/Evaluation/Builtins/Definition.hs +++ b/plutus-core/untyped-plutus-core/test/Evaluation/Builtins/Definition.hs @@ -38,10 +38,12 @@ import PlutusCore.StdLib.Data.ScottList qualified as Scott import PlutusCore.StdLib.Data.ScottUnit qualified as Scott import PlutusCore.StdLib.Data.Unit +import Evaluation.Builtins.BLS12_381 (test_BLS12_381) import Evaluation.Builtins.Common import Evaluation.Builtins.SignatureVerification (ecdsaSecp256k1Prop, ed25519_V1Prop, ed25519_V2Prop, schnorrSecp256k1Prop) + import Control.Exception import Data.ByteString (ByteString) import Data.DList qualified as DList @@ -680,23 +682,35 @@ fails b args = @=? typecheckEvaluateCekNoEmit def defaultBuiltinCostModel actualExp --- Test that the SECP256k1 builtins are behaving correctly -- Test that the SECP256k1 builtins are behaving correctly test_SignatureVerification :: TestTree test_SignatureVerification = adjustOption (\x -> max x . HedgehogTestLimit . Just $ 8000) . testGroup "Signature verification" $ [ - testGroup "Ed25519 signatures (V1)" $ [ - testPropertyNamed "Ed25519_V1 verification behaves correctly on all inputs" "ed25519_V1_correct" . property $ ed25519_V1Prop - ], - testGroup "Ed25519 signatures (V2)" $ [ - testPropertyNamed "Ed25519_V2 verification behaves correctly on all inputs" "ed25519_V2_correct" . property $ ed25519_V2Prop - ], - testGroup "Signatures on the SECP256k1 curve" $ [ - testPropertyNamed "ECDSA verification behaves correctly on all inputs" "ecdsa_correct" . property $ ecdsaSecp256k1Prop, - testPropertyNamed "Schnorr verification behaves correctly on all inputs" "schnorr_correct" . property $ schnorrSecp256k1Prop - ] + testGroup "Ed25519 signatures (V1)" + [ testPropertyNamed + "Ed25519_V1 verification behaves correctly on all inputs" + "ed25519_V1_correct" . + property $ ed25519_V1Prop + ], + testGroup "Ed25519 signatures (V2)" + [ testPropertyNamed + "Ed25519_V2 verification behaves correctly on all inputs" + "ed25519_V2_correct" + . property $ ed25519_V2Prop + ], + testGroup "Signatures on the SECP256k1 curve" + [ testPropertyNamed + "ECDSA verification behaves correctly on all inputs" + "ecdsa_correct" + . property $ ecdsaSecp256k1Prop + , testPropertyNamed + "Schnorr verification behaves correctly on all inputs" + "schnorr_correct" + . property $ schnorrSecp256k1Prop + ] ] + test_definition :: TestTree test_definition = testGroup "definition" @@ -725,6 +739,7 @@ test_definition = , test_Data , test_Crypto , test_SignatureVerification + , test_BLS12_381 , test_Other , test_Version , test_ConsByteString diff --git a/plutus-ledger-api/changelog.d/20230323_202231_kwxm_prototype.md b/plutus-ledger-api/changelog.d/20230323_202231_kwxm_prototype.md new file mode 100644 index 00000000000..f35a9fc7d72 --- /dev/null +++ b/plutus-ledger-api/changelog.d/20230323_202231_kwxm_prototype.md @@ -0,0 +1,8 @@ +### Added + + - New entries for the BLS12-381 types and builtins + +### Changed + + - The new built-in functions have been added to futurePV + and the tests modified to deal with the additions. diff --git a/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs b/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs index 7e2183d31d4..bb7a48742fe 100644 --- a/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs +++ b/plutus-ledger-api/src/PlutusLedgerApi/Common/Versions.hs @@ -100,6 +100,15 @@ builtinsIntroducedIn = Map.fromList [ ]), ((PlutusV2, valentinePV), Set.fromList [ VerifyEcdsaSecp256k1Signature, VerifySchnorrSecp256k1Signature + ]), + ((PlutusV3, futurePV), Set.fromList [ + Bls12_381_G1_add, Bls12_381_G1_neg, Bls12_381_G1_scalarMul, + Bls12_381_G1_equal, Bls12_381_G1_hashToGroup, + Bls12_381_G1_compress, Bls12_381_G1_uncompress, + Bls12_381_G2_add, Bls12_381_G2_neg, Bls12_381_G2_scalarMul, + Bls12_381_G2_equal, Bls12_381_G2_hashToGroup, + Bls12_381_G2_compress, Bls12_381_G2_uncompress, + Bls12_381_millerLoop, Bls12_381_mulMlResult, Bls12_381_finalVerify ]) ] diff --git a/plutus-ledger-api/src/PlutusLedgerApi/V3/ParamName.hs b/plutus-ledger-api/src/PlutusLedgerApi/V3/ParamName.hs index 3b6d7745475..23523a02532 100644 --- a/plutus-ledger-api/src/PlutusLedgerApi/V3/ParamName.hs +++ b/plutus-ledger-api/src/PlutusLedgerApi/V3/ParamName.hs @@ -194,5 +194,43 @@ data ParamName = | CekConstrCost'exBudgetMemory | CekCaseCost'exBudgetCPU | CekCaseCost'exBudgetMemory + | Bls12_381_G1_add'cpu'arguments + | Bls12_381_G1_add'memory'arguments + | Bls12_381_G1_compress'cpu'arguments + | Bls12_381_G1_compress'memory'arguments + | Bls12_381_G1_equal'cpu'arguments + | Bls12_381_G1_equal'memory'arguments + | Bls12_381_G1_hashToGroup'cpu'arguments'intercept + | Bls12_381_G1_hashToGroup'cpu'arguments'slope + | Bls12_381_G1_hashToGroup'memory'arguments + | Bls12_381_G1_neg'cpu'arguments + | Bls12_381_G1_neg'memory'arguments + | Bls12_381_G1_scalarMul'cpu'arguments'intercept + | Bls12_381_G1_scalarMul'cpu'arguments'slope + | Bls12_381_G1_scalarMul'memory'arguments + | Bls12_381_G1_uncompress'cpu'arguments + | Bls12_381_G1_uncompress'memory'arguments + | Bls12_381_G2_add'cpu'arguments + | Bls12_381_G2_add'memory'arguments + | Bls12_381_G2_compress'cpu'arguments + | Bls12_381_G2_compress'memory'arguments + | Bls12_381_G2_equal'cpu'arguments + | Bls12_381_G2_equal'memory'arguments + | Bls12_381_G2_hashToGroup'cpu'arguments'intercept + | Bls12_381_G2_hashToGroup'cpu'arguments'slope + | Bls12_381_G2_hashToGroup'memory'arguments + | Bls12_381_G2_neg'cpu'arguments + | Bls12_381_G2_neg'memory'arguments + | Bls12_381_G2_scalarMul'cpu'arguments'intercept + | Bls12_381_G2_scalarMul'cpu'arguments'slope + | Bls12_381_G2_scalarMul'memory'arguments + | Bls12_381_G2_uncompress'cpu'arguments + | Bls12_381_G2_uncompress'memory'arguments + | Bls12_381_finalVerify'cpu'arguments + | Bls12_381_finalVerify'memory'arguments + | Bls12_381_millerLoop'cpu'arguments + | Bls12_381_millerLoop'memory'arguments + | Bls12_381_mulMlResult'cpu'arguments + | Bls12_381_mulMlResult'memory'arguments deriving stock (Eq, Ord, Enum, Ix, Bounded, Generic) deriving IsParamName via (GenericParamName ParamName) diff --git a/plutus-ledger-api/test/Spec/CostModelParams.hs b/plutus-ledger-api/test/Spec/CostModelParams.hs index c5e186a39d5..4b7dcee515c 100644 --- a/plutus-ledger-api/test/Spec/CostModelParams.hs +++ b/plutus-ledger-api/test/Spec/CostModelParams.hs @@ -30,8 +30,8 @@ tests = 166 @=? length v1CostModelParamNames 175 @=? length (enumerate @V2.ParamName) 175 @=? length v2CostModelParamNames - 179 @=? length (enumerate @V3.ParamName) - 179 @=? length v3CostModelParamNames + 217 @=? length (enumerate @V3.ParamName) + 217 @=? length v3CostModelParamNames , testCase "context length" $ do let defaultCostValues = Map.elems $ fromJust defaultCostModelParams -- the defaultcostmodelparams reflects only the latest version V3, so this should succeed because the lengths match @@ -44,7 +44,6 @@ tests = , testCase "cost model parameters" $ do -- v1 is missing some cost model parameters because new builtins are added in v2 assertBool "v1 params is proper subset of v2 params" $ Set.fromList v1CostModelParamNames `Set.isProperSubsetOf` Set.fromList v2CostModelParamNames - -- v2 is missing some cost model parameters because new builtins and term constructors are added in v3 assertBool "v2 params is proper subset of v3 params" $ Set.fromList v2CostModelParamNames `Set.isProperSubsetOf` Set.fromList v3CostModelParamNames ] where diff --git a/plutus-metatheory/changelog.d/20230221_161618_mjaskelioff_abstract_signatures.rst b/plutus-metatheory/changelog.d/20230221_161618_mjaskelioff_abstract_signatures.rst deleted file mode 100644 index 6749b261f65..00000000000 --- a/plutus-metatheory/changelog.d/20230221_161618_mjaskelioff_abstract_signatures.rst +++ /dev/null @@ -1,32 +0,0 @@ -.. A new scriv changelog fragment. -..: -.. Uncomment the header that is right (remove the leading dots). -.. -.. Removed -.. ------- -.. -.. - A bullet item for the Removed category. -.. -# Added - -Implemented abstract signatures. - -# Changed - -Changed type of mkCons builtin to match implementation. -.. -.. Deprecated -.. ---------- -.. -.. - A bullet item for the Deprecated category. -.. -.. Fixed -.. ----- -.. -.. - A bullet item for the Fixed category. -.. -.. Security -.. -------- -.. -.. - A bullet item for the Security category. -.. diff --git a/plutus-metatheory/plutus-metatheory.cabal b/plutus-metatheory/plutus-metatheory.cabal index 2b3e85670fa..d85e9ff1981 100644 --- a/plutus-metatheory/plutus-metatheory.cabal +++ b/plutus-metatheory/plutus-metatheory.cabal @@ -54,6 +54,7 @@ library build-depends: , base , bytestring + , composition-prelude , cryptonite , extra , ieee754 diff --git a/plutus-metatheory/src/Algorithmic/CEK.lagda.md b/plutus-metatheory/src/Algorithmic/CEK.lagda.md index 913302d3a7c..9e371e5d290 100644 --- a/plutus-metatheory/src/Algorithmic/CEK.lagda.md +++ b/plutus-metatheory/src/Algorithmic/CEK.lagda.md @@ -34,7 +34,7 @@ open import Builtin open import Utils open import Builtin.Constant.AtomicType -open import Builtin.Constant.Type Ctx⋆ (_⊢Nf⋆ *) using (TyCon;integer;bool;bytestring;string;pdata) +open import Builtin.Constant.Type Ctx⋆ (_⊢Nf⋆ *) using (TyCon;integer;bool;bytestring;string;pdata;bls12-381-g1-element;bls12-381-g2-element) open TyCon @@ -265,6 +265,31 @@ BUILTIN headList {A} bapp = inj₁ A --unimplemented BUILTIN tailList {A} bapp = inj₁ A --unimplemented BUILTIN nullList {A} (app (app⋆ base refl refl) (V-con cn)) = inj₁ A --unimplemented BUILTIN chooseData {A} bapp = inj₁ A --unimplemented +BUILTIN bls12-381-G1-add (app (app base (V-con (tmBls12-381-g1-element e))) (V-con (tmBls12-381-g1-element e'))) = inj₂ (V-con (tmBls12-381-g1-element (BLS12-381-G1-add e e'))) +BUILTIN bls12-381-G1-neg (app base (V-con (tmBls12-381-g1-element e))) = inj₂ (V-con (tmBls12-381-g1-element (BLS12-381-G1-neg e))) +BUILTIN bls12-381-G1-scalarMul (app (app base (V-con (tmInteger i))) (V-con (tmBls12-381-g1-element e))) = inj₂ (V-con (tmBls12-381-g1-element (BLS12-381-G1-scalarMul i e))) +BUILTIN bls12-381-G1-equal (app (app base (V-con (tmBls12-381-g1-element e))) (V-con (tmBls12-381-g1-element e'))) = inj₂ (V-con (tmBool (BLS12-381-G1-equal e e'))) +BUILTIN bls12-381-G1-hashToGroup (app (app base (V-con (tmBytestring msg))) (V-con (tmBytestring dst))) with BLS12-381-G1-hashToGroup msg dst +... | nothing = inj₁ (con bls12-381-g1-element) +... | just p = inj₂ (V-con (tmBls12-381-g1-element p)) +BUILTIN bls12-381-G1-compress (app base (V-con (tmBls12-381-g1-element e))) = inj₂ (V-con (tmBytestring (BLS12-381-G1-compress e))) +BUILTIN bls12-381-G1-uncompress (app base (V-con (tmBytestring b))) with BLS12-381-G1-uncompress b +... | nothing = inj₁ (con bls12-381-g1-element) +... | just e = inj₂ (V-con (tmBls12-381-g1-element e)) +BUILTIN bls12-381-G2-add (app (app base (V-con (tmBls12-381-g2-element e))) (V-con (tmBls12-381-g2-element e'))) = inj₂ (V-con (tmBls12-381-g2-element (BLS12-381-G2-add e e'))) +BUILTIN bls12-381-G2-neg (app base (V-con (tmBls12-381-g2-element e))) = inj₂ (V-con (tmBls12-381-g2-element (BLS12-381-G2-neg e))) +BUILTIN bls12-381-G2-scalarMul (app (app base (V-con (tmInteger i))) (V-con (tmBls12-381-g2-element e))) = inj₂ (V-con (tmBls12-381-g2-element (BLS12-381-G2-scalarMul i e))) +BUILTIN bls12-381-G2-equal (app (app base (V-con (tmBls12-381-g2-element e))) (V-con (tmBls12-381-g2-element e'))) = inj₂ (V-con (tmBool (BLS12-381-G2-equal e e'))) +BUILTIN bls12-381-G2-hashToGroup (app (app base (V-con (tmBytestring msg))) (V-con (tmBytestring dst))) with BLS12-381-G2-hashToGroup msg dst +... | nothing = inj₁ (con bls12-381-g2-element) +... | just p = inj₂ (V-con (tmBls12-381-g2-element p)) +BUILTIN bls12-381-G2-compress (app base (V-con (tmBls12-381-g2-element e))) = inj₂ (V-con (tmBytestring (BLS12-381-G2-compress e))) +BUILTIN bls12-381-G2-uncompress (app base (V-con (tmBytestring b))) with BLS12-381-G2-uncompress b +... | nothing = inj₁ (con bls12-381-g2-element) +... | just e = inj₂ (V-con (tmBls12-381-g2-element e)) +BUILTIN bls12-381-millerLoop (app (app base (V-con (tmBls12-381-g1-element e1))) (V-con (tmBls12-381-g2-element e2))) = inj₂ (V-con (tmBls12-381-mlresult (BLS12-381-millerLoop e1 e2))) +BUILTIN bls12-381-mulMlResult (app (app base (V-con (tmBls12-381-mlresult r))) (V-con (tmBls12-381-mlresult r'))) = inj₂ (V-con (tmBls12-381-mlresult (BLS12-381-mulMlResult r r'))) +BUILTIN bls12-381-finalVerify (app (app base (V-con (tmBls12-381-mlresult r))) (V-con (tmBls12-381-mlresult r'))) = inj₂ (V-con (tmBool (BLS12-381-finalVerify r r'))) BUILTIN' : ∀ b {A} → ∀{tn} → {pt : tn ∔ 0 ≣ fv♯ (signature b)} diff --git a/plutus-metatheory/src/Algorithmic/Completeness.lagda b/plutus-metatheory/src/Algorithmic/Completeness.lagda index 23913b6a52b..7d63373b576 100644 --- a/plutus-metatheory/src/Algorithmic/Completeness.lagda +++ b/plutus-metatheory/src/Algorithmic/Completeness.lagda @@ -74,12 +74,15 @@ lem[] A B = trans nfTypeTC : ∀{φ}{A : φ ⊢⋆ *} → STermCon.TermCon A → NTermCon.TermCon (nf A) -nfTypeTC (STermCon.tmInteger i) = NTermCon.tmInteger i -nfTypeTC (STermCon.tmBytestring b) = NTermCon.tmBytestring b -nfTypeTC (STermCon.tmString s) = NTermCon.tmString s -nfTypeTC (STermCon.tmBool b) = NTermCon.tmBool b -nfTypeTC STermCon.tmUnit = NTermCon.tmUnit -nfTypeTC (STermCon.tmData d) = NTermCon.tmData d +nfTypeTC (STermCon.tmInteger i) = NTermCon.tmInteger i +nfTypeTC (STermCon.tmBytestring b) = NTermCon.tmBytestring b +nfTypeTC (STermCon.tmString s) = NTermCon.tmString s +nfTypeTC (STermCon.tmBool b) = NTermCon.tmBool b +nfTypeTC STermCon.tmUnit = NTermCon.tmUnit +nfTypeTC (STermCon.tmData d) = NTermCon.tmData d +nfTypeTC (STermCon.tmBls12-381-g1-element e) = NTermCon.tmBls12-381-g1-element e +nfTypeTC (STermCon.tmBls12-381-g2-element e) = NTermCon.tmBls12-381-g2-element e +nfTypeTC (STermCon.tmBls12-381-mlresult r) = NTermCon.tmBls12-381-mlresult r lemσ : ∀{Γ Δ Δ'} → (σ : Sub Δ Γ) diff --git a/plutus-metatheory/src/Algorithmic/Erasure.lagda b/plutus-metatheory/src/Algorithmic/Erasure.lagda index 23e63d57f67..459beada77e 100644 --- a/plutus-metatheory/src/Algorithmic/Erasure.lagda +++ b/plutus-metatheory/src/Algorithmic/Erasure.lagda @@ -67,12 +67,15 @@ eraseVar (S α) = just (eraseVar α) eraseVar (T α) = eraseVar α eraseTC : ∀{Φ}{Γ : Ctx Φ}{A : Φ ⊢Nf⋆ *} → AC.TyTermCon A → TmCon -eraseTC (AC.tmInteger i) = tmCon (con integer) i -eraseTC (AC.tmBytestring b) = tmCon (con bytestring) b -eraseTC (AC.tmString s) = tmCon (con string) s -eraseTC (AC.tmBool b) = tmCon (con bool) b -eraseTC AC.tmUnit = tmCon (con unit) tt -eraseTC (AC.tmData d) = tmCon (con pdata) d +eraseTC (AC.tmInteger i) = tmCon (con integer) i +eraseTC (AC.tmBytestring b) = tmCon (con bytestring) b +eraseTC (AC.tmString s) = tmCon (con string) s +eraseTC (AC.tmBool b) = tmCon (con bool) b +eraseTC AC.tmUnit = tmCon (con unit) tt +eraseTC (AC.tmData d) = tmCon (con pdata) d +eraseTC (AC.tmBls12-381-g1-element e) = tmCon (con bls12-381-g1-element) e +eraseTC (AC.tmBls12-381-g2-element e) = tmCon (con bls12-381-g2-element) e +eraseTC (AC.tmBls12-381-mlresult r) = tmCon (con bls12-381-mlresult) r erase : ∀{Φ Γ}{A : Φ ⊢Nf⋆ *} → Γ ⊢ A → len Γ ⊢ erase (` α) = ` (eraseVar α) @@ -125,6 +128,9 @@ sameTC (DC.tmString s) = refl sameTC (DC.tmBool b) = refl sameTC DC.tmUnit = refl sameTC (DC.tmData d) = refl +sameTC (DC.tmBls12-381-g1-element e) = refl +sameTC (DC.tmBls12-381-g2-element e) = refl +sameTC (DC.tmBls12-381-mlresult r) = refl -- map D.eraseTC xs ≡ map (eraseTC ∘ nfTypeTC) xs @@ -249,12 +255,15 @@ same'Var {Γ = Γ ,⋆ _} (T {A = A} x) = trans same'TC : ∀{Φ Γ}{A : Φ ⊢Nf⋆ *}(tcn : AC.TyTermCon A) → eraseTC {Γ = Γ} tcn ≡ D.eraseTC {Φ}{Γ = embCtx Γ} (embTC tcn) -same'TC (AC.tmInteger i) = refl -same'TC (AC.tmBytestring b) = refl -same'TC (AC.tmString s) = refl -same'TC (AC.tmBool b) = refl -same'TC AC.tmUnit = refl -same'TC (AC.tmData d) = refl +same'TC (AC.tmInteger i) = refl +same'TC (AC.tmBytestring b) = refl +same'TC (AC.tmString s) = refl +same'TC (AC.tmBool b) = refl +same'TC AC.tmUnit = refl +same'TC (AC.tmData d) = refl +same'TC (AC.tmBls12-381-g1-element e) = refl +same'TC (AC.tmBls12-381-g2-element e) = refl +same'TC (AC.tmBls12-381-mlresult r) = refl same' : ∀{Φ Γ}{A : Φ ⊢Nf⋆ *}(x : Γ A.⊢ A) → erase x ≡ subst _⊢ (same'Len Γ) (D.erase (emb x)) diff --git a/plutus-metatheory/src/Algorithmic/Erasure/RenamingSubstitution.lagda b/plutus-metatheory/src/Algorithmic/Erasure/RenamingSubstitution.lagda index 36d73b0943a..c235fe4a0a5 100644 --- a/plutus-metatheory/src/Algorithmic/Erasure/RenamingSubstitution.lagda +++ b/plutus-metatheory/src/Algorithmic/Erasure/RenamingSubstitution.lagda @@ -1,4 +1,4 @@ -\begin{code} +sre\begin{code} {-# OPTIONS --rewriting #-} module Algorithmic.Erasure.RenamingSubstitution where @@ -114,12 +114,15 @@ conv⊢-erase refl t = refl renTermCon-erase : ∀{Φ Ψ}{Γ : Ctx Φ}{Δ : Ctx Ψ}(ρ⋆ : ⋆.Ren Φ Ψ) → (ρ : A.Ren ρ⋆ Γ Δ) → ∀{A}(c : AB.TermCon A) → eraseTC {Γ = Δ} (A.renTermCon ρ⋆ c) ≡ eraseTC {Γ = Γ} c -renTermCon-erase ρ⋆ ρ (AB.tmInteger i) = refl -renTermCon-erase ρ⋆ ρ (AB.tmBytestring b) = refl -renTermCon-erase ρ⋆ ρ (AB.tmString s) = refl -renTermCon-erase ρ⋆ ρ (AB.tmBool b) = refl -renTermCon-erase ρ⋆ ρ AB.tmUnit = refl -renTermCon-erase ρ⋆ ρ (AB.tmData d) = refl +renTermCon-erase ρ⋆ ρ (AB.tmInteger i) = refl +renTermCon-erase ρ⋆ ρ (AB.tmBytestring b) = refl +renTermCon-erase ρ⋆ ρ (AB.tmString s) = refl +renTermCon-erase ρ⋆ ρ (AB.tmBool b) = refl +renTermCon-erase ρ⋆ ρ AB.tmUnit = refl +renTermCon-erase ρ⋆ ρ (AB.tmData d) = refl +renTermCon-erase ρ⋆ ρ (AB.tmBls12-381-g1-element e) = refl +renTermCon-erase ρ⋆ ρ (AB.tmBls12-381-g2-element e) = refl +renTermCon-erase ρ⋆ ρ (AB.tmBls12-381-mlresult e) = refl ext⋆-erase : ∀{Φ Ψ K}{Γ : Ctx Φ}{Δ : Ctx Ψ}(ρ⋆ : ⋆.Ren Φ Ψ) → (ρ : A.Ren ρ⋆ Γ Δ)(α : len Γ) @@ -213,6 +216,9 @@ subTermCon-erase σ⋆ σ (AB.tmString s) = refl subTermCon-erase σ⋆ σ (AB.tmBool b) = refl subTermCon-erase σ⋆ σ AB.tmUnit = refl subTermCon-erase σ⋆ σ (AB.tmData d) = refl +subTermCon-erase σ⋆ σ (AB.tmBls12-381-g1-element e) = refl +subTermCon-erase σ⋆ σ (AB.tmBls12-381-g2-element e) = refl +subTermCon-erase σ⋆ σ (AB.tmBls12-381-mlresult e) = refl sub-erase : ∀{Φ Ψ}{Γ : Ctx Φ}{Δ : Ctx Ψ}(σ⋆ : SubNf Φ Ψ) → (σ : A.Sub σ⋆ Γ Δ){A : Φ ⊢Nf⋆ *} → (t : Γ ⊢ A) diff --git a/plutus-metatheory/src/Algorithmic/ReductionEC.lagda.md b/plutus-metatheory/src/Algorithmic/ReductionEC.lagda.md index 6c60ee874f3..eba79015598 100644 --- a/plutus-metatheory/src/Algorithmic/ReductionEC.lagda.md +++ b/plutus-metatheory/src/Algorithmic/ReductionEC.lagda.md @@ -307,5 +307,3 @@ ival : ∀ b → Value (builtin b / refl) ival b = V-I b base -- -} ``` - - \ No newline at end of file diff --git a/plutus-metatheory/src/Algorithmic/RenamingSubstitution.lagda b/plutus-metatheory/src/Algorithmic/RenamingSubstitution.lagda index c28e15587fe..f78be8ea7d0 100644 --- a/plutus-metatheory/src/Algorithmic/RenamingSubstitution.lagda +++ b/plutus-metatheory/src/Algorithmic/RenamingSubstitution.lagda @@ -63,12 +63,15 @@ renTermCon : ∀ {Φ Ψ} → (ρ⋆ : ⋆.Ren Φ Ψ) ----------------------------------------------------- → ({A : Φ ⊢Nf⋆ *} → TermCon A → TermCon (renNf ρ⋆ A )) -renTermCon ρ⋆ (tmInteger i) = tmInteger i -renTermCon ρ⋆ (tmBytestring b) = tmBytestring b -renTermCon ρ⋆ (tmString s) = tmString s -renTermCon ρ⋆ (tmBool b) = tmBool b -renTermCon ρ⋆ tmUnit = tmUnit -renTermCon ρ⋆ (tmData d) = tmData d +renTermCon ρ⋆ (tmInteger i) = tmInteger i +renTermCon ρ⋆ (tmBytestring b) = tmBytestring b +renTermCon ρ⋆ (tmString s) = tmString s +renTermCon ρ⋆ (tmBool b) = tmBool b +renTermCon ρ⋆ tmUnit = tmUnit +renTermCon ρ⋆ (tmData d) = tmData d +renTermCon ρ⋆ (tmBls12-381-g1-element e) = tmBls12-381-g1-element e +renTermCon ρ⋆ (tmBls12-381-g2-element e) = tmBls12-381-g2-element e +renTermCon ρ⋆ (tmBls12-381-mlresult r) = tmBls12-381-mlresult r \end{code} \begin{code} @@ -151,12 +154,15 @@ subTermCon : ∀ {Φ Ψ} → (σ⋆ : SubNf Φ Ψ) ------------------------------------------------------ → ({A : Φ ⊢Nf⋆ *} → TermCon A → TermCon (subNf σ⋆ A )) -subTermCon σ⋆ (tmInteger i) = tmInteger i -subTermCon σ⋆ (tmBytestring b) = tmBytestring b -subTermCon σ⋆ (tmString s) = tmString s -subTermCon σ⋆ (tmBool b) = tmBool b -subTermCon σ⋆ tmUnit = tmUnit -subTermCon σ⋆ (tmData d) = tmData d +subTermCon σ⋆ (tmInteger i) = tmInteger i +subTermCon σ⋆ (tmBytestring b) = tmBytestring b +subTermCon σ⋆ (tmString s) = tmString s +subTermCon σ⋆ (tmBool b) = tmBool b +subTermCon σ⋆ tmUnit = tmUnit +subTermCon σ⋆ (tmData d) = tmData d +subTermCon σ⋆ (tmBls12-381-g1-element e) = tmBls12-381-g1-element e +subTermCon σ⋆ (tmBls12-381-g2-element e) = tmBls12-381-g2-element e +subTermCon σ⋆ (tmBls12-381-mlresult r) = tmBls12-381-mlresult r \end{code} \begin{code} diff --git a/plutus-metatheory/src/Algorithmic/Soundness.lagda b/plutus-metatheory/src/Algorithmic/Soundness.lagda index 25c4d6312ea..39dbaa90a09 100644 --- a/plutus-metatheory/src/Algorithmic/Soundness.lagda +++ b/plutus-metatheory/src/Algorithmic/Soundness.lagda @@ -81,13 +81,15 @@ soundness-μ p A B = trans≡β embTC : ∀{φ}{A : φ ⊢Nf⋆ *} → NTermCon.TermCon A → STermCon.TermCon (embNf A) -embTC (NTermCon.tmInteger i) = STermCon.tmInteger i -embTC (NTermCon.tmBytestring b) = STermCon.tmBytestring b -embTC (NTermCon.tmString s) = STermCon.tmString s -embTC (NTermCon.tmBool b) = STermCon.tmBool b -embTC NTermCon.tmUnit = STermCon.tmUnit -embTC (NTermCon.tmData d) = STermCon.tmData d - +embTC (NTermCon.tmInteger i) = STermCon.tmInteger i +embTC (NTermCon.tmBytestring b) = STermCon.tmBytestring b +embTC (NTermCon.tmString s) = STermCon.tmString s +embTC (NTermCon.tmBool b) = STermCon.tmBool b +embTC NTermCon.tmUnit = STermCon.tmUnit +embTC (NTermCon.tmData d) = STermCon.tmData d +embTC (NTermCon.tmBls12-381-g1-element e) = STermCon.tmBls12-381-g1-element e +embTC (NTermCon.tmBls12-381-g2-element e) = STermCon.tmBls12-381-g2-element e +embTC (NTermCon.tmBls12-381-mlresult r) = STermCon.tmBls12-381-mlresult r \end{code} \begin{code} diff --git a/plutus-metatheory/src/Builtin.lagda.md b/plutus-metatheory/src/Builtin.lagda.md index f1436d32392..671acc50e63 100644 --- a/plutus-metatheory/src/Builtin.lagda.md +++ b/plutus-metatheory/src/Builtin.lagda.md @@ -22,7 +22,7 @@ open import Relation.Binary using (DecidableEquality) open import Data.Bool using (Bool) open import Agda.Builtin.Int using (Int) open import Agda.Builtin.String using (String) -open import Utils using (ByteString;Maybe;DATA) +open import Utils using (ByteString;Maybe;DATA;Bls12-381-G1-Element;Bls12-381-G2-Element;Bls12-381-MlResult) import Utils as U open import Builtin.Signature using (Sig;sig;_⊢♯;con;`;Args) import Builtin.Constant.Type ℕ (_⊢♯) as T @@ -67,7 +67,7 @@ data Builtin : Set where appendString : Builtin equalsString : Builtin encodeUtf8 : Builtin - decodeUtf8 : Builtin + decodeUtf8 : Builtin -- Bool ifThenElse : Builtin -- Unit @@ -101,6 +101,28 @@ data Builtin : Set where mkPairData : Builtin mkNilData : Builtin mkNilPairData : Builtin + -- BLS12_381 + -- G1 + bls12-381-G1-add : Builtin + bls12-381-G1-neg : Builtin + bls12-381-G1-scalarMul : Builtin + bls12-381-G1-equal : Builtin + bls12-381-G1-hashToGroup : Builtin + bls12-381-G1-compress : Builtin + bls12-381-G1-uncompress : Builtin + -- G2 + bls12-381-G2-add : Builtin + bls12-381-G2-neg : Builtin + bls12-381-G2-scalarMul : Builtin + bls12-381-G2-equal : Builtin + bls12-381-G2-hashToGroup : Builtin + bls12-381-G2-compress : Builtin + bls12-381-G2-uncompress : Builtin + -- Pairing + bls12-381-millerLoop : Builtin + bls12-381-mulMlResult : Builtin + bls12-381-finalVerify : Builtin + ``` ## Signatures @@ -122,13 +144,16 @@ This is defined in its own module so that these definitions are not exported. ∀b,a = 2 -- shortened names for type constants and type constructors - integer bool bytestring string unit pdata : ∀{n} → n ⊢♯ + integer bool bytestring string unit pdata bls12-381-g1-element bls12-381-g2-element bls12-381-mlresult : ∀{n} → n ⊢♯ integer = con T.integer bool = con T.bool bytestring = con T.bytestring string = con T.string unit = con T.unit pdata = con T.pdata + bls12-381-g1-element = con T.bls12-381-g1-element + bls12-381-g2-element = con T.bls12-381-g2-element + bls12-381-mlresult = con T.bls12-381-mlresult pair : ∀{n} → n ⊢♯ → n ⊢♯ → n ⊢♯ pair x y = con (T.pair x y) @@ -189,7 +214,7 @@ This is defined in its own module so that these definitions are not exported. signature lessThanEqualsInteger = ∙ [ integer , integer ]⟶ bool signature appendByteString = ∙ [ bytestring , bytestring ]⟶ bytestring signature consByteString = ∙ [ integer , bytestring ]⟶ bytestring - signature sliceByteString = ∙ [ integer , integer , bytestring ]⟶ bytestring + signature sliceByteString = ∙ [ integer , integer , bytestring ]⟶ bytestring signature lengthOfByteString = ∙ [ bytestring ]⟶ integer signature indexByteString = ∙ [ bytestring , integer ]⟶ integer signature equalsByteString = ∙ [ bytestring , bytestring ]⟶ bool @@ -204,7 +229,7 @@ This is defined in its own module so that these definitions are not exported. signature appendString = ∙ [ string , string ]⟶ string signature equalsString = ∙ [ string , string ]⟶ bool signature encodeUtf8 = ∙ [ string ]⟶ bytestring - signature decodeUtf8 = ∙ [ bytestring ]⟶ string + signature decodeUtf8 = ∙ [ bytestring ]⟶ string signature ifThenElse = ∀a [ bool , a , a ]⟶ a signature chooseUnit = ∀a [ a , unit ]⟶ a signature trace = ∀a [ string , a ]⟶ a @@ -231,6 +256,23 @@ This is defined in its own module so that these definitions are not exported. signature mkPairData = ∙ [ pdata , pdata ]⟶ pair pdata pdata signature mkNilData = ∙ [ unit ]⟶ list pdata signature mkNilPairData = ∙ [ unit ]⟶ list (pair pdata pdata) + signature bls12-381-G1-add = ∙ [ bls12-381-g1-element , bls12-381-g1-element ]⟶ bls12-381-g1-element + signature bls12-381-G1-neg = ∙ [ bls12-381-g1-element ]⟶ bls12-381-g1-element + signature bls12-381-G1-scalarMul = ∙ [ integer , bls12-381-g1-element ]⟶ bls12-381-g1-element + signature bls12-381-G1-equal = ∙ [ bls12-381-g1-element , bls12-381-g1-element ]⟶ bool + signature bls12-381-G1-hashToGroup = ∙ [ bytestring , bytestring ]⟶ bls12-381-g1-element + signature bls12-381-G1-compress = ∙ [ bls12-381-g1-element ]⟶ bytestring + signature bls12-381-G1-uncompress = ∙ [ bytestring ]⟶ bls12-381-g1-element + signature bls12-381-G2-add = ∙ [ bls12-381-g2-element , bls12-381-g2-element ]⟶ bls12-381-g2-element + signature bls12-381-G2-neg = ∙ [ bls12-381-g2-element ]⟶ bls12-381-g2-element + signature bls12-381-G2-scalarMul = ∙ [ integer , bls12-381-g2-element ]⟶ bls12-381-g2-element + signature bls12-381-G2-equal = ∙ [ bls12-381-g2-element , bls12-381-g2-element ]⟶ bool + signature bls12-381-G2-hashToGroup = ∙ [ bytestring , bytestring ]⟶ bls12-381-g2-element + signature bls12-381-G2-compress = ∙ [ bls12-381-g2-element ]⟶ bytestring + signature bls12-381-G2-uncompress = ∙ [ bytestring ]⟶ bls12-381-g2-element + signature bls12-381-millerLoop = ∙ [ bls12-381-g1-element , bls12-381-g2-element ]⟶ bls12-381-mlresult + signature bls12-381-mulMlResult = ∙ [ bls12-381-mlresult , bls12-381-mlresult ]⟶ bls12-381-mlresult + signature bls12-381-finalVerify = ∙ [ bls12-381-mlresult , bls12-381-mlresult ]⟶ bool open SugaredSignature using (signature) public ``` @@ -295,13 +337,30 @@ Each Agda built-in name must be mapped to a Haskell name. | MkPairData | MkNilData | MkNilPairData + | Bls12_381_G1_add + | Bls12_381_G1_neg + | Bls12_381_G1_scalarMul + | Bls12_381_G1_equal + | Bls12_381_G1_hashToGroup + | Bls12_381_G1_compress + | Bls12_381_G1_uncompress + | Bls12_381_G2_add + | Bls12_381_G2_neg + | Bls12_381_G2_scalarMul + | Bls12_381_G2_equal + | Bls12_381_G2_hashToGroup + | Bls12_381_G2_compress + | Bls12_381_G2_uncompress + | Bls12_381_millerLoop + | Bls12_381_mulMlResult + | Bls12_381_finalVerify ) #-} ``` ### Abstract semantics of builtins -We need to postulate the Agda type of built-in functions -whose semantics are provided by a Haskell funciton. +We need to postulate the Agda type of built-in functions +whose semantics are provided by a Haskell function. ``` postulate @@ -314,34 +373,52 @@ postulate TRACE : {a : Set} → String → a → a - concat : ByteString → ByteString → ByteString - cons : Int → ByteString → Maybe ByteString - slice : Int → Int → ByteString → ByteString - B< : ByteString -> ByteString -> Bool - B<= : ByteString -> ByteString -> Bool - SHA2-256 : ByteString → ByteString - SHA3-256 : ByteString → ByteString + concat : ByteString → ByteString → ByteString + cons : Int → ByteString → Maybe ByteString + slice : Int → Int → ByteString → ByteString + B< : ByteString → ByteString → Bool + B<= : ByteString → ByteString → Bool + SHA2-256 : ByteString → ByteString + SHA3-256 : ByteString → ByteString BLAKE2B-256 : ByteString → ByteString verifyEd25519Sig : ByteString → ByteString → ByteString → Maybe Bool verifyEcdsaSecp256k1Sig : ByteString → ByteString → ByteString → Maybe Bool verifySchnorrSecp256k1Sig : ByteString → ByteString → ByteString → Maybe Bool - equals : ByteString → ByteString → Bool - ENCODEUTF8 : String → ByteString - DECODEUTF8 : ByteString → Maybe String + equals : ByteString → ByteString → Bool + ENCODEUTF8 : String → ByteString + DECODEUTF8 : ByteString → Maybe String serialiseDATA : DATA → ByteString + BLS12-381-G1-add : Bls12-381-G1-Element → Bls12-381-G1-Element → Bls12-381-G1-Element + BLS12-381-G1-neg : Bls12-381-G1-Element → Bls12-381-G1-Element + BLS12-381-G1-scalarMul : Int → Bls12-381-G1-Element → Bls12-381-G1-Element + BLS12-381-G1-equal : Bls12-381-G1-Element → Bls12-381-G1-Element → Bool + BLS12-381-G1-hashToGroup : ByteString → ByteString → Maybe Bls12-381-G1-Element + BLS12-381-G1-compress : Bls12-381-G1-Element → ByteString + BLS12-381-G1-uncompress : ByteString → Maybe Bls12-381-G1-Element -- FIXME: this really returns Either BLSTError Element + BLS12-381-G2-add : Bls12-381-G2-Element → Bls12-381-G2-Element → Bls12-381-G2-Element + BLS12-381-G2-neg : Bls12-381-G2-Element → Bls12-381-G2-Element + BLS12-381-G2-scalarMul : Int → Bls12-381-G2-Element → Bls12-381-G2-Element + BLS12-381-G2-equal : Bls12-381-G2-Element → Bls12-381-G2-Element → Bool + BLS12-381-G2-hashToGroup : ByteString → ByteString → Maybe Bls12-381-G2-Element + BLS12-381-G2-compress : Bls12-381-G2-Element → ByteString + BLS12-381-G2-uncompress : ByteString → Maybe Bls12-381-G2-Element -- FIXME: this really returns Either BLSTError Element + BLS12-381-millerLoop : Bls12-381-G1-Element → Bls12-381-G2-Element → Bls12-381-MlResult + BLS12-381-mulMlResult : Bls12-381-MlResult → Bls12-381-MlResult → Bls12-381-MlResult + BLS12-381-finalVerify : Bls12-381-MlResult → Bls12-381-MlResult → Bool ``` ### What builtin operations should be compiled to if we compile to Haskell ``` {-# FOREIGN GHC {-# LANGUAGE TypeApplications #-} #-} +{-# FOREIGN GHC import Control.Composition ((.*)) #-} {-# FOREIGN GHC import qualified Data.ByteString as BS #-} {-# FOREIGN GHC import qualified Data.ByteArray as B #-} {-# FOREIGN GHC import Debug.Trace (trace) #-} {-# FOREIGN GHC import Data.ByteString.Hash as Hash #-} {-# FOREIGN GHC import Data.Text.Encoding #-} {-# FOREIGN GHC import qualified Data.Text as Text #-} -{-# FOREIGN GHC import Data.Either.Extra #-} +{-# FOREIGN GHC import Data.Either.Extra (eitherToMaybe) #-} {-# FOREIGN GHC import Data.Word (Word8) #-} {-# FOREIGN GHC import Data.Bits (toIntegralSized) #-} {-# COMPILE GHC length = toInteger . BS.length #-} @@ -374,7 +451,8 @@ postulate {-# COMPILE GHC cons = \n xs -> fmap (\w8 -> BS.cons w8 xs) (toIntegralSized n) #-} {-# COMPILE GHC slice = \start n xs -> BS.take (fromIntegral n) (BS.drop (fromIntegral start) xs) #-} {-# COMPILE GHC index = \xs n -> fromIntegral (BS.index xs (fromIntegral n)) #-} -{-# FOREIGN GHC import Crypto #-} +{-# FOREIGN GHC import PlutusCore.Crypto.Ed25519 #-} +{-# FOREIGN GHC import PlutusCore.Crypto.Secp256k1 #-} -- The Vasil verification functions return results wrapped in Emitters, which -- may perform a side-effect such as writing some text to a log. The code below @@ -393,6 +471,28 @@ postulate {-# COMPILE GHC ENCODEUTF8 = encodeUtf8 #-} {-# COMPILE GHC DECODEUTF8 = eitherToMaybe . decodeUtf8' #-} +{-# FOREIGN GHC import PlutusCore.Crypto.BLS12_381.G1 qualified as G1 #-} +{-# COMPILE GHC BLS12-381-G1-add = G1.add #-} +{-# COMPILE GHC BLS12-381-G1-neg = G1.neg #-} +{-# COMPILE GHC BLS12-381-G1-scalarMul = G1.scalarMul #-} +{-# COMPILE GHC BLS12-381-G1-equal = (==) #-} +{-# COMPILE GHC BLS12-381-G1-hashToGroup = eitherToMaybe .* G1.hashToGroup #-} +{-# COMPILE GHC BLS12-381-G1-compress = G1.compress #-} +{-# COMPILE GHC BLS12-381-G1-uncompress = eitherToMaybe . G1.uncompress #-} +{-# FOREIGN GHC import PlutusCore.Crypto.BLS12_381.G2 qualified as G2 #-} +{-# COMPILE GHC BLS12-381-G2-add = G2.add #-} +{-# COMPILE GHC BLS12-381-G2-neg = G2.neg #-} +{-# COMPILE GHC BLS12-381-G2-scalarMul = G2.scalarMul #-} +{-# COMPILE GHC BLS12-381-G2-equal = (==) #-} +{-# COMPILE GHC BLS12-381-G2-hashToGroup = eitherToMaybe .* G2.hashToGroup #-} +{-# COMPILE GHC BLS12-381-G2-compress = G2.compress #-} +{-# COMPILE GHC BLS12-381-G2-uncompress = eitherToMaybe . G2.uncompress #-} +{-# FOREIGN GHC import PlutusCore.Crypto.BLS12_381.Pairing qualified as Pairing #-} +{-# COMPILE GHC BLS12-381-millerLoop = Pairing.millerLoop #-} +{-# COMPILE GHC BLS12-381-mulMlResult = Pairing.mulMlResult #-} +{-# COMPILE GHC BLS12-381-finalVerify = Pairing.finalVerify #-} + + -- no binding needed for appendStr -- no binding needed for traceStr ``` @@ -405,4 +505,3 @@ comparing expected with actual results. decBuiltin : DecidableEquality Builtin unquoteDef decBuiltin = defDec (quote Builtin) decBuiltin ``` - \ No newline at end of file diff --git a/plutus-metatheory/src/Builtin/Constant/AtomicType.lagda.md b/plutus-metatheory/src/Builtin/Constant/AtomicType.lagda.md index 1bc7a71f1c9..89687e39691 100644 --- a/plutus-metatheory/src/Builtin/Constant/AtomicType.lagda.md +++ b/plutus-metatheory/src/Builtin/Constant/AtomicType.lagda.md @@ -12,19 +12,22 @@ open import Utils.Reflection using (defDec) # Atomic Type constants -We have six base types referred to as atomic type constants: +We have nine base types referred to as atomic type constants: ``` data AtomicTyCon : Set where - aInteger : AtomicTyCon - aBytestring : AtomicTyCon - aString : AtomicTyCon - aUnit : AtomicTyCon - aBool : AtomicTyCon - aData : AtomicTyCon + aInteger : AtomicTyCon + aBytestring : AtomicTyCon + aString : AtomicTyCon + aUnit : AtomicTyCon + aBool : AtomicTyCon + aData : AtomicTyCon + aBls12-381-g1-element : AtomicTyCon + aBls12-381-g2-element : AtomicTyCon + aBls12-381-mlresult : AtomicTyCon {-# FOREIGN GHC import Raw #-} -{-# COMPILE GHC AtomicTyCon = data AtomicTyCon (ATyConInt | ATyConBS | ATyConStr | ATyConUnit | ATyConBool | ATyConData) #-} +{-# COMPILE GHC AtomicTyCon = data AtomicTyCon (ATyConInt | ATyConBS | ATyConStr | ATyConUnit | ATyConBool | ATyConData | ATyConBLS12_381_G1_Element | ATyConBLS12_381_G2_Element | ATyConBLS12_381_MlResult) #-} ``` diff --git a/plutus-metatheory/src/Builtin/Constant/Term.lagda.md b/plutus-metatheory/src/Builtin/Constant/Term.lagda.md index feb90369ce9..b3a1f0c2b50 100644 --- a/plutus-metatheory/src/Builtin/Constant/Term.lagda.md +++ b/plutus-metatheory/src/Builtin/Constant/Term.lagda.md @@ -37,7 +37,10 @@ data TermCon {Φ} : Φ ⊢⋆ * → Set where tmBool : (b : Bool) → TermCon (con bool) - tmUnit : TermCon (con unit) + tmUnit : TermCon (con unit) tmData : U.DATA → TermCon (con pdata) + tmBls12-381-g1-element : U.Bls12-381-G1-Element → TermCon (con bls12-381-g1-element) + tmBls12-381-g2-element : U.Bls12-381-G2-Element → TermCon (con bls12-381-g2-element) + tmBls12-381-mlresult : U.Bls12-381-MlResult → TermCon (con bls12-381-mlresult) ``` \ No newline at end of file diff --git a/plutus-metatheory/src/Builtin/Constant/Type.lagda.md b/plutus-metatheory/src/Builtin/Constant/Type.lagda.md index efcefc8531d..98bbe22fcde 100644 --- a/plutus-metatheory/src/Builtin/Constant/Type.lagda.md +++ b/plutus-metatheory/src/Builtin/Constant/Type.lagda.md @@ -34,5 +34,7 @@ pattern string = atomic aString pattern unit = atomic aUnit pattern bool = atomic aBool pattern pdata = atomic aData +pattern bls12-381-g1-element = atomic aBls12-381-g1-element +pattern bls12-381-g2-element = atomic aBls12-381-g2-element +pattern bls12-381-mlresult = atomic aBls12-381-mlresult ``` - diff --git a/plutus-metatheory/src/Check.lagda.md b/plutus-metatheory/src/Check.lagda.md index 1dbacd6f732..0ea9ab5d949 100644 --- a/plutus-metatheory/src/Check.lagda.md +++ b/plutus-metatheory/src/Check.lagda.md @@ -287,14 +287,17 @@ inv-complete {A = A}{A' = A'} p = trans≡β (trans≡β (≡2β (sym (cong embNf p))) (sym≡β (soundness A))) inferTypeCon : ∀{Φ} → TmCon → Either TypeError (Σ (T.TyCon _) λ c → A.TermCon {Φ} (con c)) -inferTypeCon (tmCon (con integer) i) = return (T.integer ,, A.tmInteger i) -inferTypeCon (tmCon (con bytestring) b) = return (T.bytestring ,, A.tmBytestring b) -inferTypeCon (tmCon (con string) s) = return (T.string ,, A.tmString s) -inferTypeCon (tmCon (con bool) b) = return (T.bool ,, A.tmBool b) -inferTypeCon (tmCon (con unit) _) = return (T.unit ,, A.tmUnit) -inferTypeCon (tmCon (con pdata) d) = return (T.pdata ,, A.tmData d) -inferTypeCon (tmCon (con (pair _ _)) (x , y)) = inj₁ (Unimplemented "Typed pairs") -inferTypeCon (tmCon (con (list _)) xs) = inj₁ (Unimplemented "Typed lists") +inferTypeCon (tmCon (con integer) i) = return (T.integer ,, A.tmInteger i) +inferTypeCon (tmCon (con bytestring) b) = return (T.bytestring ,, A.tmBytestring b) +inferTypeCon (tmCon (con string) s) = return (T.string ,, A.tmString s) +inferTypeCon (tmCon (con bool) b) = return (T.bool ,, A.tmBool b) +inferTypeCon (tmCon (con unit) _) = return (T.unit ,, A.tmUnit) +inferTypeCon (tmCon (con pdata) d) = return (T.pdata ,, A.tmData d) +inferTypeCon (tmCon (con (pair _ _)) (x , y)) = inj₁ (Unimplemented "Typed pairs") +inferTypeCon (tmCon (con (list _)) xs) = inj₁ (Unimplemented "Typed lists") +inferTypeCon (tmCon (con bls12-381-g1-element) e) = return (T.bls12-381-g1-element ,, A.tmBls12-381-g1-element e) +inferTypeCon (tmCon (con bls12-381-g2-element) e) = return (T.bls12-381-g2-element ,, A.tmBls12-381-g2-element e) +inferTypeCon (tmCon (con bls12-381-mlresult) r) = return (T.bls12-381-mlresult ,, A.tmBls12-381-mlresult r) checkType : ∀{Φ}(Γ : Ctx Φ) → ScopedTm (len Γ) → (A : Φ ⊢Nf⋆ *) → Either TypeError (Γ ⊢ A) @@ -341,4 +344,3 @@ inferType Γ (unwrap L) = do K ,, A ,, B ,, L ← isMu (inferType Γ L) return (nf (embNf A · ƛ (μ (embNf (weakenNf A)) (` Z)) · embNf B) ,, unwrap L refl) ``` - \ No newline at end of file diff --git a/plutus-metatheory/src/Declarative/Erasure.lagda.md b/plutus-metatheory/src/Declarative/Erasure.lagda.md index af1b56922a1..59e1da39032 100644 --- a/plutus-metatheory/src/Declarative/Erasure.lagda.md +++ b/plutus-metatheory/src/Declarative/Erasure.lagda.md @@ -57,12 +57,15 @@ eraseVar (S α) = just (eraseVar α) eraseVar (T α) = eraseVar α eraseTC : ∀{Φ}{Γ : Ctx Φ}{A : Φ ⊢⋆ *} → TyTermCon A → TmCon -eraseTC (tmInteger i) = tmCon (con integer) i -eraseTC (tmBytestring b) = tmCon (con bytestring) b -eraseTC (tmString s) = tmCon (con string) s -eraseTC (tmBool b) = tmCon (con bool) b -eraseTC tmUnit = tmCon (con unit) tt -eraseTC (tmData d) = tmCon (con pdata) d +eraseTC (tmInteger i) = tmCon (con integer) i +eraseTC (tmBytestring b) = tmCon (con bytestring) b +eraseTC (tmString s) = tmCon (con string) s +eraseTC (tmBool b) = tmCon (con bool) b +eraseTC tmUnit = tmCon (con unit) tt +eraseTC (tmData d) = tmCon (con pdata) d +eraseTC (tmBls12-381-g1-element e) = tmCon (con bls12-381-g1-element) e +eraseTC (tmBls12-381-g2-element e) = tmCon (con bls12-381-g2-element) e +eraseTC (tmBls12-381-mlresult r) = tmCon (con bls12-381-mlresult) r erase : ∀{Φ Γ}{A : Φ ⊢⋆ *} → Γ ⊢ A → len Γ ⊢ diff --git a/plutus-metatheory/src/Declarative/RenamingSubstitution.lagda.md b/plutus-metatheory/src/Declarative/RenamingSubstitution.lagda.md index 0818f119d27..5595a413374 100644 --- a/plutus-metatheory/src/Declarative/RenamingSubstitution.lagda.md +++ b/plutus-metatheory/src/Declarative/RenamingSubstitution.lagda.md @@ -76,12 +76,15 @@ Renaming a term constant renTermCon : (ρ⋆ : ⋆.Ren Φ Ψ) ------------------------------------------ → (∀{A} → TermCon A → TermCon (⋆.ren ρ⋆ A )) -renTermCon _ (tmInteger i) = tmInteger i -renTermCon _ (tmBytestring b) = tmBytestring b -renTermCon _ (tmString s) = tmString s -renTermCon _ (tmBool b) = tmBool b -renTermCon _ tmUnit = tmUnit -renTermCon _ (tmData d) = tmData d +renTermCon _ (tmInteger i) = tmInteger i +renTermCon _ (tmBytestring b) = tmBytestring b +renTermCon _ (tmString s) = tmString s +renTermCon _ (tmBool b) = tmBool b +renTermCon _ tmUnit = tmUnit +renTermCon _ (tmData d) = tmData d +renTermCon _ (tmBls12-381-g1-element e) = tmBls12-381-g1-element e +renTermCon _ (tmBls12-381-g2-element e) = tmBls12-381-g2-element e +renTermCon _ (tmBls12-381-mlresult r) = tmBls12-381-mlresult r ``` Renaming for terms @@ -174,6 +177,9 @@ subTermCon _ (tmString s) = tmString s subTermCon _ (tmBool b) = tmBool b subTermCon _ tmUnit = tmUnit subTermCon _ (tmData d) = tmData d +subTermCon _ (tmBls12-381-g1-element e) = tmBls12-381-g1-element e +subTermCon _ (tmBls12-381-g2-element e) = tmBls12-381-g2-element e +subTermCon _ (tmBls12-381-mlresult r) = tmBls12-381-mlresult r ``` Substitution for terms diff --git a/plutus-metatheory/src/Raw.hs b/plutus-metatheory/src/Raw.hs index ed968fbaaa9..48affe45d49 100644 --- a/plutus-metatheory/src/Raw.hs +++ b/plutus-metatheory/src/Raw.hs @@ -34,6 +34,9 @@ data AtomicTyCon = ATyConInt | ATyConUnit | ATyConBool | ATyConData + | ATyConBLS12_381_G1_Element + | ATyConBLS12_381_G2_Element + | ATyConBLS12_381_MlResult deriving Show data RTyCon = RTyConAtom AtomicTyCon @@ -70,17 +73,20 @@ convT (TyBuiltin _ b) = RTyCon (convTyCon b) convT (TyIFix _ a b) = RTyMu (convT a) (convT b) convTyCon :: SomeTypeIn DefaultUni -> RTyCon -convTyCon (SomeTypeIn DefaultUniInteger) = RTyConAtom ATyConInt -convTyCon (SomeTypeIn DefaultUniByteString) = RTyConAtom ATyConBS -convTyCon (SomeTypeIn DefaultUniString) = RTyConAtom ATyConStr -convTyCon (SomeTypeIn DefaultUniBool) = RTyConAtom ATyConBool -convTyCon (SomeTypeIn DefaultUniUnit) = RTyConAtom ATyConUnit -convTyCon (SomeTypeIn DefaultUniData) = RTyConAtom ATyConData -convTyCon (SomeTypeIn (DefaultUniApply DefaultUniProtoList a)) = RTyConList (RTyCon (convTyCon (SomeTypeIn a))) +convTyCon (SomeTypeIn DefaultUniInteger) = RTyConAtom ATyConInt +convTyCon (SomeTypeIn DefaultUniByteString) = RTyConAtom ATyConBS +convTyCon (SomeTypeIn DefaultUniString) = RTyConAtom ATyConStr +convTyCon (SomeTypeIn DefaultUniBool) = RTyConAtom ATyConBool +convTyCon (SomeTypeIn DefaultUniUnit) = RTyConAtom ATyConUnit +convTyCon (SomeTypeIn DefaultUniData) = RTyConAtom ATyConData +convTyCon (SomeTypeIn (DefaultUniApply DefaultUniProtoList a)) = RTyConList (RTyCon (convTyCon (SomeTypeIn a))) convTyCon (SomeTypeIn (DefaultUniApply (DefaultUniApply DefaultUniProtoPair a) b)) = RTyConPair (RTyCon (convTyCon (SomeTypeIn a))) (RTyCon (convTyCon (SomeTypeIn b))) -convTyCon (SomeTypeIn (DefaultUniApply _ _)) = error "unsupported builtin type application" -convTyCon (SomeTypeIn DefaultUniProtoList) = error "unsupported usage of builtin list type" -convTyCon (SomeTypeIn DefaultUniProtoPair) = error "unsupported usage of builtin pair type" +convTyCon (SomeTypeIn (DefaultUniApply _ _)) = error "unsupported builtin type application" +convTyCon (SomeTypeIn DefaultUniProtoList) = error "unsupported usage of builtin list type" +convTyCon (SomeTypeIn DefaultUniProtoPair) = error "unsupported usage of builtin pair type" +convTyCon (SomeTypeIn DefaultUniBLS12_381_G1_Element) = RTyConAtom ATyConBLS12_381_G1_Element +convTyCon (SomeTypeIn DefaultUniBLS12_381_G2_Element) = RTyConAtom ATyConBLS12_381_G2_Element +convTyCon (SomeTypeIn DefaultUniBLS12_381_MlResult) = RTyConAtom ATyConBLS12_381_MlResult conv :: Term NamedTyDeBruijn NamedDeBruijn DefaultUni DefaultFun a -> RTerm conv (Var _ x) = RVar (unIndex (ndbnIndex x)) @@ -141,7 +147,6 @@ unconvTyCon i (RTyConPair (RTyCon a) (RTyCon b)) = unconvTyCon i (RTyConPair a b) = error "builtin pairs of arbitrary type not supported" - tmnames = ['a' .. 'z'] --tynames = ['α','β','γ','δ','ε','ζ','θ','ι','κ','ν','ξ','ο','π','ρ','σ','τ','υ','ϕ','χ','ψ','ω'] tynames = ['A' .. 'Z'] diff --git a/plutus-metatheory/src/RawU.lagda.md b/plutus-metatheory/src/RawU.lagda.md index fda3740aff3..f0bccefc0ed 100644 --- a/plutus-metatheory/src/RawU.lagda.md +++ b/plutus-metatheory/src/RawU.lagda.md @@ -25,7 +25,7 @@ open import Relation.Nullary using (does;yes;no;¬_) open import Data.Unit using (⊤;tt) open import Data.Product using (Σ;proj₁;proj₂) renaming (_,_ to _,,_) -open import Utils using (ByteString;DATA;List;[];_∷_;_×_;_,_;eqDATA) +open import Utils using (ByteString;DATA;List;[];_∷_;_×_;_,_;eqDATA;Bls12-381-G1-Element;Bls12-381-G2-Element;Bls12-381-MlResult) open import Utils.Decidable using (dcong;dcong₂) open import Builtin using (Builtin;equals) open Builtin.Builtin @@ -53,25 +53,31 @@ data Esc (a : Set) : Set where {-# COMPILE GHC Esc = data Esc () #-} data Tag : Set → Set where - integer : Tag (Esc ℤ) - bytestring : Tag (Esc ByteString) - string : Tag (Esc String) - bool : Tag (Esc Bool) - unit : Tag (Esc ⊤) - pdata : Tag (Esc DATA) - pair : ∀{A B} → Tag (Esc A) → Tag (Esc B) → Tag (Esc (A × B)) - list : ∀{A} → Tag (Esc A) → Tag (Esc (List A)) + integer : Tag (Esc ℤ) + bytestring : Tag (Esc ByteString) + string : Tag (Esc String) + bool : Tag (Esc Bool) + unit : Tag (Esc ⊤) + pdata : Tag (Esc DATA) + pair : ∀{A B} → Tag (Esc A) → Tag (Esc B) → Tag (Esc (A × B)) + list : ∀{A} → Tag (Esc A) → Tag (Esc (List A)) + bls12-381-g1-element : Tag (Esc Bls12-381-G1-Element) + bls12-381-g2-element : Tag (Esc Bls12-381-G2-Element) + bls12-381-mlresult : Tag (Esc Bls12-381-MlResult) {-# FOREIGN GHC type Tag = DefaultUni #-} -{-# FOREIGN GHC pattern TagInt = DefaultUniInteger #-} -{-# FOREIGN GHC pattern TagBS = DefaultUniByteString #-} -{-# FOREIGN GHC pattern TagStr = DefaultUniString #-} -{-# FOREIGN GHC pattern TagBool = DefaultUniBool #-} -{-# FOREIGN GHC pattern TagUnit = DefaultUniUnit #-} -{-# FOREIGN GHC pattern TagData = DefaultUniData #-} -{-# FOREIGN GHC pattern TagPair ta tb = DefaultUniPair ta tb #-} -{-# FOREIGN GHC pattern TagList ta = DefaultUniList ta #-} -{-# COMPILE GHC Tag = data Tag (TagInt | TagBS | TagStr | TagBool | TagUnit | TagData | TagPair | TagList) #-} +{-# FOREIGN GHC pattern TagInt = DefaultUniInteger #-} +{-# FOREIGN GHC pattern TagBS = DefaultUniByteString #-} +{-# FOREIGN GHC pattern TagStr = DefaultUniString #-} +{-# FOREIGN GHC pattern TagBool = DefaultUniBool #-} +{-# FOREIGN GHC pattern TagUnit = DefaultUniUnit #-} +{-# FOREIGN GHC pattern TagData = DefaultUniData #-} +{-# FOREIGN GHC pattern TagPair ta tb = DefaultUniPair ta tb #-} +{-# FOREIGN GHC pattern TagList ta = DefaultUniList ta #-} +{-# FOREIGN GHC pattern TagBLS12_381_G1_Element = DefaultUniBLS12_381_G1_Element #-} +{-# FOREIGN GHC pattern TagBLS12_381_G2_Element = DefaultUniBLS12_381_G2_Element #-} +{-# FOREIGN GHC pattern TagBLS12_381_MlResult = DefaultUniBLS12_381_MlResult #-} +{-# COMPILE GHC Tag = data Tag (TagInt | TagBS | TagStr | TagBool | TagUnit | TagData | TagPair | TagList | TagBLS12_381_G1_Element | TagBLS12_381_G2_Element | TagBLS12_381_MlResult) #-} ``` ## Term constants @@ -148,6 +154,9 @@ The meaning of type tags is provided by the following function. ⟦ con T.pdata ⟧tag = DATA ⟦ con (T.pair p p') ⟧tag = ⟦ p ⟧tag × ⟦ p' ⟧tag ⟦ con (T.list p) ⟧tag = List ⟦ p ⟧tag +⟦ con T.bls12-381-g1-element ⟧tag = Bls12-381-G1-Element +⟦ con T.bls12-381-g2-element ⟧tag = Bls12-381-G2-Element +⟦ con T.bls12-381-mlresult ⟧tag = Bls12-381-MlResult ``` Equality of `TyTag`s is decidable @@ -197,6 +206,9 @@ tag2TyTag unit = con T.unit tag2TyTag pdata = con T.pdata tag2TyTag (pair t u) = con (T.pair (tag2TyTag t) (tag2TyTag u)) tag2TyTag (list t) = con (T.list (tag2TyTag t)) +tag2TyTag bls12-381-g1-element = con T.bls12-381-g1-element +tag2TyTag bls12-381-g2-element = con T.bls12-381-g2-element +tag2TyTag bls12-381-mlresult = con T.bls12-381-mlresult tagLemma : ∀{A}(t : Tag (Esc A)) → A ≡ ⟦ tag2TyTag t ⟧tag tagLemma integer = refl @@ -207,6 +219,9 @@ tagLemma unit = refl tagLemma pdata = refl tagLemma (pair t u) = cong₂ _×_ (tagLemma t) (tagLemma u) tagLemma (list t) = cong List (tagLemma t) +tagLemma bls12-381-g1-element = refl +tagLemma bls12-381-g2-element = refl +tagLemma bls12-381-mlresult = refl tagCon2TmCon : TagCon → TmCon tagCon2TmCon (tagCon integer x) = tmCon (con T.integer) x @@ -217,6 +232,9 @@ tagCon2TmCon (tagCon unit x) = tmCon (con T.unit) tt tagCon2TmCon (tagCon pdata x) = tmCon (con T.pdata) x tagCon2TmCon (tagCon (pair x y) (a , b)) rewrite tagLemma x | tagLemma y = tmCon (con (T.pair (tag2TyTag x) (tag2TyTag y))) (a , b) tagCon2TmCon (tagCon (list x) xs) rewrite tagLemma x = tmCon (con (T.list (tag2TyTag x))) xs +tagCon2TmCon (tagCon bls12-381-g1-element x) = tmCon (con T.bls12-381-g1-element) x +tagCon2TmCon (tagCon bls12-381-g2-element x) = tmCon (con T.bls12-381-g2-element) x +tagCon2TmCon (tagCon bls12-381-mlresult x) = tmCon (con T.bls12-381-mlresult) x ``` ### From Agda-style to Haskell-style @@ -233,6 +251,9 @@ tyTag2Tag (con (T.pair t u)) with tyTag2Tag t | tyTag2Tag u ... | A ,, a | B ,, b = A × B ,, pair a b tyTag2Tag (con (T.list t)) with tyTag2Tag t ... | A ,, a = (List A) ,, (list a) +tyTag2Tag (con T.bls12-381-g1-element) = Bls12-381-G1-Element ,, bls12-381-g1-element +tyTag2Tag (con T.bls12-381-g2-element) = Bls12-381-G2-Element ,, bls12-381-g2-element +tyTag2Tag (con T.bls12-381-mlresult) = Bls12-381-MlResult ,, bls12-381-mlresult tyTagLemma : (t : TyTag) → ⟦ t ⟧tag ≡ proj₁ (tyTag2Tag t) tyTagLemma (con T.integer) = refl @@ -243,6 +264,9 @@ tyTagLemma (con T.unit) = refl tyTagLemma (con T.pdata) = refl tyTagLemma (con (T.pair t u)) = cong₂ _×_ (tyTagLemma t) (tyTagLemma u) tyTagLemma (con (T.list t)) = cong List (tyTagLemma t) +tyTagLemma (con T.bls12-381-g1-element) = refl +tyTagLemma (con T.bls12-381-g2-element) = refl +tyTagLemma (con T.bls12-381-mlresult) = refl tmCon2TagCon : TmCon → TagCon tmCon2TagCon (tmCon (con T.integer) x) = tagCon integer x @@ -254,4 +278,7 @@ tmCon2TagCon (tmCon (con T.pdata) x) = tagCon pdata x tmCon2TagCon (tmCon (con (T.pair t u)) (x , y)) rewrite tyTagLemma t | tyTagLemma u = tagCon (pair (proj₂ (tyTag2Tag t)) (proj₂ (tyTag2Tag u))) (x , y) tmCon2TagCon (tmCon (con (T.list t)) x) rewrite tyTagLemma t = tagCon (list (proj₂ (tyTag2Tag t))) x +tmCon2TagCon (tmCon (con T.bls12-381-g1-element) x) = tagCon bls12-381-g1-element x +tmCon2TagCon (tmCon (con T.bls12-381-g2-element) x) = tagCon bls12-381-g2-element x +tmCon2TagCon (tmCon (con T.bls12-381-mlresult) x) = tagCon bls12-381-mlresult x ``` \ No newline at end of file diff --git a/plutus-metatheory/src/Scoped/Extrication.lagda b/plutus-metatheory/src/Scoped/Extrication.lagda index 4d05c1ed95c..205e5855017 100644 --- a/plutus-metatheory/src/Scoped/Extrication.lagda +++ b/plutus-metatheory/src/Scoped/Extrication.lagda @@ -91,6 +91,9 @@ extricateC (tmString s) = tmCon (con string) s extricateC (tmBool b) = tmCon (con bool) b extricateC tmUnit = tmCon (con unit) tt extricateC (tmData d) = tmCon (con pdata) d +extricateC (tmBls12-381-g1-element e) = tmCon (con bls12-381-g1-element) e +extricateC (tmBls12-381-g2-element e) = tmCon (con bls12-381-g2-element) e +extricateC (tmBls12-381-mlresult r) = tmCon (con bls12-381-mlresult) r extricateSub : ∀ {Γ Δ} → (∀ {J} → Δ ∋⋆ J → Γ ⊢Nf⋆ J) → Scoped.Tel⋆ (len⋆ Γ) (len⋆ Δ) diff --git a/plutus-metatheory/src/Type/RenamingSubstitution.lagda.md b/plutus-metatheory/src/Type/RenamingSubstitution.lagda.md index c8c691913f9..0df4831ad2a 100644 --- a/plutus-metatheory/src/Type/RenamingSubstitution.lagda.md +++ b/plutus-metatheory/src/Type/RenamingSubstitution.lagda.md @@ -509,4 +509,4 @@ Substituting in the empty type context is the same as doing nothing. ``` sub-∅ : (A : ∅ ⊢⋆ J) → (x : Sub ∅ ∅) → sub x A ≡ A sub-∅ A x = trans (sub-cong (λ ()) A) (sub-id A) -``` \ No newline at end of file +``` diff --git a/plutus-metatheory/src/Untyped.lagda.md b/plutus-metatheory/src/Untyped.lagda.md index 003140b65f2..41d6dcc4c3a 100644 --- a/plutus-metatheory/src/Untyped.lagda.md +++ b/plutus-metatheory/src/Untyped.lagda.md @@ -71,8 +71,9 @@ uglyTmCon (tmCon (con bool) true) = "(bool " ++ "true" ++ ")" uglyTmCon (tmCon (con pdata) d) = uglyDATA d uglyTmCon (tmCon (con (pair t u)) (x , y)) = "(pair " ++ uglyTmCon (tmCon t x) ++ " " ++ uglyTmCon (tmCon u y) ++ ")" uglyTmCon (tmCon (con (list t)) xs) = "(list [ something ])" - - +uglyTmCon (tmCon (con bls12-381-g1-element) e) = "(bls12-381-g1-element ???)" -- FIXME +uglyTmCon (tmCon (con bls12-381-g2-element) e) = "(bls12-381-g2-element ???)" -- FIXME +uglyTmCon (tmCon (con bls12-381-mlresult) r) = "(bls12-381-mlresult ???)" -- FIXME {-# FOREIGN GHC import qualified Data.Text as T #-} diff --git a/plutus-metatheory/src/Untyped/CEK.lagda.md b/plutus-metatheory/src/Untyped/CEK.lagda.md index 3baeaebd6ee..199b9008720 100644 --- a/plutus-metatheory/src/Untyped/CEK.lagda.md +++ b/plutus-metatheory/src/Untyped/CEK.lagda.md @@ -402,6 +402,86 @@ BUILTIN mkNilPairData = λ { (app base (V-con (con unit) tt)) -> inj₂ (V-con (con (list (con (pair (con pdata) (con pdata))))) []) ; _ -> inj₁ userError } +BUILTIN bls12-381-G1-add = λ + { (app (app base (V-con (con bls12-381-g1-element) e)) (V-con (con bls12-381-g1-element) e')) -> inj₂ (V-con (con bls12-381-g1-element) (BLS12-381-G1-add e e')) + ; _ -> inj₁ userError + } +BUILTIN bls12-381-G1-neg = λ + { (app base (V-con (con bls12-381-g1-element) e)) -> inj₂ (V-con (con bls12-381-g1-element) (BLS12-381-G1-neg e)) + ; _ -> inj₁ userError + } +BUILTIN bls12-381-G1-scalarMul = λ + { (app (app base (V-con (con integer) i)) (V-con (con bls12-381-g1-element) e)) -> inj₂ (V-con (con bls12-381-g1-element) (BLS12-381-G1-scalarMul i e)) + ; _ -> inj₁ userError + } +BUILTIN bls12-381-G1-equal = λ + { (app (app base (V-con (con bls12-381-g1-element) e)) (V-con (con bls12-381-g1-element) e')) -> inj₂ (V-con (con bool) (BLS12-381-G1-equal e e')) + ; _ -> inj₁ userError + } +BUILTIN bls12-381-G1-hashToGroup = λ + { (app (app base (V-con (con bytestring) msg)) (V-con (con bytestring) dst)) -> case BLS12-381-G1-hashToGroup msg dst of λ + { (just p) -> inj₂ (V-con (con bls12-381-g1-element) p) + ; nothing -> inj₁ userError + } + ; _ -> inj₁ userError + } +BUILTIN bls12-381-G1-compress = λ + { (app base (V-con (con bls12-381-g1-element) e)) -> inj₂ (V-con (con bytestring) (BLS12-381-G1-compress e)) + ; _ -> inj₁ userError + } +BUILTIN bls12-381-G1-uncompress = λ + { (app base (V-con (con bytestring) b)) -> case BLS12-381-G1-uncompress b of λ + { (just e) -> inj₂ (V-con (con bls12-381-g1-element) e) + ; nothing -> inj₁ userError + } + ; _ -> inj₁ userError + } +BUILTIN bls12-381-G2-add = λ + { (app (app base (V-con (con bls12-381-g2-element) e)) (V-con (con bls12-381-g2-element) e')) -> inj₂ (V-con (con bls12-381-g2-element) (BLS12-381-G2-add e e')) + ; _ -> inj₁ userError + } +BUILTIN bls12-381-G2-neg = λ + { (app base (V-con (con bls12-381-g2-element) e)) -> inj₂ (V-con (con bls12-381-g2-element) (BLS12-381-G2-neg e)) + ; _ -> inj₁ userError + } +BUILTIN bls12-381-G2-scalarMul = λ + { (app (app base (V-con (con integer) i)) (V-con (con bls12-381-g2-element) e)) -> inj₂ (V-con (con bls12-381-g2-element) (BLS12-381-G2-scalarMul i e)) + ; _ -> inj₁ userError + } +BUILTIN bls12-381-G2-equal = λ + { (app (app base (V-con (con bls12-381-g2-element) e)) (V-con (con bls12-381-g2-element) e')) -> inj₂ (V-con (con bool) (BLS12-381-G2-equal e e')) + ; _ -> inj₁ userError + } +BUILTIN bls12-381-G2-hashToGroup = λ + { (app (app base (V-con (con bytestring) msg)) (V-con (con bytestring) dst)) -> case BLS12-381-G2-hashToGroup msg dst of λ + { (just p) -> inj₂ (V-con (con bls12-381-g2-element) p) + ; nothing -> inj₁ userError + } + ; _ -> inj₁ userError + } +BUILTIN bls12-381-G2-compress = λ + { (app base (V-con (con bls12-381-g2-element) e)) -> inj₂ (V-con (con bytestring) (BLS12-381-G2-compress e)) + ; _ -> inj₁ userError + } +BUILTIN bls12-381-G2-uncompress = λ + { (app base (V-con (con bytestring) b)) -> case BLS12-381-G2-uncompress b of λ + { (just e) -> inj₂ (V-con (con bls12-381-g2-element) e) + ; nothing -> inj₁ userError + } + ; _ -> inj₁ userError + } +BUILTIN bls12-381-millerLoop = λ + { (app (app base (V-con (con bls12-381-g1-element) e1)) (V-con (con bls12-381-g2-element) e2)) -> inj₂ (V-con (con bls12-381-mlresult) (BLS12-381-millerLoop e1 e2)) + ; _ -> inj₁ userError + } +BUILTIN bls12-381-mulMlResult = λ + { (app (app base (V-con (con bls12-381-mlresult) r)) (V-con (con bls12-381-mlresult) r')) -> inj₂ (V-con (con bls12-381-mlresult) (BLS12-381-mulMlResult r r')) + ; _ -> inj₁ userError + } +BUILTIN bls12-381-finalVerify = λ + { (app (app base (V-con (con bls12-381-mlresult) r)) (V-con (con bls12-381-mlresult) r')) -> inj₂ (V-con (con bool) (BLS12-381-finalVerify r r')) + ; _ -> inj₁ userError + } BUILTIN' : ∀ b diff --git a/plutus-metatheory/src/Utils.lagda b/plutus-metatheory/src/Utils.lagda index 243efa94a75..045cbedc77f 100644 --- a/plutus-metatheory/src/Utils.lagda +++ b/plutus-metatheory/src/Utils.lagda @@ -85,7 +85,7 @@ record Monad (F : Set → Set) : Set₁ where field return : ∀{A} → A → F A _>>=_ : ∀{A B} → F A → (A → F B) → F B - + _>>_ : ∀{A B} → F A → F B → F B as >> bs = as >>= const bs @@ -179,6 +179,18 @@ data DATA : Set where postulate eqDATA : DATA → DATA → Bool {-# COMPILE GHC eqDATA = (==) #-} + +postulate Bls12-381-G1-Element : Set +{-# FOREIGN GHC import qualified PlutusCore.Crypto.BLS12_381.G1 as G1 #-} +{-# COMPILE GHC Bls12-381-G1-Element = type G1.Element #-} + +postulate Bls12-381-G2-Element : Set +{-# FOREIGN GHC import qualified PlutusCore.Crypto.BLS12_381.G2 as G2 #-} +{-# COMPILE GHC Bls12-381-G2-Element = type G2.Element #-} + +postulate Bls12-381-MlResult : Set +{-# FOREIGN GHC import qualified PlutusCore.Crypto.BLS12_381.Pairing as Pairing #-} +{-# COMPILE GHC Bls12-381-MlResult = type Pairing.MlResult #-} \end{code} Kinds diff --git a/plutus-metatheory/test/ii.plc b/plutus-metatheory/test/ii.plc new file mode 100644 index 00000000000..78e2a59375c --- /dev/null +++ b/plutus-metatheory/test/ii.plc @@ -0,0 +1,105 @@ +(program 1.0.0 + [ + [ + [ + (force + (delay + (lam + b + (lam + x + (lam + y + [ + [ [ [ (force (builtin ifThenElse)) b ] x ] y ] (con unit ()) + ] + ) + ) + ) + ) + ) + (con bool False) + ] + [ + (force (force (delay (delay (lam x (lam y x)))))) + [ + (lam + x0 + [ + [ + (builtin addInteger) + [ + [ + (builtin addInteger) + [ + [ (builtin multiplyInteger) (con integer 3) ] + (con integer 2) + ] + ] + [ + [ (builtin multiplyInteger) (con integer 2) ] + (con integer 0) + ] + ] + ] + [ + (lam + x2 + [ + [ (builtin subtractInteger) (con integer 3) ] + (con integer 3) + ] + ) + [ (builtin sha3_256) (con bytestring #6d696a) ] + ] + ] + ) + [ + (lam + x1 + [ + [ + (builtin takeByteString) + [ + [ (builtin subtractInteger) (con integer 3) ] + (con integer 2) + ] + ] + [ (builtin sha3_256) (con bytestring #62) ] + ] + ) + [ + (builtin sha3_256) + [ + [ (builtin takeByteString) (con integer 1) ] + (con bytestring #6c68) + ] + ] + ] + ] + ] + ] + [ + (force (force (delay (delay (lam x (lam y x)))))) + [ + (lam x0 [ [ (builtin multiplyInteger) x0 ] x0 ]) + [ + (lam + x1 + [ + (lam x2 x2) + [ [ (builtin subtractInteger) (con integer 3) ] (con integer 2) ] + ] + ) + [ + [ + (builtin addInteger) + [ [ (builtin multiplyInteger) (con integer 3) ] (con integer 0) ] + ] + [ [ (builtin addInteger) (con integer 0) ] (con integer 1) ] + ] + ] + ] + ] + ] +) diff --git a/plutus-metatheory/test/ii.tplc b/plutus-metatheory/test/ii.tplc new file mode 100644 index 00000000000..ce623993dc2 --- /dev/null +++ b/plutus-metatheory/test/ii.tplc @@ -0,0 +1,78 @@ +(program 1.0.0 + [ + [ + [ + { + (abs + a + (type) + (lam + b + (con bool) + (lam + x + (fun (con unit) a) + (lam + y + (fun (con unit) a) + [ + [ + [ [ { (builtin ifThenElse) (fun (con unit) a) } b ] x ] y + ] + (con unit ()) + ] + ) + ) + ) + ) + (con integer) + } + (con bool True) + ] + [ + { + { (abs a (type) (abs b (type) (lam x a (lam y b x)))) (con integer) } + (con unit) + } + [ + (lam x0 (con integer) [ [ (builtin multiplyInteger) x0 ] x0 ]) + [ + (lam + x1 + (con bytestring) + [ + [ + (builtin multiplyInteger) + [ [ (builtin addInteger) (con integer 2) ] (con integer 2) ] + ] + [ + [ (builtin multiplyInteger) (con integer 0) ] (con integer 2) + ] + ] + ) + [ + [ + (builtin concatenate) + [ + [ (builtin takeByteString) (con integer 3) ] + (con bytestring #666f7a) + ] + ] + [ + [ (builtin concatenate) (con bytestring #71) ] + (con bytestring #697168) + ] + ] + ] + ] + ] + ] + [ + { + { (abs a (type) (abs b (type) (lam x a (lam y b x)))) (con integer) } + (con unit) + } + (con integer 2) + ] + ] +) diff --git a/plutus-metatheory/test/test.plc b/plutus-metatheory/test/test.plc new file mode 100644 index 00000000000..59af0376bd2 --- /dev/null +++ b/plutus-metatheory/test/test.plc @@ -0,0 +1,12 @@ +(program 1.0.0 +[ [(builtin multiplyInteger) + +(con integer 2342) + +] + +(con integer 32331) + + +] +) \ No newline at end of file diff --git a/plutus-tx-plugin/changelog.d/20230323_203447_kwxm_prototype.md b/plutus-tx-plugin/changelog.d/20230323_203447_kwxm_prototype.md new file mode 100644 index 00000000000..35abc054d26 --- /dev/null +++ b/plutus-tx-plugin/changelog.d/20230323_203447_kwxm_prototype.md @@ -0,0 +1,41 @@ + + + + +### Added + +- New built-in types and functions for BLS12-381 operations. + + + + + diff --git a/plutus-tx-plugin/src/PlutusTx/Compiler/Builtins.hs b/plutus-tx-plugin/src/PlutusTx/Compiler/Builtins.hs index 0fcde4f061f..cb99c0d3e0b 100644 --- a/plutus-tx-plugin/src/PlutusTx/Compiler/Builtins.hs +++ b/plutus-tx-plugin/src/PlutusTx/Compiler/Builtins.hs @@ -35,6 +35,9 @@ import PlutusIR.Purity qualified as PIR import PlutusCore qualified as PLC import PlutusCore.Builtin qualified as PLC +import PlutusCore.Crypto.BLS12_381.G1 qualified as BLS12_381.G1 +import PlutusCore.Crypto.BLS12_381.G2 qualified as BLS12_381.G2 +import PlutusCore.Crypto.BLS12_381.Pairing qualified as BLS12_381.Pairing import PlutusCore.Data qualified as PLC import PlutusCore.Quote @@ -238,6 +241,29 @@ builtinNames = [ , 'Builtins.unsafeDataAsList , 'Builtins.unsafeDataAsB , 'Builtins.unsafeDataAsI + + , ''Builtins.BuiltinBLS12_381_G1_Element + , 'Builtins.bls12_381_G1_equals + , 'Builtins.bls12_381_G1_add + , 'Builtins.bls12_381_G1_neg + , 'Builtins.bls12_381_G1_scalarMul + , 'Builtins.bls12_381_G1_compress + , 'Builtins.bls12_381_G1_uncompress + , 'Builtins.bls12_381_G1_hashToGroup + + , ''Builtins.BuiltinBLS12_381_G2_Element + , 'Builtins.bls12_381_G2_equals + , 'Builtins.bls12_381_G2_add + , 'Builtins.bls12_381_G2_neg + , 'Builtins.bls12_381_G2_scalarMul + , 'Builtins.bls12_381_G2_compress + , 'Builtins.bls12_381_G2_uncompress + , 'Builtins.bls12_381_G2_hashToGroup + + , ''Builtins.BuiltinBLS12_381_MlResult + , 'Builtins.bls12_381_millerLoop + , 'Builtins.bls12_381_mulMlResult + , 'Builtins.bls12_381_finalVerify ] defineBuiltinTerm :: CompilingDefault uni fun m ann => Ann -> TH.Name -> PIRTerm uni fun -> m () @@ -267,43 +293,43 @@ defineBuiltinTerms = do -- See Note [Builtin terms and values] -- Bool defineBuiltinTerm annMayInline 'Builtins.ifThenElse $ mkBuiltin PLC.IfThenElse - defineBuiltinTerm annMayInline 'Builtins.true $ PIR.mkConstant annMayInline True - defineBuiltinTerm annMayInline 'Builtins.false $ PIR.mkConstant annMayInline False + defineBuiltinTerm annMayInline 'Builtins.true $ PIR.mkConstant annMayInline True + defineBuiltinTerm annMayInline 'Builtins.false $ PIR.mkConstant annMayInline False - defineBuiltinTerm annMayInline 'Builtins.unitval $ PIR.mkConstant annMayInline () + defineBuiltinTerm annMayInline 'Builtins.unitval $ PIR.mkConstant annMayInline () defineBuiltinTerm annMayInline 'Builtins.chooseUnit $ mkBuiltin PLC.ChooseUnit -- Bytestring builtins - defineBuiltinTerm annMayInline 'Builtins.appendByteString $ mkBuiltin PLC.AppendByteString - defineBuiltinTerm annMayInline 'Builtins.consByteString $ mkBuiltin PLC.ConsByteString - defineBuiltinTerm annMayInline 'Builtins.sliceByteString $ mkBuiltin PLC.SliceByteString - defineBuiltinTerm annMayInline 'Builtins.lengthOfByteString $ mkBuiltin PLC.LengthOfByteString - defineBuiltinTerm annMayInline 'Builtins.indexByteString $ mkBuiltin PLC.IndexByteString - defineBuiltinTerm annMayInline 'Builtins.sha2_256 $ mkBuiltin PLC.Sha2_256 - defineBuiltinTerm annMayInline 'Builtins.sha3_256 $ mkBuiltin PLC.Sha3_256 - defineBuiltinTerm annMayInline 'Builtins.blake2b_256 $ mkBuiltin PLC.Blake2b_256 - defineBuiltinTerm annMayInline 'Builtins.equalsByteString $ mkBuiltin PLC.EqualsByteString - defineBuiltinTerm annMayInline 'Builtins.lessThanByteString $ mkBuiltin PLC.LessThanByteString - defineBuiltinTerm annMayInline 'Builtins.lessThanEqualsByteString $ mkBuiltin PLC.LessThanEqualsByteString - defineBuiltinTerm annMayInline 'Builtins.emptyByteString $ PIR.mkConstant annMayInline BS.empty - defineBuiltinTerm annMayInline 'Builtins.decodeUtf8 $ mkBuiltin PLC.DecodeUtf8 - defineBuiltinTerm annMayInline 'Builtins.verifyEcdsaSecp256k1Signature $ mkBuiltin PLC.VerifyEcdsaSecp256k1Signature + defineBuiltinTerm annMayInline 'Builtins.appendByteString $ mkBuiltin PLC.AppendByteString + defineBuiltinTerm annMayInline 'Builtins.consByteString $ mkBuiltin PLC.ConsByteString + defineBuiltinTerm annMayInline 'Builtins.sliceByteString $ mkBuiltin PLC.SliceByteString + defineBuiltinTerm annMayInline 'Builtins.lengthOfByteString $ mkBuiltin PLC.LengthOfByteString + defineBuiltinTerm annMayInline 'Builtins.indexByteString $ mkBuiltin PLC.IndexByteString + defineBuiltinTerm annMayInline 'Builtins.sha2_256 $ mkBuiltin PLC.Sha2_256 + defineBuiltinTerm annMayInline 'Builtins.sha3_256 $ mkBuiltin PLC.Sha3_256 + defineBuiltinTerm annMayInline 'Builtins.blake2b_256 $ mkBuiltin PLC.Blake2b_256 + defineBuiltinTerm annMayInline 'Builtins.equalsByteString $ mkBuiltin PLC.EqualsByteString + defineBuiltinTerm annMayInline 'Builtins.lessThanByteString $ mkBuiltin PLC.LessThanByteString + defineBuiltinTerm annMayInline 'Builtins.lessThanEqualsByteString $ mkBuiltin PLC.LessThanEqualsByteString + defineBuiltinTerm annMayInline 'Builtins.emptyByteString $ PIR.mkConstant annMayInline BS.empty + defineBuiltinTerm annMayInline 'Builtins.decodeUtf8 $ mkBuiltin PLC.DecodeUtf8 + defineBuiltinTerm annMayInline 'Builtins.verifyEcdsaSecp256k1Signature $ mkBuiltin PLC.VerifyEcdsaSecp256k1Signature defineBuiltinTerm annMayInline 'Builtins.verifySchnorrSecp256k1Signature $ mkBuiltin PLC.VerifySchnorrSecp256k1Signature -- Crypto defineBuiltinTerm annMayInline 'Builtins.verifyEd25519Signature $ mkBuiltin PLC.VerifyEd25519Signature -- Integer builtins - defineBuiltinTerm annMayInline 'Builtins.addInteger $ mkBuiltin PLC.AddInteger - defineBuiltinTerm annMayInline 'Builtins.subtractInteger $ mkBuiltin PLC.SubtractInteger - defineBuiltinTerm annMayInline 'Builtins.multiplyInteger $ mkBuiltin PLC.MultiplyInteger - defineBuiltinTerm annMayInline 'Builtins.divideInteger $ mkBuiltin PLC.DivideInteger - defineBuiltinTerm annMayInline 'Builtins.modInteger $ mkBuiltin PLC.ModInteger - defineBuiltinTerm annMayInline 'Builtins.quotientInteger $ mkBuiltin PLC.QuotientInteger - defineBuiltinTerm annMayInline 'Builtins.remainderInteger $ mkBuiltin PLC.RemainderInteger - defineBuiltinTerm annMayInline 'Builtins.lessThanInteger $ mkBuiltin PLC.LessThanInteger - defineBuiltinTerm annMayInline 'Builtins.lessThanEqualsInteger $ mkBuiltin PLC.LessThanEqualsInteger - defineBuiltinTerm annMayInline 'Builtins.equalsInteger $ mkBuiltin PLC.EqualsInteger + defineBuiltinTerm annMayInline 'Builtins.addInteger $ mkBuiltin PLC.AddInteger + defineBuiltinTerm annMayInline 'Builtins.subtractInteger $ mkBuiltin PLC.SubtractInteger + defineBuiltinTerm annMayInline 'Builtins.multiplyInteger $ mkBuiltin PLC.MultiplyInteger + defineBuiltinTerm annMayInline 'Builtins.divideInteger $ mkBuiltin PLC.DivideInteger + defineBuiltinTerm annMayInline 'Builtins.modInteger $ mkBuiltin PLC.ModInteger + defineBuiltinTerm annMayInline 'Builtins.quotientInteger $ mkBuiltin PLC.QuotientInteger + defineBuiltinTerm annMayInline 'Builtins.remainderInteger $ mkBuiltin PLC.RemainderInteger + defineBuiltinTerm annMayInline 'Builtins.lessThanInteger $ mkBuiltin PLC.LessThanInteger + defineBuiltinTerm annMayInline 'Builtins.lessThanEqualsInteger $ mkBuiltin PLC.LessThanEqualsInteger + defineBuiltinTerm annMayInline 'Builtins.equalsInteger $ mkBuiltin PLC.EqualsInteger -- Error -- See Note [Delaying error] @@ -313,9 +339,9 @@ defineBuiltinTerms = do -- Strings and chars defineBuiltinTerm annMayInline 'Builtins.appendString $ mkBuiltin PLC.AppendString - defineBuiltinTerm annMayInline 'Builtins.emptyString $ PIR.mkConstant annMayInline ("" :: Text) + defineBuiltinTerm annMayInline 'Builtins.emptyString $ PIR.mkConstant annMayInline ("" :: Text) defineBuiltinTerm annMayInline 'Builtins.equalsString $ mkBuiltin PLC.EqualsString - defineBuiltinTerm annMayInline 'Builtins.encodeUtf8 $ mkBuiltin PLC.EncodeUtf8 + defineBuiltinTerm annMayInline 'Builtins.encodeUtf8 $ mkBuiltin PLC.EncodeUtf8 -- Tracing -- When `remove-trace` is specified, we define `trace` as `\_ a -> a` instead of the builtin version. @@ -338,33 +364,52 @@ defineBuiltinTerms = do defineBuiltinTerm ann 'Builtins.trace traceTerm -- Pairs - defineBuiltinTerm annMayInline 'Builtins.fst $ mkBuiltin PLC.FstPair - defineBuiltinTerm annMayInline 'Builtins.snd $ mkBuiltin PLC.SndPair + defineBuiltinTerm annMayInline 'Builtins.fst $ mkBuiltin PLC.FstPair + defineBuiltinTerm annMayInline 'Builtins.snd $ mkBuiltin PLC.SndPair defineBuiltinTerm annMayInline 'Builtins.mkPairData $ mkBuiltin PLC.MkPairData -- List - defineBuiltinTerm annMayInline 'Builtins.null $ mkBuiltin PLC.NullList - defineBuiltinTerm annMayInline 'Builtins.head $ mkBuiltin PLC.HeadList - defineBuiltinTerm annMayInline 'Builtins.tail $ mkBuiltin PLC.TailList - defineBuiltinTerm annMayInline 'Builtins.chooseList $ mkBuiltin PLC.ChooseList - defineBuiltinTerm annMayInline 'Builtins.mkNilData $ mkBuiltin PLC.MkNilData + defineBuiltinTerm annMayInline 'Builtins.null $ mkBuiltin PLC.NullList + defineBuiltinTerm annMayInline 'Builtins.head $ mkBuiltin PLC.HeadList + defineBuiltinTerm annMayInline 'Builtins.tail $ mkBuiltin PLC.TailList + defineBuiltinTerm annMayInline 'Builtins.chooseList $ mkBuiltin PLC.ChooseList + defineBuiltinTerm annMayInline 'Builtins.mkNilData $ mkBuiltin PLC.MkNilData defineBuiltinTerm annMayInline 'Builtins.mkNilPairData $ mkBuiltin PLC.MkNilPairData - defineBuiltinTerm annMayInline 'Builtins.mkCons $ mkBuiltin PLC.MkCons + defineBuiltinTerm annMayInline 'Builtins.mkCons $ mkBuiltin PLC.MkCons -- Data - defineBuiltinTerm annMayInline 'Builtins.chooseData $ mkBuiltin PLC.ChooseData - defineBuiltinTerm annMayInline 'Builtins.equalsData $ mkBuiltin PLC.EqualsData - defineBuiltinTerm annMayInline 'Builtins.mkConstr $ mkBuiltin PLC.ConstrData - defineBuiltinTerm annMayInline 'Builtins.mkMap $ mkBuiltin PLC.MapData - defineBuiltinTerm annMayInline 'Builtins.mkList $ mkBuiltin PLC.ListData - defineBuiltinTerm annMayInline 'Builtins.mkI $ mkBuiltin PLC.IData - defineBuiltinTerm annMayInline 'Builtins.mkB $ mkBuiltin PLC.BData + defineBuiltinTerm annMayInline 'Builtins.chooseData $ mkBuiltin PLC.ChooseData + defineBuiltinTerm annMayInline 'Builtins.equalsData $ mkBuiltin PLC.EqualsData + defineBuiltinTerm annMayInline 'Builtins.mkConstr $ mkBuiltin PLC.ConstrData + defineBuiltinTerm annMayInline 'Builtins.mkMap $ mkBuiltin PLC.MapData + defineBuiltinTerm annMayInline 'Builtins.mkList $ mkBuiltin PLC.ListData + defineBuiltinTerm annMayInline 'Builtins.mkI $ mkBuiltin PLC.IData + defineBuiltinTerm annMayInline 'Builtins.mkB $ mkBuiltin PLC.BData defineBuiltinTerm annMayInline 'Builtins.unsafeDataAsConstr $ mkBuiltin PLC.UnConstrData - defineBuiltinTerm annMayInline 'Builtins.unsafeDataAsMap $ mkBuiltin PLC.UnMapData - defineBuiltinTerm annMayInline 'Builtins.unsafeDataAsList $ mkBuiltin PLC.UnListData - defineBuiltinTerm annMayInline 'Builtins.unsafeDataAsB $ mkBuiltin PLC.UnBData - defineBuiltinTerm annMayInline 'Builtins.unsafeDataAsI $ mkBuiltin PLC.UnIData - defineBuiltinTerm annMayInline 'Builtins.serialiseData $ mkBuiltin PLC.SerialiseData + defineBuiltinTerm annMayInline 'Builtins.unsafeDataAsMap $ mkBuiltin PLC.UnMapData + defineBuiltinTerm annMayInline 'Builtins.unsafeDataAsList $ mkBuiltin PLC.UnListData + defineBuiltinTerm annMayInline 'Builtins.unsafeDataAsB $ mkBuiltin PLC.UnBData + defineBuiltinTerm annMayInline 'Builtins.unsafeDataAsI $ mkBuiltin PLC.UnIData + defineBuiltinTerm annMayInline 'Builtins.serialiseData $ mkBuiltin PLC.SerialiseData + + -- BLS + defineBuiltinTerm annMayInline 'Builtins.bls12_381_G1_equals $ mkBuiltin PLC.Bls12_381_G1_equal + defineBuiltinTerm annMayInline 'Builtins.bls12_381_G1_add $ mkBuiltin PLC.Bls12_381_G1_add + defineBuiltinTerm annMayInline 'Builtins.bls12_381_G1_neg $ mkBuiltin PLC.Bls12_381_G1_neg + defineBuiltinTerm annMayInline 'Builtins.bls12_381_G1_scalarMul $ mkBuiltin PLC.Bls12_381_G1_scalarMul + defineBuiltinTerm annMayInline 'Builtins.bls12_381_G1_compress $ mkBuiltin PLC.Bls12_381_G1_compress + defineBuiltinTerm annMayInline 'Builtins.bls12_381_G1_uncompress $ mkBuiltin PLC.Bls12_381_G1_uncompress + defineBuiltinTerm annMayInline 'Builtins.bls12_381_G1_hashToGroup $ mkBuiltin PLC.Bls12_381_G1_hashToGroup + defineBuiltinTerm annMayInline 'Builtins.bls12_381_G2_equals $ mkBuiltin PLC.Bls12_381_G2_equal + defineBuiltinTerm annMayInline 'Builtins.bls12_381_G2_add $ mkBuiltin PLC.Bls12_381_G2_add + defineBuiltinTerm annMayInline 'Builtins.bls12_381_G2_scalarMul $ mkBuiltin PLC.Bls12_381_G2_scalarMul + defineBuiltinTerm annMayInline 'Builtins.bls12_381_G2_neg $ mkBuiltin PLC.Bls12_381_G2_neg + defineBuiltinTerm annMayInline 'Builtins.bls12_381_G2_compress $ mkBuiltin PLC.Bls12_381_G2_compress + defineBuiltinTerm annMayInline 'Builtins.bls12_381_G2_uncompress $ mkBuiltin PLC.Bls12_381_G2_uncompress + defineBuiltinTerm annMayInline 'Builtins.bls12_381_G2_hashToGroup $ mkBuiltin PLC.Bls12_381_G2_hashToGroup + defineBuiltinTerm annMayInline 'Builtins.bls12_381_millerLoop $ mkBuiltin PLC.Bls12_381_millerLoop + defineBuiltinTerm annMayInline 'Builtins.bls12_381_mulMlResult $ mkBuiltin PLC.Bls12_381_mulMlResult + defineBuiltinTerm annMayInline 'Builtins.bls12_381_finalVerify $ mkBuiltin PLC.Bls12_381_finalVerify defineBuiltinTypes :: CompilingDefault uni fun m ann @@ -378,6 +423,9 @@ defineBuiltinTypes = do defineBuiltinType ''Builtins.BuiltinData . ($> annMayInline) $ PLC.toTypeAst $ Proxy @PLC.Data defineBuiltinType ''Builtins.BuiltinPair . ($> annMayInline) $ PLC.TyBuiltin () (PLC.SomeTypeIn PLC.DefaultUniProtoPair) defineBuiltinType ''Builtins.BuiltinList . ($> annMayInline) $ PLC.TyBuiltin () (PLC.SomeTypeIn PLC.DefaultUniProtoList) + defineBuiltinType ''Builtins.BuiltinBLS12_381_G1_Element . ($> annMayInline) $ PLC.toTypeAst $ Proxy @BLS12_381.G1.Element + defineBuiltinType ''Builtins.BuiltinBLS12_381_G2_Element . ($> annMayInline) $ PLC.toTypeAst $ Proxy @BLS12_381.G2.Element + defineBuiltinType ''Builtins.BuiltinBLS12_381_MlResult . ($> annMayInline) $ PLC.toTypeAst $ Proxy @BLS12_381.Pairing.MlResult -- | Lookup a builtin term by its TH name. These are assumed to be present, so fails if it cannot find it. lookupBuiltinTerm :: Compiling uni fun m ann => TH.Name -> m (PIRTerm uni fun) diff --git a/plutus-tx/changelog.d/20230323_203148_kwxm_prototype.md b/plutus-tx/changelog.d/20230323_203148_kwxm_prototype.md new file mode 100644 index 00000000000..3611c1db650 --- /dev/null +++ b/plutus-tx/changelog.d/20230323_203148_kwxm_prototype.md @@ -0,0 +1,40 @@ + + + +### Added + +- New built-in types and functions for BLS12-381 operations. + + + + + diff --git a/plutus-tx/src/PlutusTx/Builtins.hs b/plutus-tx/src/PlutusTx/Builtins.hs index 42cbbaac3c9..af571835b8b 100644 --- a/plutus-tx/src/PlutusTx/Builtins.hs +++ b/plutus-tx/src/PlutusTx/Builtins.hs @@ -4,80 +4,103 @@ -- | Primitive names and functions for working with Plutus Core builtins. module PlutusTx.Builtins ( - -- * Bytestring builtins - BuiltinByteString - , appendByteString - , consByteString - , sliceByteString - , lengthOfByteString - , indexByteString - , emptyByteString - , equalsByteString - , lessThanByteString - , lessThanEqualsByteString - , greaterThanByteString - , greaterThanEqualsByteString - , sha2_256 - , sha3_256 - , blake2b_256 - , verifyEd25519Signature - , verifyEcdsaSecp256k1Signature - , verifySchnorrSecp256k1Signature - , decodeUtf8 - -- * Integer builtins - , Integer - , addInteger - , subtractInteger - , multiplyInteger - , divideInteger - , modInteger - , quotientInteger - , remainderInteger - , greaterThanInteger - , greaterThanEqualsInteger - , lessThanInteger - , lessThanEqualsInteger - , equalsInteger - -- * Error - , error - -- * Data - , BuiltinData - , chooseData - , matchData - , matchData' - , equalsData - , serialiseData - , mkConstr - , mkMap - , mkList - , mkI - , mkB - , unsafeDataAsConstr - , unsafeDataAsMap - , unsafeDataAsList - , unsafeDataAsI - , unsafeDataAsB - , BI.builtinDataToData - , BI.dataToBuiltinData - -- * Strings - , BuiltinString - , appendString - , emptyString - , equalsString - , encodeUtf8 - -- * Lists - , matchList - -- * Tracing - , trace - -- * Conversions - , fromBuiltin - , toBuiltin - ) where + -- * Bytestring builtins + BuiltinByteString + , appendByteString + , consByteString + , sliceByteString + , lengthOfByteString + , indexByteString + , emptyByteString + , equalsByteString + , lessThanByteString + , lessThanEqualsByteString + , greaterThanByteString + , greaterThanEqualsByteString + , sha2_256 + , sha3_256 + , blake2b_256 + , verifyEd25519Signature + , verifyEcdsaSecp256k1Signature + , verifySchnorrSecp256k1Signature + , decodeUtf8 + -- * Integer builtins + , Integer + , addInteger + , subtractInteger + , multiplyInteger + , divideInteger + , modInteger + , quotientInteger + , remainderInteger + , greaterThanInteger + , greaterThanEqualsInteger + , lessThanInteger + , lessThanEqualsInteger + , equalsInteger + -- * Error + , error + -- * Data + , BuiltinData + , chooseData + , matchData + , matchData' + , equalsData + , serialiseData + , mkConstr + , mkMap + , mkList + , mkI + , mkB + , unsafeDataAsConstr + , unsafeDataAsMap + , unsafeDataAsList + , unsafeDataAsI + , unsafeDataAsB + , BI.builtinDataToData + , BI.dataToBuiltinData + -- * Strings + , BuiltinString + , appendString + , emptyString + , equalsString + , encodeUtf8 + -- * Lists + , matchList + -- * Tracing + , trace + -- * BLS12_381 + , BuiltinBLS12_381_G1_Element + , bls12_381_G1_equals + , bls12_381_G1_add + , bls12_381_G1_scalarMul + , bls12_381_G1_neg + , bls12_381_G1_compress + , bls12_381_G1_uncompress + , bls12_381_G1_hashToGroup + , BuiltinBLS12_381_G2_Element + , bls12_381_G2_equals + , bls12_381_G2_add + , bls12_381_G2_scalarMul + , bls12_381_G2_neg + , bls12_381_G2_compress + , bls12_381_G2_uncompress + , bls12_381_G2_hashToGroup + , BuiltinBLS12_381_MlResult + , bls12_381_millerLoop + , bls12_381_mulMlResult + , bls12_381_finalVerify + -- * Conversions + , fromBuiltin + , toBuiltin + ) where import PlutusTx.Base (const, uncurry) import PlutusTx.Bool (Bool (..)) import PlutusTx.Builtins.Class -import PlutusTx.Builtins.Internal (BuiltinByteString (..), BuiltinData, BuiltinString) +import PlutusTx.Builtins.Internal (BuiltinBLS12_381_G1_Element (..), + BuiltinBLS12_381_G2_Element (..), BuiltinBLS12_381_MlResult (..), + BuiltinByteString (..), BuiltinData, BuiltinString) import PlutusTx.Builtins.Internal qualified as BI import PlutusTx.Integer (Integer) @@ -444,3 +467,76 @@ matchData' d constrCase mapCase listCase iCase bCase = (\_ -> iCase (unsafeDataAsI d)) (\_ -> bCase (unsafeDataAsB d)) () + +-- G1 -- +{-# INLINABLE bls12_381_G1_equals #-} +bls12_381_G1_equals :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> Bool +bls12_381_G1_equals a b = fromBuiltin (BI.bls12_381_G1_equals a b) + +{-# INLINABLE bls12_381_G1_add #-} +bls12_381_G1_add :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element +bls12_381_G1_add = BI.bls12_381_G1_add + +{-# INLINABLE bls12_381_G1_scalarMul #-} +bls12_381_G1_scalarMul :: Integer -> BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element +bls12_381_G1_scalarMul = BI.bls12_381_G1_scalarMul + +{-# INLINABLE bls12_381_G1_neg #-} +bls12_381_G1_neg :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element +bls12_381_G1_neg = BI.bls12_381_G1_neg + +{-# INLINABLE bls12_381_G1_compress #-} +bls12_381_G1_compress :: BuiltinBLS12_381_G1_Element -> BuiltinByteString +bls12_381_G1_compress = BI.bls12_381_G1_compress + +{-# INLINABLE bls12_381_G1_uncompress #-} +bls12_381_G1_uncompress :: BuiltinByteString -> BuiltinBLS12_381_G1_Element +bls12_381_G1_uncompress = BI.bls12_381_G1_uncompress + +{-# INLINABLE bls12_381_G1_hashToGroup #-} +bls12_381_G1_hashToGroup :: BuiltinByteString -> BuiltinByteString -> BuiltinBLS12_381_G1_Element +bls12_381_G1_hashToGroup = BI.bls12_381_G1_hashToGroup + +-- G2 -- +{-# INLINABLE bls12_381_G2_equals #-} +bls12_381_G2_equals :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> Bool +bls12_381_G2_equals a b = fromBuiltin (BI.bls12_381_G2_equals a b) + +{-# INLINABLE bls12_381_G2_add #-} +bls12_381_G2_add :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element +bls12_381_G2_add = BI.bls12_381_G2_add + +{-# INLINABLE bls12_381_G2_scalarMul #-} +bls12_381_G2_scalarMul :: Integer -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element +bls12_381_G2_scalarMul = BI.bls12_381_G2_scalarMul + +{-# INLINABLE bls12_381_G2_neg #-} +bls12_381_G2_neg :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element +bls12_381_G2_neg = BI.bls12_381_G2_neg + +{-# INLINABLE bls12_381_G2_compress #-} +bls12_381_G2_compress :: BuiltinBLS12_381_G2_Element -> BuiltinByteString +bls12_381_G2_compress = BI.bls12_381_G2_compress + +{-# INLINABLE bls12_381_G2_uncompress #-} +bls12_381_G2_uncompress :: BuiltinByteString -> BuiltinBLS12_381_G2_Element +bls12_381_G2_uncompress = BI.bls12_381_G2_uncompress + +{-# INLINABLE bls12_381_G2_hashToGroup #-} +bls12_381_G2_hashToGroup :: BuiltinByteString -> BuiltinByteString -> BuiltinBLS12_381_G2_Element +bls12_381_G2_hashToGroup = BI.bls12_381_G2_hashToGroup + +-- Pairing -- +{-# INLINABLE bls12_381_millerLoop #-} +bls12_381_millerLoop :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_MlResult +bls12_381_millerLoop = BI.bls12_381_millerLoop + +{-# INLINABLE bls12_381_mulMlResult #-} +bls12_381_mulMlResult :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult +bls12_381_mulMlResult = BI.bls12_381_mulMlResult + +{-# INLINABLE bls12_381_finalVerify #-} +bls12_381_finalVerify :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> Bool +bls12_381_finalVerify a b = fromBuiltin (BI.bls12_381_finalVerify a b) + + diff --git a/plutus-tx/src/PlutusTx/Builtins/Class.hs b/plutus-tx/src/PlutusTx/Builtins/Class.hs index 8f09e991488..c90b82952e4 100644 --- a/plutus-tx/src/PlutusTx/Builtins/Class.hs +++ b/plutus-tx/src/PlutusTx/Builtins/Class.hs @@ -19,6 +19,9 @@ import Data.String (IsString (..)) import Data.Text (Text, pack) import GHC.Magic qualified as Magic +import PlutusCore.Crypto.BLS12_381.G1 qualified as BLS12_381.G1 (Element) +import PlutusCore.Crypto.BLS12_381.G2 qualified as BLS12_381.G2 (Element) +import PlutusCore.Crypto.BLS12_381.Pairing qualified as BLS12_381.Pairing (MlResult) import PlutusTx.Base (const, id, ($)) import PlutusTx.Bool (Bool (..)) import PlutusTx.Integer (Integer) @@ -195,3 +198,26 @@ instance FromBuiltin BuiltinData BuiltinData where instance ToBuiltin BuiltinData BuiltinData where {-# INLINABLE toBuiltin #-} toBuiltin = id + +instance FromBuiltin BuiltinBLS12_381_G1_Element BLS12_381.G1.Element where + {-# INLINABLE fromBuiltin #-} + fromBuiltin (BuiltinBLS12_381_G1_Element a) = a +instance ToBuiltin BLS12_381.G1.Element BuiltinBLS12_381_G1_Element where + {-# INLINABLE toBuiltin #-} + toBuiltin = BuiltinBLS12_381_G1_Element + +instance FromBuiltin BuiltinBLS12_381_G2_Element BLS12_381.G2.Element where + {-# INLINABLE fromBuiltin #-} + fromBuiltin (BuiltinBLS12_381_G2_Element a) = a +instance ToBuiltin BLS12_381.G2.Element BuiltinBLS12_381_G2_Element where + {-# INLINABLE toBuiltin #-} + toBuiltin = BuiltinBLS12_381_G2_Element + +instance FromBuiltin BuiltinBLS12_381_MlResult BLS12_381.Pairing.MlResult where + {-# INLINABLE fromBuiltin #-} + fromBuiltin (BuiltinBLS12_381_MlResult a) = a +instance ToBuiltin BLS12_381.Pairing.MlResult BuiltinBLS12_381_MlResult where + {-# INLINABLE toBuiltin #-} + toBuiltin = BuiltinBLS12_381_MlResult + + diff --git a/plutus-tx/src/PlutusTx/Builtins/Internal.hs b/plutus-tx/src/PlutusTx/Builtins/Internal.hs index 69a4ba915f2..059c82570c8 100644 --- a/plutus-tx/src/PlutusTx/Builtins/Internal.hs +++ b/plutus-tx/src/PlutusTx/Builtins/Internal.hs @@ -17,7 +17,6 @@ module PlutusTx.Builtins.Internal where import Codec.Serialise import Control.DeepSeq (NFData (..)) import Control.Monad.Trans.Writer.Strict (runWriter) -import Crypto qualified import Data.ByteArray qualified as BA import Data.ByteString qualified as BS import Data.ByteString.Hash qualified as Hash @@ -30,12 +29,18 @@ import Data.Kind (Type) import Data.Text as Text (Text, empty) import Data.Text.Encoding as Text (decodeUtf8, encodeUtf8) import PlutusCore.Builtin.Emitter (Emitter (Emitter)) +import PlutusCore.Crypto.BLS12_381.G1 qualified as BLS12_381.G1 +import PlutusCore.Crypto.BLS12_381.G2 qualified as BLS12_381.G2 +import PlutusCore.Crypto.BLS12_381.Pairing qualified as BLS12_381.Pairing +import PlutusCore.Crypto.Ed25519 qualified +import PlutusCore.Crypto.Secp256k1 qualified import PlutusCore.Data qualified as PLC import PlutusCore.Evaluation.Result (EvaluationResult (EvaluationFailure, EvaluationSuccess)) import PlutusCore.Pretty (Pretty (..)) import PlutusTx.Utils (mustBeReplaced) import Prettyprinter (viaShow) + {- We do not use qualified import because the whole module contains off-chain code which is replaced later with on-chain implementations by the plutus-tx-plugin. @@ -241,7 +246,7 @@ blake2b_256 (BuiltinByteString b) = BuiltinByteString $ Hash.blake2b_256 b {-# NOINLINE verifyEd25519Signature #-} verifyEd25519Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> BuiltinBool verifyEd25519Signature (BuiltinByteString vk) (BuiltinByteString msg) (BuiltinByteString sig) = - case Crypto.verifyEd25519Signature_V1 vk msg sig of + case PlutusCore.Crypto.Ed25519.verifyEd25519Signature_V1 vk msg sig of Emitter f -> case runWriter f of (res, logs) -> traceAll logs $ case res of EvaluationFailure -> mustBeReplaced "Ed25519 signature verification errored." @@ -254,7 +259,7 @@ verifyEcdsaSecp256k1Signature :: BuiltinByteString -> BuiltinBool verifyEcdsaSecp256k1Signature (BuiltinByteString vk) (BuiltinByteString msg) (BuiltinByteString sig) = - case Crypto.verifyEcdsaSecp256k1Signature vk msg sig of + case PlutusCore.Crypto.Secp256k1.verifyEcdsaSecp256k1Signature vk msg sig of Emitter f -> case runWriter f of (res, logs) -> traceAll logs $ case res of EvaluationFailure -> mustBeReplaced "ECDSA SECP256k1 signature verification errored." @@ -267,7 +272,7 @@ verifySchnorrSecp256k1Signature :: BuiltinByteString -> BuiltinBool verifySchnorrSecp256k1Signature (BuiltinByteString vk) (BuiltinByteString msg) (BuiltinByteString sig) = - case Crypto.verifySchnorrSecp256k1Signature vk msg sig of + case PlutusCore.Crypto.Secp256k1.verifySchnorrSecp256k1Signature vk msg sig of Emitter f -> case runWriter f of (res, logs) -> traceAll logs $ case res of EvaluationFailure -> mustBeReplaced "Schnorr SECP256k1 signature verification errored." @@ -505,3 +510,145 @@ equalsData (BuiltinData b1) (BuiltinData b2) = BuiltinBool $ b1 Haskell.== b2 {-# NOINLINE serialiseData #-} serialiseData :: BuiltinData -> BuiltinByteString serialiseData (BuiltinData b) = BuiltinByteString $ BSL.toStrict $ serialise b + + +{- +BLS12_381 +-} + +{- | Note [Wrapping the BLS12-381 types in PlutusTx] + +As explained in Note [Wrapping the BLS12-381 types in Plutus Core], the types +exported by the Haskell bindings for the `blst` library are ForeignPtrs which +have to be wrapped in newtypes to keep the PLC builtin machinery happy. +However, there's a further complication in PlutusTx: if you try to use the +newtypes directly then the plugin sees through the newtypes to the foreign +pointers and fails because it doesn't know how to handle them. To avoid this we +further wrap the newtypes in datatypes here. We could have done this in Plutus +Core by using `data` instead of `newtype`, but then the code here dealing with +BLS types and builtins doesn't look like the code for the other builtins. +Because of this it seemed safer and more uniform to add the datatype wrapper +here rather than in the Plutus Core code. +-} + +---------------- G1 ---------------- + +data BuiltinBLS12_381_G1_Element = BuiltinBLS12_381_G1_Element BLS12_381.G1.Element + +instance Haskell.Show BuiltinBLS12_381_G1_Element where + show (BuiltinBLS12_381_G1_Element a) = show a +instance Haskell.Eq BuiltinBLS12_381_G1_Element where + (==) (BuiltinBLS12_381_G1_Element a) (BuiltinBLS12_381_G1_Element b) = (==) a b +instance NFData BuiltinBLS12_381_G1_Element where + rnf (BuiltinBLS12_381_G1_Element d) = rnf d +instance Pretty BuiltinBLS12_381_G1_Element where + pretty (BuiltinBLS12_381_G1_Element a) = pretty a + +{-# NOINLINE bls12_381_G1_equals #-} +bls12_381_G1_equals :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> BuiltinBool +bls12_381_G1_equals a b = BuiltinBool $ coerce ((==) @BuiltinBLS12_381_G1_Element) a b + +{-# NOINLINE bls12_381_G1_add #-} +bls12_381_G1_add :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element +bls12_381_G1_add (BuiltinBLS12_381_G1_Element a) (BuiltinBLS12_381_G1_Element b) = BuiltinBLS12_381_G1_Element (BLS12_381.G1.add a b) + +{-# NOINLINE bls12_381_G1_neg #-} +bls12_381_G1_neg :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element +bls12_381_G1_neg (BuiltinBLS12_381_G1_Element a) = BuiltinBLS12_381_G1_Element (BLS12_381.G1.neg a) + +{-# NOINLINE bls12_381_G1_scalarMul #-} +bls12_381_G1_scalarMul :: BuiltinInteger -> BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element +bls12_381_G1_scalarMul n (BuiltinBLS12_381_G1_Element a) = BuiltinBLS12_381_G1_Element (BLS12_381.G1.scalarMul n a) + +{-# NOINLINE bls12_381_G1_compress #-} +bls12_381_G1_compress :: BuiltinBLS12_381_G1_Element -> BuiltinByteString +bls12_381_G1_compress (BuiltinBLS12_381_G1_Element a) = BuiltinByteString (BLS12_381.G1.compress a) + +{-# NOINLINE bls12_381_G1_uncompress #-} +bls12_381_G1_uncompress :: BuiltinByteString -> BuiltinBLS12_381_G1_Element +bls12_381_G1_uncompress (BuiltinByteString b) = + case BLS12_381.G1.uncompress b of + Left err -> mustBeReplaced $ "BSL12_381 G1 uncompression error: " ++ show err + Right a -> BuiltinBLS12_381_G1_Element a + +{-# NOINLINE bls12_381_G1_hashToGroup #-} +bls12_381_G1_hashToGroup :: BuiltinByteString -> BuiltinByteString -> BuiltinBLS12_381_G1_Element +bls12_381_G1_hashToGroup (BuiltinByteString msg) (BuiltinByteString dst) = + case BLS12_381.G1.hashToGroup msg dst of + Left err -> mustBeReplaced $ show err + Right p -> BuiltinBLS12_381_G1_Element p + +---------------- G2 ---------------- + +data BuiltinBLS12_381_G2_Element = BuiltinBLS12_381_G2_Element BLS12_381.G2.Element + +instance Haskell.Show BuiltinBLS12_381_G2_Element where + show (BuiltinBLS12_381_G2_Element a) = show a +instance Haskell.Eq BuiltinBLS12_381_G2_Element where + (==) (BuiltinBLS12_381_G2_Element a) (BuiltinBLS12_381_G2_Element b) = (==) a b +instance NFData BuiltinBLS12_381_G2_Element where + rnf (BuiltinBLS12_381_G2_Element d) = rnf d +instance Pretty BuiltinBLS12_381_G2_Element where + pretty (BuiltinBLS12_381_G2_Element a) = pretty a + +{-# NOINLINE bls12_381_G2_equals #-} +bls12_381_G2_equals :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBool +bls12_381_G2_equals a b = BuiltinBool $ coerce ((==) @BuiltinBLS12_381_G2_Element) a b + +{-# NOINLINE bls12_381_G2_add #-} +bls12_381_G2_add :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element +bls12_381_G2_add (BuiltinBLS12_381_G2_Element a) (BuiltinBLS12_381_G2_Element b) = BuiltinBLS12_381_G2_Element (BLS12_381.G2.add a b) + +{-# NOINLINE bls12_381_G2_neg #-} +bls12_381_G2_neg :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element +bls12_381_G2_neg (BuiltinBLS12_381_G2_Element a) = BuiltinBLS12_381_G2_Element (BLS12_381.G2.neg a) + +{-# NOINLINE bls12_381_G2_scalarMul #-} +bls12_381_G2_scalarMul :: BuiltinInteger -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element +bls12_381_G2_scalarMul n (BuiltinBLS12_381_G2_Element a) = BuiltinBLS12_381_G2_Element (BLS12_381.G2.scalarMul n a) + +{-# NOINLINE bls12_381_G2_compress #-} +bls12_381_G2_compress :: BuiltinBLS12_381_G2_Element -> BuiltinByteString +bls12_381_G2_compress (BuiltinBLS12_381_G2_Element a) = BuiltinByteString (BLS12_381.G2.compress a) + +{-# NOINLINE bls12_381_G2_uncompress #-} +bls12_381_G2_uncompress :: BuiltinByteString -> BuiltinBLS12_381_G2_Element +bls12_381_G2_uncompress (BuiltinByteString b) = + case BLS12_381.G2.uncompress b of + Left err -> mustBeReplaced $ "BSL12_381 G2 uncompression error: " ++ show err + Right a -> BuiltinBLS12_381_G2_Element a + +{-# NOINLINE bls12_381_G2_hashToGroup #-} +bls12_381_G2_hashToGroup :: BuiltinByteString -> BuiltinByteString -> BuiltinBLS12_381_G2_Element +bls12_381_G2_hashToGroup (BuiltinByteString msg) (BuiltinByteString dst) = + case BLS12_381.G2.hashToGroup msg dst of + Left err -> mustBeReplaced $ show err + Right p -> BuiltinBLS12_381_G2_Element p + +---------------- Pairing ---------------- + +data BuiltinBLS12_381_MlResult = BuiltinBLS12_381_MlResult BLS12_381.Pairing.MlResult + +instance Haskell.Show BuiltinBLS12_381_MlResult where + show (BuiltinBLS12_381_MlResult a) = show a +instance Haskell.Eq BuiltinBLS12_381_MlResult where + (==) (BuiltinBLS12_381_MlResult a) (BuiltinBLS12_381_MlResult b) = (==) a b +instance NFData BuiltinBLS12_381_MlResult where + rnf (BuiltinBLS12_381_MlResult a) = rnf a +instance Pretty BuiltinBLS12_381_MlResult where + pretty (BuiltinBLS12_381_MlResult a) = pretty a + +{-# NOINLINE bls12_381_millerLoop #-} +bls12_381_millerLoop :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_MlResult +bls12_381_millerLoop (BuiltinBLS12_381_G1_Element a) (BuiltinBLS12_381_G2_Element b) = + BuiltinBLS12_381_MlResult $ BLS12_381.Pairing.millerLoop a b + +{-# NOINLINE bls12_381_mulMlResult #-} +bls12_381_mulMlResult :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult +bls12_381_mulMlResult (BuiltinBLS12_381_MlResult a) (BuiltinBLS12_381_MlResult b) + = BuiltinBLS12_381_MlResult $ BLS12_381.Pairing.mulMlResult a b + +{-# NOINLINE bls12_381_finalVerify #-} +bls12_381_finalVerify :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> BuiltinBool +bls12_381_finalVerify (BuiltinBLS12_381_MlResult a) (BuiltinBLS12_381_MlResult b) + = BuiltinBool $ BLS12_381.Pairing.finalVerify a b diff --git a/plutus-tx/src/PlutusTx/Lift/Class.hs b/plutus-tx/src/PlutusTx/Lift/Class.hs index 626e452e1da..44dc5555eb5 100644 --- a/plutus-tx/src/PlutusTx/Lift/Class.hs +++ b/plutus-tx/src/PlutusTx/Lift/Class.hs @@ -23,6 +23,9 @@ import PlutusIR import PlutusIR.Compiler.Definitions import PlutusCore qualified as PLC +import PlutusCore.Crypto.BLS12_381.G1 (Element) +import PlutusCore.Crypto.BLS12_381.G2 (Element) +import PlutusCore.Crypto.BLS12_381.Pairing (MlResult) import PlutusCore.Data import PlutusCore.Quote import PlutusIR.MkPir @@ -161,3 +164,12 @@ instance uni `PLC.Includes` T.Text => Lift uni BuiltinString where instance (FromBuiltin arep a, uni `PLC.Includes` [a]) => Lift uni (BuiltinList arep) where lift b = liftBuiltin $ fromBuiltin b + +instance uni `PLC.Includes` PlutusCore.Crypto.BLS12_381.G1.Element => Lift uni BuiltinBLS12_381_G1_Element where + lift a = liftBuiltin $ fromBuiltin a + +instance uni `PLC.Includes` PlutusCore.Crypto.BLS12_381.G2.Element => Lift uni BuiltinBLS12_381_G2_Element where + lift a = liftBuiltin $ fromBuiltin a + +instance uni `PLC.Includes` PlutusCore.Crypto.BLS12_381.Pairing.MlResult => Lift uni BuiltinBLS12_381_MlResult where + lift a = liftBuiltin $ fromBuiltin a diff --git a/plutus-tx/src/PlutusTx/Prelude.hs b/plutus-tx/src/PlutusTx/Prelude.hs index 78f2b2de210..238360297fa 100644 --- a/plutus-tx/src/PlutusTx/Prelude.hs +++ b/plutus-tx/src/PlutusTx/Prelude.hs @@ -78,6 +78,28 @@ module PlutusTx.Prelude ( round, -- * Data BuiltinData, + -- * BLS12_381 + BuiltinBLS12_381_G1_Element, + bls12_381_G1_equals, + bls12_381_G1_add, + bls12_381_G1_neg, + bls12_381_G1_scalarMul, + bls12_381_G1_compress, + bls12_381_G1_uncompress, + bls12_381_G1_hashToGroup, + BuiltinBLS12_381_G2_Element, + bls12_381_G2_equals, + bls12_381_G2_add, + bls12_381_G2_neg, + bls12_381_G2_scalarMul, + bls12_381_G2_compress, + bls12_381_G2_uncompress, + bls12_381_G2_hashToGroup, + BuiltinBLS12_381_MlResult, + bls12_381_millerLoop, + bls12_381_mulMlResult, + bls12_381_finalVerify, + -- * Conversions fromBuiltin, toBuiltin ) where @@ -87,13 +109,21 @@ import PlutusCore.Data (Data (..)) import PlutusTx.Applicative as Applicative import PlutusTx.Base as Base import PlutusTx.Bool as Bool -import PlutusTx.Builtins (BuiltinByteString, BuiltinData, BuiltinString, Integer, appendByteString, - appendString, consByteString, decodeUtf8, emptyByteString, emptyString, - encodeUtf8, equalsByteString, equalsString, error, fromBuiltin, - greaterThanByteString, indexByteString, lengthOfByteString, +import PlutusTx.Builtins (BuiltinBLS12_381_G1_Element, BuiltinBLS12_381_G2_Element, + BuiltinBLS12_381_MlResult, BuiltinByteString, BuiltinData, BuiltinString, + Integer, appendByteString, appendString, bls12_381_G1_add, + bls12_381_G1_compress, bls12_381_G1_equals, bls12_381_G1_hashToGroup, + bls12_381_G1_neg, bls12_381_G1_scalarMul, bls12_381_G1_uncompress, + bls12_381_G2_add, bls12_381_G2_compress, bls12_381_G2_equals, + bls12_381_G2_hashToGroup, bls12_381_G2_neg, bls12_381_G2_scalarMul, + bls12_381_G2_uncompress, bls12_381_finalVerify, bls12_381_millerLoop, + bls12_381_mulMlResult, consByteString, decodeUtf8, emptyByteString, + emptyString, encodeUtf8, equalsByteString, equalsString, error, + fromBuiltin, greaterThanByteString, indexByteString, lengthOfByteString, lessThanByteString, sha2_256, sha3_256, sliceByteString, toBuiltin, trace, verifyEcdsaSecp256k1Signature, verifyEd25519Signature, verifySchnorrSecp256k1Signature) + import PlutusTx.Builtins qualified as Builtins import PlutusTx.Either as Either import PlutusTx.Enum as Enum