2018-12-01 19:12:05 +00:00
|
|
|
|
packageName = "constantine"
|
2018-07-24 14:52:18 +00:00
|
|
|
|
version = "0.0.1"
|
|
|
|
|
author = "Status Research & Development GmbH"
|
2022-02-27 00:49:08 +00:00
|
|
|
|
description = "This library provides thoroughly tested and highly-optimized implementations of cryptography protocols."
|
2018-07-24 14:52:18 +00:00
|
|
|
|
license = "MIT or Apache License 2.0"
|
|
|
|
|
|
2020-06-15 20:58:56 +00:00
|
|
|
|
# Dependencies
|
|
|
|
|
# ----------------------------------------------------------------
|
|
|
|
|
|
2020-02-22 15:37:31 +00:00
|
|
|
|
requires "nim >= 1.1.0"
|
2018-07-24 14:52:18 +00:00
|
|
|
|
|
2020-06-15 20:58:56 +00:00
|
|
|
|
# Test config
|
|
|
|
|
# ----------------------------------------------------------------
|
|
|
|
|
|
2020-06-07 17:39:34 +00:00
|
|
|
|
const buildParallel = "test_parallel.txt"
|
|
|
|
|
|
2021-01-21 20:25:42 +00:00
|
|
|
|
# Testing strategy: to reduce CI time we test leaf functionality
|
|
|
|
|
# and skip testing codepath that would be exercised by leaves.
|
|
|
|
|
# While debugging, relevant unit-test can be reactivated.
|
|
|
|
|
# New features should stay on.
|
|
|
|
|
# Code refactoring requires re-enabling the full suite.
|
|
|
|
|
# Basic primitives should stay on to catch compiler regressions.
|
2020-06-15 20:58:56 +00:00
|
|
|
|
const testDesc: seq[tuple[path: string, useGMP: bool]] = @[
|
2022-09-15 07:33:34 +00:00
|
|
|
|
|
|
|
|
|
# Hashing vs OpenSSL
|
|
|
|
|
# ----------------------------------------------------------
|
|
|
|
|
("tests/t_hash_sha256_vs_openssl.nim", true), # skip OpenSSL tests on Windows
|
|
|
|
|
|
|
|
|
|
# Ciphers
|
|
|
|
|
# ----------------------------------------------------------
|
|
|
|
|
("tests/t_cipher_chacha20.nim", false),
|
|
|
|
|
|
|
|
|
|
# Message Authentication Code
|
|
|
|
|
# ----------------------------------------------------------
|
|
|
|
|
("tests/t_mac_poly1305.nim", false),
|
|
|
|
|
("tests/t_mac_hmac_sha256.nim", false),
|
|
|
|
|
|
|
|
|
|
# KDF
|
|
|
|
|
# ----------------------------------------------------------
|
|
|
|
|
("tests/t_kdf_hkdf.nim", false),
|
|
|
|
|
|
2020-06-15 20:58:56 +00:00
|
|
|
|
# Primitives
|
2021-01-21 20:25:42 +00:00
|
|
|
|
# ----------------------------------------------------------
|
2022-02-27 00:49:08 +00:00
|
|
|
|
("tests/math/t_primitives.nim", false),
|
|
|
|
|
("tests/math/t_primitives_extended_precision.nim", false),
|
2023-01-24 01:32:28 +00:00
|
|
|
|
|
2020-06-15 20:58:56 +00:00
|
|
|
|
# Big ints
|
2021-01-21 20:25:42 +00:00
|
|
|
|
# ----------------------------------------------------------
|
2022-02-27 00:49:08 +00:00
|
|
|
|
("tests/math/t_io_bigints.nim", false),
|
|
|
|
|
("tests/math/t_io_unsaturated.nim", false),
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_bigints.nim", false),
|
|
|
|
|
# ("tests/math/t_bigints_multimod.nim", false),
|
|
|
|
|
# ("tests/math/t_bigints_mod_vs_gmp.nim", true),
|
|
|
|
|
# ("tests/math/t_bigints_mul_vs_gmp.nim", true),
|
|
|
|
|
# ("tests/math/t_bigints_mul_high_words_vs_gmp.nim", true),
|
2023-01-24 01:32:28 +00:00
|
|
|
|
|
2020-06-15 20:58:56 +00:00
|
|
|
|
# Field
|
2021-01-21 20:25:42 +00:00
|
|
|
|
# ----------------------------------------------------------
|
2022-02-27 00:49:08 +00:00
|
|
|
|
("tests/math/t_io_fields", false),
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_finite_fields.nim", false),
|
|
|
|
|
# ("tests/math/t_finite_fields_conditional_arithmetic.nim", false),
|
|
|
|
|
# ("tests/math/t_finite_fields_mulsquare.nim", false),
|
|
|
|
|
# ("tests/math/t_finite_fields_sqrt.nim", false),
|
|
|
|
|
# ("tests/math/t_finite_fields_powinv.nim", false),
|
|
|
|
|
# ("tests/math/t_finite_fields_vs_gmp.nim", true),
|
2022-09-19 07:11:16 +00:00
|
|
|
|
# ("tests/math/t_fp_cubic_root.nim", false),
|
2023-01-24 01:32:28 +00:00
|
|
|
|
|
2021-02-09 21:57:45 +00:00
|
|
|
|
# Double-precision finite fields
|
2021-01-21 20:25:42 +00:00
|
|
|
|
# ----------------------------------------------------------
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_finite_fields_double_precision.nim", false),
|
2023-01-24 01:32:28 +00:00
|
|
|
|
|
2020-06-15 20:58:56 +00:00
|
|
|
|
# Towers of extension fields
|
2021-01-21 20:25:42 +00:00
|
|
|
|
# ----------------------------------------------------------
|
2022-09-19 07:11:16 +00:00
|
|
|
|
# ("tests/math/t_fp2.nim", false),
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_fp2_sqrt.nim", false),
|
|
|
|
|
# ("tests/math/t_fp4.nim", false),
|
|
|
|
|
# ("tests/math/t_fp6_bn254_nogami.nim", false),
|
|
|
|
|
# ("tests/math/t_fp6_bn254_snarks.nim", false),
|
|
|
|
|
# ("tests/math/t_fp6_bls12_377.nim", false),
|
|
|
|
|
# ("tests/math/t_fp6_bls12_381.nim", false),
|
|
|
|
|
# ("tests/math/t_fp6_bw6_761.nim", false),
|
|
|
|
|
# ("tests/math/t_fp12_bn254_nogami.nim", false),
|
|
|
|
|
# ("tests/math/t_fp12_bn254_snarks.nim", false),
|
|
|
|
|
# ("tests/math/t_fp12_bls12_377.nim", false),
|
|
|
|
|
# ("tests/math/t_fp12_bls12_381.nim", false),
|
|
|
|
|
# ("tests/math/t_fp12_exponentiation.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
("tests/math/t_fp12_anti_regression.nim", false),
|
|
|
|
|
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_fp4_frobenius.nim", false),
|
|
|
|
|
# ("tests/math/t_fp6_frobenius.nim", false),
|
|
|
|
|
# ("tests/math/t_fp12_frobenius.nim", false),
|
2022-02-10 13:05:07 +00:00
|
|
|
|
|
2023-01-24 01:32:28 +00:00
|
|
|
|
# Elliptic curve arithmetic
|
2022-02-10 13:05:07 +00:00
|
|
|
|
# ----------------------------------------------------------
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_conversion.nim", false),
|
2022-02-10 13:05:07 +00:00
|
|
|
|
|
2020-06-15 20:58:56 +00:00
|
|
|
|
# Elliptic curve arithmetic G1
|
2021-01-21 20:25:42 +00:00
|
|
|
|
# ----------------------------------------------------------
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g1_add_double.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g1_mul_sanity.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g1_mul_distri.nim", false),
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g1_mul_vs_ref.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g1_mixed_add.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g1_add_double.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g1_mul_sanity.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g1_mul_distri.nim", false),
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g1_mul_vs_ref.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g1_mixed_add.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_twedwards_prj_add_double", false),
|
|
|
|
|
# ("tests/math/t_ec_twedwards_prj_mul_sanity", false),
|
|
|
|
|
# ("tests/math/t_ec_twedwards_prj_mul_distri", false),
|
2023-01-24 01:32:28 +00:00
|
|
|
|
|
2021-12-29 00:54:17 +00:00
|
|
|
|
|
2020-06-15 20:58:56 +00:00
|
|
|
|
# Elliptic curve arithmetic G2
|
2021-01-21 20:25:42 +00:00
|
|
|
|
# ----------------------------------------------------------
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_add_double_bn254_snarks.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mul_sanity_bn254_snarks.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mul_distri_bn254_snarks.nim", false),
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bn254_snarks.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mixed_add_bn254_snarks.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_add_double_bls12_381.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mul_sanity_bls12_381.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mul_distri_bls12_381.nim", false),
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bls12_381.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mixed_add_bls12_381.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_add_double_bls12_377.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mul_sanity_bls12_377.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mul_distri_bls12_377.nim", false),
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bls12_377.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mixed_add_bls12_377.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_add_double_bw6_761.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mul_sanity_bw6_761.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mul_distri_bw6_761.nim", false),
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bw6_761.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_prj_g2_mixed_add_bw6_761.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_add_double_bn254_snarks.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mul_sanity_bn254_snarks.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mul_distri_bn254_snarks.nim", false),
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bn254_snarks.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mixed_add_bn254_snarks.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_add_double_bls12_381.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mul_sanity_bls12_381.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mul_distri_bls12_381.nim", false),
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bls12_381.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mixed_add_bls12_381.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_add_double_bls12_377.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mul_sanity_bls12_377.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mul_distri_bls12_377.nim", false),
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bls12_377.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mixed_add_bls12_377.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_add_double_bw6_761.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mul_sanity_bw6_761.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mul_distri_bw6_761.nim", false),
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bw6_761.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_shortw_jac_g2_mixed_add_bw6_761.nim", false),
|
2020-10-09 05:51:47 +00:00
|
|
|
|
|
2020-06-15 20:58:56 +00:00
|
|
|
|
# Elliptic curve arithmetic vs Sagemath
|
2021-01-21 20:25:42 +00:00
|
|
|
|
# ----------------------------------------------------------
|
2022-02-27 00:49:08 +00:00
|
|
|
|
("tests/math/t_ec_frobenius.nim", false),
|
|
|
|
|
("tests/math/t_ec_sage_bn254_nogami.nim", false),
|
|
|
|
|
("tests/math/t_ec_sage_bn254_snarks.nim", false),
|
|
|
|
|
("tests/math/t_ec_sage_bls12_377.nim", false),
|
|
|
|
|
("tests/math/t_ec_sage_bls12_381.nim", false),
|
2022-04-26 22:58:48 +00:00
|
|
|
|
("tests/math/t_ec_sage_pallas.nim", false),
|
|
|
|
|
("tests/math/t_ec_sage_vesta.nim", false),
|
2023-01-24 01:32:28 +00:00
|
|
|
|
|
2020-06-22 23:27:40 +00:00
|
|
|
|
# Edge cases highlighted by past bugs
|
2021-01-21 20:25:42 +00:00
|
|
|
|
# ----------------------------------------------------------
|
2022-02-27 00:49:08 +00:00
|
|
|
|
("tests/math/t_ec_shortw_prj_edge_cases.nim", false),
|
2022-01-03 13:12:58 +00:00
|
|
|
|
|
2022-10-29 20:43:40 +00:00
|
|
|
|
# Elliptic curve arithmetic - batch computation
|
|
|
|
|
# ----------------------------------------------------------
|
|
|
|
|
("tests/math/t_ec_shortw_prj_g1_batch_add.nim", false),
|
|
|
|
|
("tests/math/t_ec_shortw_jac_g1_batch_add.nim", false),
|
|
|
|
|
|
2022-01-03 13:12:58 +00:00
|
|
|
|
# Subgroups and cofactors
|
|
|
|
|
# ----------------------------------------------------------
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_ec_subgroups_bn254_nogami.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_subgroups_bn254_snarks.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_subgroups_bls12_377.nim", false),
|
|
|
|
|
# ("tests/math/t_ec_subgroups_bls12_381.nim", false),
|
2022-01-03 13:12:58 +00:00
|
|
|
|
|
2023-01-25 04:47:57 +00:00
|
|
|
|
# ("tests/math/t_pairing_bn254_nogami_gt_subgroup.nim", false),
|
|
|
|
|
# ("tests/math/t_pairing_bn254_snarks_gt_subgroup.nim", false),
|
|
|
|
|
# ("tests/math/t_pairing_bls12_377_gt_subgroup.nim", false),
|
|
|
|
|
# ("tests/math/t_pairing_bls12_381_gt_subgroup.nim", false),
|
|
|
|
|
# ("tests/math/t_pairing_bw6_761_gt_subgroup.nim", false),
|
2022-01-03 13:12:58 +00:00
|
|
|
|
|
2020-09-21 21:24:00 +00:00
|
|
|
|
# Pairing
|
2021-01-21 20:25:42 +00:00
|
|
|
|
# ----------------------------------------------------------
|
2022-02-27 00:49:08 +00:00
|
|
|
|
# ("tests/math/t_pairing_bls12_377_line_functions.nim", false),
|
|
|
|
|
# ("tests/math/t_pairing_bls12_381_line_functions.nim", false),
|
2022-09-19 07:11:16 +00:00
|
|
|
|
# ("tests/math/t_pairing_mul_fp12_by_lines.nim", false),
|
|
|
|
|
# ("tests/math/t_pairing_cyclotomic_subgroup.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
("tests/math/t_pairing_bn254_nogami_optate.nim", false),
|
|
|
|
|
("tests/math/t_pairing_bn254_snarks_optate.nim", false),
|
|
|
|
|
("tests/math/t_pairing_bls12_377_optate.nim", false),
|
|
|
|
|
("tests/math/t_pairing_bls12_381_optate.nim", false),
|
2022-05-08 17:01:23 +00:00
|
|
|
|
|
|
|
|
|
# Multi-Pairing
|
|
|
|
|
# ----------------------------------------------------------
|
|
|
|
|
("tests/math/t_pairing_bn254_nogami_multi.nim", false),
|
|
|
|
|
("tests/math/t_pairing_bn254_snarks_multi.nim", false),
|
2022-02-27 00:49:08 +00:00
|
|
|
|
("tests/math/t_pairing_bls12_381_multi.nim", false),
|
2021-01-21 23:09:52 +00:00
|
|
|
|
|
|
|
|
|
# Prime order fields
|
|
|
|
|
# ----------------------------------------------------------
|
2022-02-27 00:49:08 +00:00
|
|
|
|
("tests/math/t_fr.nim", false),
|
2022-02-21 00:04:53 +00:00
|
|
|
|
|
2022-04-26 19:24:07 +00:00
|
|
|
|
# Hashing to elliptic curves
|
|
|
|
|
# ----------------------------------------------------------
|
|
|
|
|
("tests/t_hash_to_field.nim", false),
|
2022-09-19 07:11:16 +00:00
|
|
|
|
# ("tests/t_hash_to_curve_random.nim", false),
|
2022-04-26 19:24:07 +00:00
|
|
|
|
("tests/t_hash_to_curve.nim", false),
|
|
|
|
|
|
2021-08-15 09:41:46 +00:00
|
|
|
|
# Protocols
|
|
|
|
|
# ----------------------------------------------------------
|
2022-02-21 00:04:53 +00:00
|
|
|
|
("tests/t_ethereum_evm_precompiles.nim", false),
|
2022-02-26 20:22:34 +00:00
|
|
|
|
("tests/t_blssig_pop_on_bls12381_g2.nim", false),
|
2022-08-16 10:07:57 +00:00
|
|
|
|
("tests/t_ethereum_eip2333_bls12381_key_derivation.nim", false),
|
2020-06-15 20:58:56 +00:00
|
|
|
|
]
|
|
|
|
|
|
2023-01-12 00:01:57 +00:00
|
|
|
|
const testDescNvidia: seq[string] = @[
|
|
|
|
|
"tests/gpu/t_nvidia_fp.nim",
|
|
|
|
|
]
|
|
|
|
|
|
2023-01-24 01:32:28 +00:00
|
|
|
|
const testDescThreadpool: seq[string] = @[
|
|
|
|
|
"constantine/platforms/threadpool/examples/e01_simple_tasks.nim",
|
|
|
|
|
"constantine/platforms/threadpool/examples/e02_parallel_pi.nim",
|
|
|
|
|
# "constantine/platforms/threadpool/benchmarks/bouncing_producer_consumer/threadpool_bpc.nim", # Need timing not implemented on Windows
|
|
|
|
|
"constantine/platforms/threadpool/benchmarks/dfs/threadpool_dfs.nim",
|
|
|
|
|
"constantine/platforms/threadpool/benchmarks/fibonacci/threadpool_fib.nim",
|
|
|
|
|
"constantine/platforms/threadpool/benchmarks/heat/threadpool_heat.nim",
|
|
|
|
|
# "constantine/platforms/threadpool/benchmarks/matmul_cache_oblivious/threadpool_matmul_co.nim",
|
|
|
|
|
"constantine/platforms/threadpool/benchmarks/nqueens/threadpool_nqueens.nim",
|
|
|
|
|
# "constantine/platforms/threadpool/benchmarks/single_task_producer/threadpool_spc.nim", # Need timing not implemented on Windows
|
|
|
|
|
]
|
|
|
|
|
|
2022-09-15 07:33:34 +00:00
|
|
|
|
const benchDesc = [
|
|
|
|
|
"bench_fp",
|
|
|
|
|
"bench_fp_double_precision",
|
|
|
|
|
"bench_fp2",
|
2022-09-18 13:26:42 +00:00
|
|
|
|
"bench_fp4",
|
2022-09-15 07:33:34 +00:00
|
|
|
|
"bench_fp6",
|
|
|
|
|
"bench_fp12",
|
|
|
|
|
"bench_ec_g1",
|
2022-10-29 20:43:40 +00:00
|
|
|
|
"bench_ec_g1_batch",
|
2022-09-15 07:33:34 +00:00
|
|
|
|
"bench_ec_g2",
|
|
|
|
|
"bench_pairing_bls12_377",
|
|
|
|
|
"bench_pairing_bls12_381",
|
|
|
|
|
"bench_pairing_bn254_nogami",
|
|
|
|
|
"bench_pairing_bn254_snarks",
|
|
|
|
|
"bench_summary_bls12_377",
|
|
|
|
|
"bench_summary_bls12_381",
|
|
|
|
|
"bench_summary_bn254_nogami",
|
|
|
|
|
"bench_summary_bn254_snarks",
|
2022-09-18 13:26:42 +00:00
|
|
|
|
"bench_summary_pasta",
|
2022-09-18 22:41:37 +00:00
|
|
|
|
"bench_poly1305",
|
2022-09-15 07:33:34 +00:00
|
|
|
|
"bench_sha256",
|
2022-09-18 13:26:42 +00:00
|
|
|
|
"bench_hash_to_curve",
|
|
|
|
|
"bench_blssig_on_bls12_381_g2"
|
2022-09-15 07:33:34 +00:00
|
|
|
|
]
|
|
|
|
|
|
2020-06-19 20:08:15 +00:00
|
|
|
|
# For temporary (hopefully) investigation that can only be reproduced in CI
|
|
|
|
|
const useDebug = [
|
2022-02-27 00:49:08 +00:00
|
|
|
|
"tests/math/t_bigints.nim",
|
|
|
|
|
"tests/math/t_hash_sha256_vs_openssl.nim",
|
2020-12-15 18:18:36 +00:00
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# Tests that uses sequences require Nim GC, stack scanning and nil pointer passed to openarray
|
|
|
|
|
# In particular the tests that uses the json test vectors, don't sanitize them.
|
|
|
|
|
# we do use gc:none to help
|
|
|
|
|
const skipSanitizers = [
|
2022-02-27 00:49:08 +00:00
|
|
|
|
"tests/math/t_ec_sage_bn254_nogami.nim",
|
|
|
|
|
"tests/math/t_ec_sage_bn254_snarks.nim",
|
|
|
|
|
"tests/math/t_ec_sage_bls12_377.nim",
|
|
|
|
|
"tests/math/t_ec_sage_bls12_381.nim",
|
2022-10-29 20:43:40 +00:00
|
|
|
|
"tests/t_blssig_pop_on_bls12381_g2.nim",
|
2022-04-26 19:24:07 +00:00
|
|
|
|
"tests/t_hash_to_field.nim",
|
|
|
|
|
"tests/t_hash_to_curve.nim",
|
2022-08-16 10:07:57 +00:00
|
|
|
|
"tests/t_hash_to_curve_random.nim",
|
|
|
|
|
"tests/t_mac_poly1305.nim",
|
|
|
|
|
"tests/t_mac_hmac.nim",
|
|
|
|
|
"tests/t_kdf_hkdf.nim",
|
2022-10-29 20:43:40 +00:00
|
|
|
|
"tests/t_ethereum_eip2333_bls12381_key_derivation.nim"
|
2020-06-19 20:08:15 +00:00
|
|
|
|
]
|
|
|
|
|
|
2021-01-21 20:25:42 +00:00
|
|
|
|
when defined(windows):
|
|
|
|
|
# UBSAN is not available on mingw
|
|
|
|
|
const sanitizers = ""
|
|
|
|
|
else:
|
|
|
|
|
const sanitizers =
|
|
|
|
|
" --passC:-fsanitize=undefined --passL:-fsanitize=undefined" &
|
|
|
|
|
" --passC:-fno-sanitize-recover" & # Enforce crash on undefined behaviour
|
|
|
|
|
" --gc:none" # The conservative stack scanning of Nim default GC triggers, alignment UB and stack-buffer-overflow check.
|
|
|
|
|
# " --passC:-fsanitize=address --passL:-fsanitize=address" & # Requires too much stack for the inline assembly
|
2020-12-15 18:18:36 +00:00
|
|
|
|
|
2020-06-19 20:08:15 +00:00
|
|
|
|
|
2020-06-15 20:58:56 +00:00
|
|
|
|
# Helper functions
|
|
|
|
|
# ----------------------------------------------------------------
|
|
|
|
|
|
2020-12-15 18:18:36 +00:00
|
|
|
|
proc clearParallelBuild() =
|
2022-09-15 07:33:34 +00:00
|
|
|
|
# Support clearing from non POSIX shell like CMD, Powershell or MSYS2
|
|
|
|
|
if fileExists(buildParallel):
|
|
|
|
|
rmFile(buildParallel)
|
2020-12-15 18:18:36 +00:00
|
|
|
|
|
2023-01-24 01:32:28 +00:00
|
|
|
|
template setupCommand(): untyped {.dirty.} =
|
2020-02-23 17:27:26 +00:00
|
|
|
|
var lang = "c"
|
|
|
|
|
if existsEnv"TEST_LANG":
|
|
|
|
|
lang = getEnv"TEST_LANG"
|
|
|
|
|
|
2020-03-16 15:33:51 +00:00
|
|
|
|
var cc = ""
|
|
|
|
|
if existsEnv"CC":
|
|
|
|
|
cc = " --cc:" & getEnv"CC"
|
|
|
|
|
|
2021-01-21 20:25:42 +00:00
|
|
|
|
var flags = flags
|
|
|
|
|
when not defined(windows):
|
|
|
|
|
# Not available in MinGW https://github.com/libressl-portable/portable/issues/54
|
2022-10-29 20:43:40 +00:00
|
|
|
|
flags &= " --passC:-fstack-protector-strong"
|
|
|
|
|
let command = "nim " & lang & cc & " -d:release " & flags &
|
2020-08-22 21:00:05 +00:00
|
|
|
|
" --verbosity:0 --outdir:build/testsuite -r --hints:off --warnings:off " &
|
|
|
|
|
" --nimcache:nimcache/" & path & " " &
|
|
|
|
|
path
|
2020-06-07 17:39:34 +00:00
|
|
|
|
|
2022-09-15 07:33:34 +00:00
|
|
|
|
proc test(cmd: string) =
|
|
|
|
|
echo "\n=============================================================================================="
|
|
|
|
|
echo "Running '", cmd, "'"
|
|
|
|
|
echo "=============================================================================================="
|
|
|
|
|
exec cmd
|
2018-07-24 14:52:18 +00:00
|
|
|
|
|
2022-09-15 07:33:34 +00:00
|
|
|
|
proc testBatch(commands: var string, flags, path: string) =
|
|
|
|
|
setupCommand()
|
|
|
|
|
commands &= command & '\n'
|
2020-04-15 17:46:25 +00:00
|
|
|
|
|
2022-09-15 07:33:34 +00:00
|
|
|
|
template setupBench(): untyped {.dirty.} =
|
2021-01-21 20:25:42 +00:00
|
|
|
|
let runFlag = if run: " -r "
|
2022-09-15 07:33:34 +00:00
|
|
|
|
else: " "
|
|
|
|
|
|
|
|
|
|
var lang = " c "
|
|
|
|
|
if existsEnv"TEST_LANG":
|
|
|
|
|
lang = getEnv"TEST_LANG"
|
2021-01-21 20:25:42 +00:00
|
|
|
|
|
2020-04-15 17:46:25 +00:00
|
|
|
|
var cc = ""
|
|
|
|
|
if compiler != "":
|
2020-08-20 08:21:39 +00:00
|
|
|
|
cc = "--cc:" & compiler
|
2022-09-15 07:33:34 +00:00
|
|
|
|
elif existsEnv"CC":
|
|
|
|
|
cc = " --cc:" & getEnv"CC"
|
|
|
|
|
|
2020-08-20 08:21:39 +00:00
|
|
|
|
if not useAsm:
|
2021-02-01 02:52:27 +00:00
|
|
|
|
cc &= " -d:CttASM=false"
|
2022-09-15 07:33:34 +00:00
|
|
|
|
let command = "nim " & lang & cc &
|
2020-08-22 21:00:05 +00:00
|
|
|
|
" -d:danger --verbosity:0 -o:build/bench/" & benchName & "_" & compiler & "_" & (if useAsm: "useASM" else: "noASM") &
|
2022-09-15 15:11:57 +00:00
|
|
|
|
" --nimcache:nimcache/benches/" & benchName & "_" & compiler & "_" & (if useAsm: "useASM" else: "noASM") &
|
2021-01-21 20:25:42 +00:00
|
|
|
|
runFlag & "--hints:off --warnings:off benchmarks/" & benchName & ".nim"
|
|
|
|
|
|
|
|
|
|
proc runBench(benchName: string, compiler = "", useAsm = true) =
|
2022-09-15 07:33:34 +00:00
|
|
|
|
if not dirExists "build":
|
|
|
|
|
mkDir "build"
|
|
|
|
|
let run = true
|
|
|
|
|
setupBench()
|
|
|
|
|
exec command
|
2020-04-15 17:46:25 +00:00
|
|
|
|
|
2022-09-15 07:33:34 +00:00
|
|
|
|
proc buildBenchBatch(commands: var string, benchName: string, compiler = "", useAsm = true) =
|
|
|
|
|
let run = false
|
|
|
|
|
let compiler = ""
|
|
|
|
|
setupBench()
|
|
|
|
|
commands &= command & '\n'
|
|
|
|
|
|
|
|
|
|
proc addTestSet(cmdFile: var string, requireGMP: bool, test32bit = false, testASM = true) =
|
|
|
|
|
if not dirExists "build":
|
|
|
|
|
mkDir "build"
|
|
|
|
|
echo "Found " & $testDesc.len & " tests to run."
|
2023-01-24 01:32:28 +00:00
|
|
|
|
|
2020-12-15 18:18:36 +00:00
|
|
|
|
for td in testDesc:
|
|
|
|
|
if not(td.useGMP and not requireGMP):
|
|
|
|
|
var flags = ""
|
|
|
|
|
if not testASM:
|
2021-02-01 02:52:27 +00:00
|
|
|
|
flags &= " -d:CttASM=false"
|
2020-12-15 18:18:36 +00:00
|
|
|
|
if test32bit:
|
|
|
|
|
flags &= " -d:Constantine32"
|
|
|
|
|
if td.path in useDebug:
|
|
|
|
|
flags &= " -d:debugConstantine"
|
|
|
|
|
if td.path notin skipSanitizers:
|
|
|
|
|
flags &= sanitizers
|
2023-01-24 01:32:28 +00:00
|
|
|
|
|
2022-09-15 07:33:34 +00:00
|
|
|
|
cmdFile.testBatch(flags, td.path)
|
|
|
|
|
|
2023-01-12 00:01:57 +00:00
|
|
|
|
proc addTestSetNvidia(cmdFile: var string) =
|
|
|
|
|
if not dirExists "build":
|
|
|
|
|
mkDir "build"
|
|
|
|
|
echo "Found " & $testDescNvidia.len & " tests to run."
|
2023-01-24 01:32:28 +00:00
|
|
|
|
|
2023-01-12 00:01:57 +00:00
|
|
|
|
for path in testDescNvidia:
|
|
|
|
|
cmdFile.testBatch(flags = "", path)
|
|
|
|
|
|
2023-01-24 01:32:28 +00:00
|
|
|
|
proc addTestSetThreadpool(cmdFile: var string) =
|
|
|
|
|
if not dirExists "build":
|
|
|
|
|
mkDir "build"
|
|
|
|
|
echo "Found " & $testDescThreadpool.len & " tests to run."
|
|
|
|
|
|
|
|
|
|
for path in testDescThreadpool:
|
|
|
|
|
cmdFile.testBatch(flags = "--threads:on --linetrace:on", path)
|
|
|
|
|
|
2022-09-15 07:33:34 +00:00
|
|
|
|
proc addBenchSet(cmdFile: var string, useAsm = true) =
|
|
|
|
|
if not dirExists "build":
|
|
|
|
|
mkDir "build"
|
|
|
|
|
echo "Found " & $benchDesc.len & " benches to compile. (compile-only to ensure they stay relevant)"
|
|
|
|
|
for bd in benchDesc:
|
|
|
|
|
cmdFile.buildBenchBatch(bd, useASM = useASM)
|
2021-01-21 23:09:52 +00:00
|
|
|
|
|
2022-09-15 15:11:57 +00:00
|
|
|
|
proc genDynamicBindings(bindingsName, prefixNimMain: string) =
|
2022-08-06 17:05:54 +00:00
|
|
|
|
proc compile(libName: string, flags = "") =
|
|
|
|
|
# -d:danger to avoid boundsCheck, overflowChecks that would trigger exceptions or allocations in a crypto library.
|
|
|
|
|
# Those are internally guaranteed at compile-time by fixed-sized array
|
|
|
|
|
# and checked at runtime with an appropriate error code if any for user-input.
|
|
|
|
|
# -gc:arc Constantine stack allocates everything. Inputs are through unmanaged ptr+len.
|
|
|
|
|
# In the future, Constantine might use:
|
|
|
|
|
# - heap-allocated sequences and objects manually managed or managed by destructors for multithreading.
|
|
|
|
|
# - heap-allocated strings for hex-string or decimal strings
|
2022-09-15 15:11:57 +00:00
|
|
|
|
echo "Compiling dynamic library: bindings/generated/" & libName
|
2022-08-06 17:05:54 +00:00
|
|
|
|
exec "nim c -f " & flags & " --noMain -d:danger --app:lib --gc:arc " &
|
2022-09-15 15:11:57 +00:00
|
|
|
|
" --verbosity:0 --hints:off --warnings:off " &
|
2022-08-06 17:05:54 +00:00
|
|
|
|
" --nimMainPrefix:" & prefixNimMain &
|
|
|
|
|
" --out:" & libName & " --outdir:bindings/generated " &
|
|
|
|
|
" --nimcache:nimcache/bindings/" & bindingsName &
|
|
|
|
|
" bindings/" & bindingsName & ".nim"
|
|
|
|
|
|
|
|
|
|
when defined(windows):
|
|
|
|
|
compile bindingsName & ".dll"
|
|
|
|
|
|
|
|
|
|
elif defined(macosx):
|
|
|
|
|
compile "lib" & bindingsName & ".dylib.arm", "--cpu:arm64 -l:'-target arm64-apple-macos11' -t:'-target arm64-apple-macos11'"
|
|
|
|
|
compile "lib" & bindingsName & ".dylib.x64", "--cpu:amd64 -l:'-target x86_64-apple-macos10.12' -t:'-target x86_64-apple-macos10.12'"
|
|
|
|
|
exec "lipo bindings/generated/lib" & bindingsName & ".dylib.arm " &
|
|
|
|
|
" bindings/generated/lib" & bindingsName & ".dylib.x64 " &
|
|
|
|
|
" -output bindings/generated/lib" & bindingsName & ".dylib -create"
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
compile "lib" & bindingsName & ".so"
|
|
|
|
|
|
2022-09-15 15:11:57 +00:00
|
|
|
|
proc genStaticBindings(bindingsName, prefixNimMain: string) =
|
|
|
|
|
proc compile(libName: string, flags = "") =
|
|
|
|
|
# -d:danger to avoid boundsCheck, overflowChecks that would trigger exceptions or allocations in a crypto library.
|
|
|
|
|
# Those are internally guaranteed at compile-time by fixed-sized array
|
|
|
|
|
# and checked at runtime with an appropriate error code if any for user-input.
|
|
|
|
|
# -gc:arc Constantine stack allocates everything. Inputs are through unmanaged ptr+len.
|
|
|
|
|
# In the future, Constantine might use:
|
|
|
|
|
# - heap-allocated sequences and objects manually managed or managed by destructors for multithreading.
|
|
|
|
|
# - heap-allocated strings for hex-string or decimal strings
|
|
|
|
|
echo "Compiling static library: bindings/generated/" & libName
|
|
|
|
|
exec "nim c -f " & flags & " --noMain -d:danger --app:staticLib --gc:arc " &
|
|
|
|
|
" --verbosity:0 --hints:off --warnings:off " &
|
|
|
|
|
" --nimMainPrefix:" & prefixNimMain &
|
|
|
|
|
" --out:" & libName & " --outdir:bindings/generated " &
|
|
|
|
|
" --nimcache:nimcache/bindings/" & bindingsName &
|
|
|
|
|
" bindings/" & bindingsName & ".nim"
|
|
|
|
|
|
|
|
|
|
when defined(windows):
|
|
|
|
|
compile bindingsName & ".lib"
|
|
|
|
|
|
|
|
|
|
elif defined(macosx):
|
|
|
|
|
compile "lib" & bindingsName & ".a.arm", "--cpu:arm64 -l:'-target arm64-apple-macos11' -t:'-target arm64-apple-macos11'"
|
|
|
|
|
compile "lib" & bindingsName & ".a.x64", "--cpu:amd64 -l:'-target x86_64-apple-macos10.12' -t:'-target x86_64-apple-macos10.12'"
|
|
|
|
|
exec "lipo bindings/generated/lib" & bindingsName & ".a.arm " &
|
|
|
|
|
" bindings/generated/lib" & bindingsName & ".a.x64 " &
|
|
|
|
|
" -output bindings/generated/lib" & bindingsName & ".a -create"
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
compile "lib" & bindingsName & ".a"
|
|
|
|
|
|
2022-08-06 17:05:54 +00:00
|
|
|
|
proc genHeaders(bindingsName: string) =
|
2022-09-15 15:11:57 +00:00
|
|
|
|
echo "Generating header: bindings/generated/" & bindingsName & ".h"
|
|
|
|
|
exec "nim c -d:release -d:CttGenerateHeaders " &
|
|
|
|
|
" --verbosity:0 --hints:off --warnings:off " &
|
2022-08-06 17:05:54 +00:00
|
|
|
|
" --out:" & bindingsName & "_gen_header.exe --outdir:bindings/generated " &
|
|
|
|
|
" --nimcache:nimcache/bindings/" & bindingsName & "_header" &
|
|
|
|
|
" bindings/" & bindingsName & ".nim"
|
2022-09-15 15:11:57 +00:00
|
|
|
|
exec "bindings/generated/" & bindingsName & "_gen_header.exe bindings/generated"
|
2022-08-06 17:05:54 +00:00
|
|
|
|
|
2022-09-15 07:33:34 +00:00
|
|
|
|
proc genParallelCmdRunner() =
|
|
|
|
|
exec "nim c --verbosity:0 --hints:off --warnings:off -d:release --out:build/pararun --nimcache:nimcache/pararun helpers/pararun.nim"
|
|
|
|
|
|
2020-06-15 20:58:56 +00:00
|
|
|
|
# Tasks
|
|
|
|
|
# ----------------------------------------------------------------
|
|
|
|
|
|
2022-08-06 17:05:54 +00:00
|
|
|
|
task bindings, "Generate Constantine bindings":
|
2022-09-15 15:11:57 +00:00
|
|
|
|
genDynamicBindings("constantine_bls12_381", "ctt_bls12381_init_")
|
|
|
|
|
genStaticBindings("constantine_bls12_381", "ctt_bls12381_init_")
|
2022-08-06 17:05:54 +00:00
|
|
|
|
genHeaders("constantine_bls12_381")
|
2022-09-15 15:11:57 +00:00
|
|
|
|
echo ""
|
|
|
|
|
genDynamicBindings("constantine_pasta", "ctt_pasta_init_")
|
|
|
|
|
genStaticBindings("constantine_pasta", "ctt_pasta_init_")
|
2022-08-06 17:05:54 +00:00
|
|
|
|
genHeaders("constantine_pasta")
|
|
|
|
|
|
2022-09-15 15:11:57 +00:00
|
|
|
|
task test_bindings, "Test C bindings":
|
|
|
|
|
exec "mkdir -p build/testsuite"
|
|
|
|
|
echo "--> Testing dynamically linked library"
|
|
|
|
|
when not defined(windows):
|
|
|
|
|
exec "gcc -Ibindings/generated -Lbindings/generated -o build/testsuite/t_libctt_bls12_381_dl tests/bindings/t_libctt_bls12_381.c -lgmp -lconstantine_bls12_381"
|
|
|
|
|
exec "LD_LIBRARY_PATH=bindings/generated ./build/testsuite/t_libctt_bls12_381_dl"
|
|
|
|
|
else:
|
|
|
|
|
# Put DLL near the exe as LD_LIBRARY_PATH doesn't work even in an POSIX compatible shell
|
|
|
|
|
exec "gcc -Ibindings/generated -Lbindings/generated -o build/testsuite/t_libctt_bls12_381_dl.exe tests/bindings/t_libctt_bls12_381.c -lgmp -lconstantine_bls12_381"
|
|
|
|
|
exec "./build/testsuite/t_libctt_bls12_381_dl.exe"
|
2023-01-24 01:32:28 +00:00
|
|
|
|
|
2022-09-15 15:11:57 +00:00
|
|
|
|
echo "--> Testing statically linked library"
|
|
|
|
|
when not defined(windows):
|
|
|
|
|
# Beware MacOS annoying linker with regards to static libraries
|
|
|
|
|
# The following standard way cannot be used on MacOS
|
|
|
|
|
# exec "gcc -Ibindings/generated -Lbindings/generated -o build/t_libctt_bls12_381_sl.exe tests/bindings/t_libctt_bls12_381.c -lgmp -Wl,-Bstatic -lconstantine_bls12_381 -Wl,-Bdynamic"
|
2023-01-24 01:32:28 +00:00
|
|
|
|
|
2022-09-15 15:11:57 +00:00
|
|
|
|
exec "gcc -Ibindings/generated -o build/testsuite/t_libctt_bls12_381_sl tests/bindings/t_libctt_bls12_381.c bindings/generated/libconstantine_bls12_381.a -lgmp"
|
|
|
|
|
exec "./build/testsuite/t_libctt_bls12_381_sl"
|
|
|
|
|
else:
|
|
|
|
|
exec "gcc -Ibindings/generated -o build/testsuite/t_libctt_bls12_381_sl.exe tests/bindings/t_libctt_bls12_381.c bindings/generated/constantine_bls12_381.lib -lgmp"
|
|
|
|
|
exec "./build/testsuite/t_libctt_bls12_381_sl.exe"
|
|
|
|
|
|
2018-07-24 14:52:18 +00:00
|
|
|
|
task test, "Run all tests":
|
2020-02-23 17:27:26 +00:00
|
|
|
|
# -d:testingCurves is configured in a *.nim.cfg for convenience
|
2022-09-15 07:33:34 +00:00
|
|
|
|
var cmdFile: string
|
|
|
|
|
cmdFile.addTestSet(requireGMP = true, testASM = true)
|
|
|
|
|
cmdFile.addBenchSet(useASM = true) # Build (but don't run) benches to ensure they stay relevant
|
2023-01-24 01:32:28 +00:00
|
|
|
|
cmdFile.addTestSetThreadpool()
|
2022-09-15 07:33:34 +00:00
|
|
|
|
for cmd in cmdFile.splitLines():
|
2023-01-24 01:32:28 +00:00
|
|
|
|
if cmd != "": # Windows doesn't like empty commands
|
|
|
|
|
exec cmd
|
2020-04-15 17:46:25 +00:00
|
|
|
|
|
2022-09-15 07:33:34 +00:00
|
|
|
|
task test_no_asm, "Run all tests (no assembly)":
|
2021-01-24 11:35:27 +00:00
|
|
|
|
# -d:testingCurves is configured in a *.nim.cfg for convenience
|
2022-09-15 07:33:34 +00:00
|
|
|
|
var cmdFile: string
|
|
|
|
|
cmdFile.addTestSet(requireGMP = true, testASM = false)
|
|
|
|
|
cmdFile.addBenchSet(useASM = false) # Build (but don't run) benches to ensure they stay relevant
|
2023-01-24 01:32:28 +00:00
|
|
|
|
cmdFile.addTestSetThreadpool()
|
2022-09-15 07:33:34 +00:00
|
|
|
|
for cmd in cmdFile.splitLines():
|
2023-01-24 01:32:28 +00:00
|
|
|
|
if cmd != "": # Windows doesn't like empty commands
|
|
|
|
|
exec cmd
|
2021-01-24 11:35:27 +00:00
|
|
|
|
|
2020-02-23 17:27:26 +00:00
|
|
|
|
task test_no_gmp, "Run tests that don't require GMP":
|
|
|
|
|
# -d:testingCurves is configured in a *.nim.cfg for convenience
|
2022-09-15 07:33:34 +00:00
|
|
|
|
var cmdFile: string
|
|
|
|
|
cmdFile.addTestSet(requireGMP = false, testASM = true)
|
|
|
|
|
cmdFile.addBenchSet(useASM = true) # Build (but don't run) benches to ensure they stay relevant
|
2023-01-24 01:32:28 +00:00
|
|
|
|
cmdFile.addTestSetThreadpool()
|
2022-09-15 07:33:34 +00:00
|
|
|
|
for cmd in cmdFile.splitLines():
|
2023-01-24 01:32:28 +00:00
|
|
|
|
if cmd != "": # Windows doesn't like empty commands
|
|
|
|
|
exec cmd
|
2020-03-20 22:03:52 +00:00
|
|
|
|
|
2022-09-15 07:33:34 +00:00
|
|
|
|
task test_no_gmp_no_asm, "Run tests that don't require GMP using a pure Nim backend":
|
2022-02-20 22:44:00 +00:00
|
|
|
|
# -d:testingCurves is configured in a *.nim.cfg for convenience
|
2022-09-15 07:33:34 +00:00
|
|
|
|
var cmdFile: string
|
|
|
|
|
cmdFile.addTestSet(requireGMP = false, testASM = false)
|
|
|
|
|
cmdFile.addBenchSet(useASM = false) # Build (but don't run) benches to ensure they stay relevant
|
2023-01-24 01:32:28 +00:00
|
|
|
|
cmdFile.addTestSetThreadpool()
|
2022-09-15 07:33:34 +00:00
|
|
|
|
for cmd in cmdFile.splitLines():
|
2023-01-24 01:32:28 +00:00
|
|
|
|
if cmd != "": # Windows doesn't like empty commands
|
|
|
|
|
exec cmd
|
2022-02-20 22:44:00 +00:00
|
|
|
|
|
2020-06-07 17:39:34 +00:00
|
|
|
|
task test_parallel, "Run all tests in parallel (via GNU parallel)":
|
|
|
|
|
# -d:testingCurves is configured in a *.nim.cfg for convenience
|
2020-12-15 18:18:36 +00:00
|
|
|
|
clearParallelBuild()
|
2022-09-15 07:33:34 +00:00
|
|
|
|
genParallelCmdRunner()
|
|
|
|
|
|
|
|
|
|
var cmdFile: string
|
|
|
|
|
cmdFile.addTestSet(requireGMP = true, testASM = true)
|
|
|
|
|
cmdFile.addBenchSet(useASM = true) # Build (but don't run) benches to ensure they stay relevant
|
|
|
|
|
writeFile(buildParallel, cmdFile)
|
|
|
|
|
exec "build/pararun " & buildParallel
|
|
|
|
|
|
2023-01-24 01:32:28 +00:00
|
|
|
|
# Threadpool tests done serially
|
|
|
|
|
cmdFile = ""
|
|
|
|
|
cmdFile.addTestSetThreadpool()
|
|
|
|
|
for cmd in cmdFile.splitLines():
|
|
|
|
|
if cmd != "": # Windows doesn't like empty commands
|
|
|
|
|
exec cmd
|
|
|
|
|
|
2022-09-15 07:33:34 +00:00
|
|
|
|
task test_parallel_no_asm, "Run all tests (without macro assembler) in parallel (via GNU parallel)":
|
2020-07-24 20:02:30 +00:00
|
|
|
|
# -d:testingCurves is configured in a *.nim.cfg for convenience
|
2020-12-15 18:18:36 +00:00
|
|
|
|
clearParallelBuild()
|
2022-09-15 07:33:34 +00:00
|
|
|
|
genParallelCmdRunner()
|
|
|
|
|
|
|
|
|
|
var cmdFile: string
|
|
|
|
|
cmdFile.addTestSet(requireGMP = true, testASM = false)
|
|
|
|
|
cmdFile.addBenchSet(useASM = false)
|
|
|
|
|
writeFile(buildParallel, cmdFile)
|
|
|
|
|
exec "build/pararun " & buildParallel
|
2020-07-24 20:02:30 +00:00
|
|
|
|
|
2023-01-24 01:32:28 +00:00
|
|
|
|
# Threadpool tests done serially
|
|
|
|
|
cmdFile = ""
|
|
|
|
|
cmdFile.addTestSetThreadpool()
|
|
|
|
|
for cmd in cmdFile.splitLines():
|
|
|
|
|
if cmd != "": # Windows doesn't like empty commands
|
|
|
|
|
exec cmd
|
|
|
|
|
|
2020-06-20 17:46:30 +00:00
|
|
|
|
task test_parallel_no_gmp, "Run all tests in parallel (via GNU parallel)":
|
|
|
|
|
# -d:testingCurves is configured in a *.nim.cfg for convenience
|
2020-12-15 18:18:36 +00:00
|
|
|
|
clearParallelBuild()
|
2022-09-15 07:33:34 +00:00
|
|
|
|
genParallelCmdRunner()
|
|
|
|
|
|
|
|
|
|
var cmdFile: string
|
|
|
|
|
cmdFile.addTestSet(requireGMP = false, testASM = true)
|
|
|
|
|
cmdFile.addBenchSet(useASM = true) # Build (but don't run) benches to ensure they stay relevant
|
|
|
|
|
writeFile(buildParallel, cmdFile)
|
|
|
|
|
exec "build/pararun " & buildParallel
|
|
|
|
|
|
2023-01-24 01:32:28 +00:00
|
|
|
|
# Threadpool tests done serially
|
|
|
|
|
cmdFile = ""
|
|
|
|
|
cmdFile.addTestSetThreadpool()
|
|
|
|
|
for cmd in cmdFile.splitLines():
|
|
|
|
|
if cmd != "": # Windows doesn't like empty commands
|
|
|
|
|
exec cmd
|
|
|
|
|
|
2022-09-15 07:33:34 +00:00
|
|
|
|
task test_parallel_no_gmp_no_asm, "Run all tests in parallel (via GNU parallel)":
|
2020-09-21 21:24:00 +00:00
|
|
|
|
# -d:testingCurves is configured in a *.nim.cfg for convenience
|
2020-12-15 18:18:36 +00:00
|
|
|
|
clearParallelBuild()
|
2022-09-15 07:33:34 +00:00
|
|
|
|
genParallelCmdRunner()
|
|
|
|
|
|
|
|
|
|
var cmdFile: string
|
|
|
|
|
cmdFile.addTestSet(requireGMP = false, testASM = false)
|
|
|
|
|
cmdFile.addBenchSet(useASM = false) # Build (but don't run) benches to ensure they stay relevant
|
|
|
|
|
writeFile(buildParallel, cmdFile)
|
|
|
|
|
exec "build/pararun " & buildParallel
|
2020-06-07 17:39:34 +00:00
|
|
|
|
|
2023-01-24 01:32:28 +00:00
|
|
|
|
# Threadpool tests done serially
|
|
|
|
|
cmdFile = ""
|
|
|
|
|
cmdFile.addTestSetThreadpool()
|
|
|
|
|
for cmd in cmdFile.splitLines():
|
|
|
|
|
if cmd != "": # Windows doesn't like empty commands
|
|
|
|
|
exec cmd
|
|
|
|
|
|
|
|
|
|
task test_threadpool, "Run all tests for the builtin threadpool":
|
|
|
|
|
var cmdFile: string
|
|
|
|
|
cmdFile.addTestSetThreadpool()
|
|
|
|
|
for cmd in cmdFile.splitLines():
|
|
|
|
|
if cmd != "": # Windows doesn't like empty commands
|
|
|
|
|
exec cmd
|
|
|
|
|
|
2023-01-12 00:01:57 +00:00
|
|
|
|
task test_nvidia, "Run all tests for Nvidia GPUs":
|
|
|
|
|
var cmdFile: string
|
|
|
|
|
cmdFile.addTestSetNvidia()
|
|
|
|
|
for cmd in cmdFile.splitLines():
|
2023-01-24 01:32:28 +00:00
|
|
|
|
if cmd != "": # Windows doesn't like empty commands
|
|
|
|
|
exec cmd
|
2023-01-12 00:01:57 +00:00
|
|
|
|
|
2021-02-14 13:24:48 +00:00
|
|
|
|
# Finite field 𝔽p
|
|
|
|
|
# ------------------------------------------
|
|
|
|
|
|
2020-03-21 01:31:31 +00:00
|
|
|
|
task bench_fp, "Run benchmark 𝔽p with your default compiler":
|
|
|
|
|
runBench("bench_fp")
|
|
|
|
|
|
|
|
|
|
task bench_fp_gcc, "Run benchmark 𝔽p with gcc":
|
|
|
|
|
runBench("bench_fp", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_fp_clang, "Run benchmark 𝔽p with clang":
|
|
|
|
|
runBench("bench_fp", "clang")
|
|
|
|
|
|
2020-08-20 08:21:39 +00:00
|
|
|
|
task bench_fp_gcc_noasm, "Run benchmark 𝔽p with gcc - no Assembly":
|
|
|
|
|
runBench("bench_fp", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_fp_clang_noasm, "Run benchmark 𝔽p with clang - no Assembly":
|
|
|
|
|
runBench("bench_fp", "clang", useAsm = false)
|
|
|
|
|
|
2021-02-14 13:24:48 +00:00
|
|
|
|
# Double-precision field 𝔽pDbl
|
|
|
|
|
# ------------------------------------------
|
|
|
|
|
|
2020-08-20 08:21:39 +00:00
|
|
|
|
task bench_fpdbl, "Run benchmark 𝔽pDbl with your default compiler":
|
2021-02-09 21:57:45 +00:00
|
|
|
|
runBench("bench_fp_double_precision")
|
2020-08-20 08:21:39 +00:00
|
|
|
|
|
|
|
|
|
task bench_fpdbl_gcc, "Run benchmark 𝔽p with gcc":
|
2021-02-09 21:57:45 +00:00
|
|
|
|
runBench("bench_fp_double_precision", "gcc")
|
2020-08-20 08:21:39 +00:00
|
|
|
|
|
|
|
|
|
task bench_fpdbl_clang, "Run benchmark 𝔽p with clang":
|
2021-02-09 21:57:45 +00:00
|
|
|
|
runBench("bench_fp_double_precision", "clang")
|
2020-08-20 08:21:39 +00:00
|
|
|
|
|
|
|
|
|
task bench_fpdbl_gcc_noasm, "Run benchmark 𝔽p with gcc - no Assembly":
|
2021-02-09 21:57:45 +00:00
|
|
|
|
runBench("bench_fp_double_precision", "gcc", useAsm = false)
|
2020-08-20 08:21:39 +00:00
|
|
|
|
|
|
|
|
|
task bench_fpdbl_clang_noasm, "Run benchmark 𝔽p with clang - no Assembly":
|
2021-02-09 21:57:45 +00:00
|
|
|
|
runBench("bench_fp_double_precision", "clang", useAsm = false)
|
2020-08-20 08:21:39 +00:00
|
|
|
|
|
2021-02-14 13:24:48 +00:00
|
|
|
|
# Extension field 𝔽p2
|
|
|
|
|
# ------------------------------------------
|
|
|
|
|
|
2020-03-21 01:31:31 +00:00
|
|
|
|
task bench_fp2, "Run benchmark with 𝔽p2 your default compiler":
|
|
|
|
|
runBench("bench_fp2")
|
|
|
|
|
|
|
|
|
|
task bench_fp2_gcc, "Run benchmark 𝔽p2 with gcc":
|
|
|
|
|
runBench("bench_fp2", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_fp2_clang, "Run benchmark 𝔽p2 with clang":
|
|
|
|
|
runBench("bench_fp2", "clang")
|
|
|
|
|
|
2020-08-20 08:21:39 +00:00
|
|
|
|
task bench_fp2_gcc_noasm, "Run benchmark 𝔽p2 with gcc - no Assembly":
|
|
|
|
|
runBench("bench_fp2", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_fp2_clang_noasm, "Run benchmark 𝔽p2 with clang - no Assembly":
|
|
|
|
|
runBench("bench_fp2", "clang", useAsm = false)
|
|
|
|
|
|
2021-02-14 13:24:48 +00:00
|
|
|
|
# Extension field 𝔽p4
|
|
|
|
|
# ------------------------------------------
|
|
|
|
|
|
2020-10-01 22:01:09 +00:00
|
|
|
|
task bench_fp4, "Run benchmark with 𝔽p4 your default compiler":
|
|
|
|
|
runBench("bench_fp4")
|
|
|
|
|
|
|
|
|
|
task bench_fp4_gcc, "Run benchmark 𝔽p4 with gcc":
|
|
|
|
|
runBench("bench_fp4", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_fp4_clang, "Run benchmark 𝔽p4 with clang":
|
|
|
|
|
runBench("bench_fp4", "clang")
|
|
|
|
|
|
|
|
|
|
task bench_fp4_gcc_noasm, "Run benchmark 𝔽p4 with gcc - no Assembly":
|
|
|
|
|
runBench("bench_fp4", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_fp4_clang_noasm, "Run benchmark 𝔽p4 with clang - no Assembly":
|
|
|
|
|
runBench("bench_fp4", "clang", useAsm = false)
|
|
|
|
|
|
2021-02-14 13:24:48 +00:00
|
|
|
|
# Extension field 𝔽p6
|
|
|
|
|
# ------------------------------------------
|
|
|
|
|
|
2020-03-21 01:31:31 +00:00
|
|
|
|
task bench_fp6, "Run benchmark with 𝔽p6 your default compiler":
|
|
|
|
|
runBench("bench_fp6")
|
|
|
|
|
|
|
|
|
|
task bench_fp6_gcc, "Run benchmark 𝔽p6 with gcc":
|
|
|
|
|
runBench("bench_fp6", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_fp6_clang, "Run benchmark 𝔽p6 with clang":
|
|
|
|
|
runBench("bench_fp6", "clang")
|
2020-04-09 12:28:01 +00:00
|
|
|
|
|
2020-08-20 08:21:39 +00:00
|
|
|
|
task bench_fp6_gcc_noasm, "Run benchmark 𝔽p6 with gcc - no Assembly":
|
|
|
|
|
runBench("bench_fp6", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_fp6_clang_noasm, "Run benchmark 𝔽p6 with clang - no Assembly":
|
|
|
|
|
runBench("bench_fp6", "clang", useAsm = false)
|
|
|
|
|
|
2021-02-14 13:24:48 +00:00
|
|
|
|
# Extension field 𝔽p12
|
|
|
|
|
# ------------------------------------------
|
|
|
|
|
|
2020-04-09 12:28:01 +00:00
|
|
|
|
task bench_fp12, "Run benchmark with 𝔽p12 your default compiler":
|
|
|
|
|
runBench("bench_fp12")
|
|
|
|
|
|
|
|
|
|
task bench_fp12_gcc, "Run benchmark 𝔽p12 with gcc":
|
|
|
|
|
runBench("bench_fp12", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_fp12_clang, "Run benchmark 𝔽p12 with clang":
|
|
|
|
|
runBench("bench_fp12", "clang")
|
2020-04-15 17:43:31 +00:00
|
|
|
|
|
2020-08-20 08:21:39 +00:00
|
|
|
|
task bench_fp12_gcc_noasm, "Run benchmark 𝔽p12 with gcc - no Assembly":
|
|
|
|
|
runBench("bench_fp12", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_fp12_clang_noasm, "Run benchmark 𝔽p12 with clang - no Assembly":
|
|
|
|
|
runBench("bench_fp12", "clang", useAsm = false)
|
|
|
|
|
|
2021-02-14 13:24:48 +00:00
|
|
|
|
# Elliptic curve G1
|
|
|
|
|
# ------------------------------------------
|
|
|
|
|
|
2022-10-29 20:43:40 +00:00
|
|
|
|
task bench_ec_g1, "Run benchmark on Elliptic Curve group 𝔾1 - Default compiler":
|
2020-06-14 13:39:06 +00:00
|
|
|
|
runBench("bench_ec_g1")
|
2020-04-15 17:43:31 +00:00
|
|
|
|
|
2022-10-29 20:43:40 +00:00
|
|
|
|
task bench_ec_g1_gcc, "Run benchmark on Elliptic Curve group 𝔾1 - GCC":
|
2020-06-14 13:39:06 +00:00
|
|
|
|
runBench("bench_ec_g1", "gcc")
|
2020-04-15 17:43:31 +00:00
|
|
|
|
|
2022-10-29 20:43:40 +00:00
|
|
|
|
task bench_ec_g1_clang, "Run benchmark on Elliptic Curve group 𝔾1 - Clang":
|
2020-06-14 13:39:06 +00:00
|
|
|
|
runBench("bench_ec_g1", "clang")
|
2020-06-15 20:58:56 +00:00
|
|
|
|
|
2022-10-29 20:43:40 +00:00
|
|
|
|
task bench_ec_g1_gcc_noasm, "Run benchmark on Elliptic Curve group 𝔾1 - GCC no Assembly":
|
2020-08-20 08:21:39 +00:00
|
|
|
|
runBench("bench_ec_g1", "gcc", useAsm = false)
|
|
|
|
|
|
2022-10-29 20:43:40 +00:00
|
|
|
|
task bench_ec_g1_clang_noasm, "Run benchmark on Elliptic Curve group 𝔾1 - Clang no Assembly":
|
|
|
|
|
runBench("bench_ec_g1", "clang", useAsm = false)
|
|
|
|
|
|
|
|
|
|
# Elliptic curve G1 - batch operations
|
|
|
|
|
# ------------------------------------------
|
|
|
|
|
|
|
|
|
|
task bench_ec_g1_batch, "Run benchmark on Elliptic Curve group 𝔾1 (batch ops) - Default compiler":
|
|
|
|
|
runBench("bench_ec_g1_batch")
|
|
|
|
|
|
|
|
|
|
task bench_ec_g1_batch_gcc, "Run benchmark on Elliptic Curve group 𝔾1 (batch ops) - GCC":
|
|
|
|
|
runBench("bench_ec_g1_batch", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_ec_g1_batch_clang, "Run benchmark on Elliptic Curve group 𝔾1 (batch ops) - Clang":
|
|
|
|
|
runBench("bench_ec_g1_batch", "clang")
|
|
|
|
|
|
|
|
|
|
task bench_ec_g1_batch_gcc_noasm, "Run benchmark on Elliptic Curve group 𝔾1 (batch ops) - GCC no Assembly":
|
|
|
|
|
runBench("bench_ec_g1_batch", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_ec_g1_batch_clang_noasm, "Run benchmark on Elliptic Curve group 𝔾1 (batch ops) - Clang no Assembly":
|
2020-08-20 08:21:39 +00:00
|
|
|
|
runBench("bench_ec_g1", "clang", useAsm = false)
|
|
|
|
|
|
2021-02-14 13:24:48 +00:00
|
|
|
|
# Elliptic curve G2
|
|
|
|
|
# ------------------------------------------
|
|
|
|
|
|
2022-10-29 20:43:40 +00:00
|
|
|
|
task bench_ec_g2, "Run benchmark on Elliptic Curve group 𝔾2 - Default compiler":
|
2020-06-15 20:58:56 +00:00
|
|
|
|
runBench("bench_ec_g2")
|
|
|
|
|
|
2022-10-29 20:43:40 +00:00
|
|
|
|
task bench_ec_g2_gcc, "Run benchmark on Elliptic Curve group 𝔾2 - GCC":
|
2020-06-15 20:58:56 +00:00
|
|
|
|
runBench("bench_ec_g2", "gcc")
|
|
|
|
|
|
2022-10-29 20:43:40 +00:00
|
|
|
|
task bench_ec_g2_clang, "Run benchmark on Elliptic Curve group 𝔾2 - Clang":
|
2020-06-15 20:58:56 +00:00
|
|
|
|
runBench("bench_ec_g2", "clang")
|
2020-08-20 08:21:39 +00:00
|
|
|
|
|
2022-10-29 20:43:40 +00:00
|
|
|
|
task bench_ec_g2_gcc_noasm, "Run benchmark on Elliptic Curve group 𝔾2 - GCC no Assembly":
|
2020-08-20 08:21:39 +00:00
|
|
|
|
runBench("bench_ec_g2", "gcc", useAsm = false)
|
|
|
|
|
|
2022-10-29 20:43:40 +00:00
|
|
|
|
task bench_ec_g2_clang_noasm, "Run benchmark on Elliptic Curve group 𝔾2 - Clang no Assembly":
|
2020-08-20 08:21:39 +00:00
|
|
|
|
runBench("bench_ec_g2", "clang", useAsm = false)
|
2020-09-24 15:18:23 +00:00
|
|
|
|
|
2021-02-14 13:24:48 +00:00
|
|
|
|
# Pairings
|
|
|
|
|
# ------------------------------------------
|
|
|
|
|
|
2020-09-27 07:15:14 +00:00
|
|
|
|
task bench_pairing_bls12_377, "Run pairings benchmarks for BLS12-377 - Default compiler":
|
|
|
|
|
runBench("bench_pairing_bls12_377")
|
|
|
|
|
|
|
|
|
|
task bench_pairing_bls12_377_gcc, "Run pairings benchmarks for BLS12-377 - GCC":
|
|
|
|
|
runBench("bench_pairing_bls12_377", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_pairing_bls12_377_clang, "Run pairings benchmarks for BLS12-377 - Clang":
|
|
|
|
|
runBench("bench_pairing_bls12_377", "clang")
|
|
|
|
|
|
|
|
|
|
task bench_pairing_bls12_377_gcc_noasm, "Run pairings benchmarks for BLS12-377 - GCC no Assembly":
|
|
|
|
|
runBench("bench_pairing_bls12_377", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_pairing_bls12_377_clang_noasm, "Run pairings benchmarks for BLS12-377 - Clang no Assembly":
|
|
|
|
|
runBench("bench_pairing_bls12_377", "clang", useAsm = false)
|
|
|
|
|
|
2021-02-14 13:24:48 +00:00
|
|
|
|
# --
|
|
|
|
|
|
2020-09-24 15:18:23 +00:00
|
|
|
|
task bench_pairing_bls12_381, "Run pairings benchmarks for BLS12-381 - Default compiler":
|
|
|
|
|
runBench("bench_pairing_bls12_381")
|
|
|
|
|
|
2020-09-25 19:58:20 +00:00
|
|
|
|
task bench_pairing_bls12_381_gcc, "Run pairings benchmarks for BLS12-381 - GCC":
|
2020-09-24 15:18:23 +00:00
|
|
|
|
runBench("bench_pairing_bls12_381", "gcc")
|
|
|
|
|
|
2020-09-25 19:58:20 +00:00
|
|
|
|
task bench_pairing_bls12_381_clang, "Run pairings benchmarks for BLS12-381 - Clang":
|
2020-09-24 15:18:23 +00:00
|
|
|
|
runBench("bench_pairing_bls12_381", "clang")
|
|
|
|
|
|
2020-09-25 19:58:20 +00:00
|
|
|
|
task bench_pairing_bls12_381_gcc_noasm, "Run pairings benchmarks for BLS12-381 - GCC no Assembly":
|
2020-09-24 15:18:23 +00:00
|
|
|
|
runBench("bench_pairing_bls12_381", "gcc", useAsm = false)
|
|
|
|
|
|
2020-09-25 19:58:20 +00:00
|
|
|
|
task bench_pairing_bls12_381_clang_noasm, "Run pairings benchmarks for BLS12-381 - Clang no Assembly":
|
2020-09-24 15:18:23 +00:00
|
|
|
|
runBench("bench_pairing_bls12_381", "clang", useAsm = false)
|
2020-09-25 19:58:20 +00:00
|
|
|
|
|
2021-02-14 13:24:48 +00:00
|
|
|
|
# --
|
|
|
|
|
|
2020-09-25 19:58:20 +00:00
|
|
|
|
task bench_pairing_bn254_nogami, "Run pairings benchmarks for BN254-Nogami - Default compiler":
|
|
|
|
|
runBench("bench_pairing_bn254_nogami")
|
|
|
|
|
|
|
|
|
|
task bench_pairing_bn254_nogami_gcc, "Run pairings benchmarks for BN254-Nogami - GCC":
|
|
|
|
|
runBench("bench_pairing_bn254_nogami", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_pairing_bn254_nogami_clang, "Run pairings benchmarks for BN254-Nogami - Clang":
|
|
|
|
|
runBench("bench_pairing_bn254_nogami", "clang")
|
|
|
|
|
|
|
|
|
|
task bench_pairing_bn254_nogami_gcc_noasm, "Run pairings benchmarks for BN254-Nogami - GCC no Assembly":
|
|
|
|
|
runBench("bench_pairing_bn254_nogami", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_pairing_bn254_nogami_clang_noasm, "Run pairings benchmarks for BN254-Nogami - Clang no Assembly":
|
|
|
|
|
runBench("bench_pairing_bn254_nogami", "clang", useAsm = false)
|
|
|
|
|
|
2021-02-14 13:24:48 +00:00
|
|
|
|
# --
|
|
|
|
|
|
2020-09-25 19:58:20 +00:00
|
|
|
|
task bench_pairing_bn254_snarks, "Run pairings benchmarks for BN254-Snarks - Default compiler":
|
|
|
|
|
runBench("bench_pairing_bn254_snarks")
|
|
|
|
|
|
|
|
|
|
task bench_pairing_bn254_snarks_gcc, "Run pairings benchmarks for BN254-Snarks - GCC":
|
|
|
|
|
runBench("bench_pairing_bn254_snarks", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_pairing_bn254_snarks_clang, "Run pairings benchmarks for BN254-Snarks - Clang":
|
|
|
|
|
runBench("bench_pairing_bn254_snarks", "clang")
|
|
|
|
|
|
|
|
|
|
task bench_pairing_bn254_snarks_gcc_noasm, "Run pairings benchmarks for BN254-Snarks - GCC no Assembly":
|
|
|
|
|
runBench("bench_pairing_bn254_snarks", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_pairing_bn254_snarks_clang_noasm, "Run pairings benchmarks for BN254-Snarks - Clang no Assembly":
|
|
|
|
|
runBench("bench_pairing_bn254_snarks", "clang", useAsm = false)
|
2020-12-15 18:18:36 +00:00
|
|
|
|
|
2021-02-14 13:24:48 +00:00
|
|
|
|
|
|
|
|
|
# Curve summaries
|
|
|
|
|
# ------------------------------------------
|
|
|
|
|
|
|
|
|
|
task bench_summary_bls12_377, "Run summary benchmarks for BLS12-377 - Default compiler":
|
|
|
|
|
runBench("bench_summary_bls12_377")
|
|
|
|
|
|
|
|
|
|
task bench_summary_bls12_377_gcc, "Run summary benchmarks for BLS12-377 - GCC":
|
|
|
|
|
runBench("bench_summary_bls12_377", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_summary_bls12_377_clang, "Run summary benchmarks for BLS12-377 - Clang":
|
|
|
|
|
runBench("bench_summary_bls12_377", "clang")
|
|
|
|
|
|
|
|
|
|
task bench_summary_bls12_377_gcc_noasm, "Run summary benchmarks for BLS12-377 - GCC no Assembly":
|
|
|
|
|
runBench("bench_summary_bls12_377", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_summary_bls12_377_clang_noasm, "Run summary benchmarks for BLS12-377 - Clang no Assembly":
|
|
|
|
|
runBench("bench_summary_bls12_377", "clang", useAsm = false)
|
|
|
|
|
|
|
|
|
|
# --
|
|
|
|
|
|
|
|
|
|
task bench_summary_bls12_381, "Run summary benchmarks for BLS12-381 - Default compiler":
|
|
|
|
|
runBench("bench_summary_bls12_381")
|
|
|
|
|
|
|
|
|
|
task bench_summary_bls12_381_gcc, "Run summary benchmarks for BLS12-381 - GCC":
|
|
|
|
|
runBench("bench_summary_bls12_381", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_summary_bls12_381_clang, "Run summary benchmarks for BLS12-381 - Clang":
|
|
|
|
|
runBench("bench_summary_bls12_381", "clang")
|
|
|
|
|
|
|
|
|
|
task bench_summary_bls12_381_gcc_noasm, "Run summary benchmarks for BLS12-381 - GCC no Assembly":
|
|
|
|
|
runBench("bench_summary_bls12_381", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_summary_bls12_381_clang_noasm, "Run summary benchmarks for BLS12-381 - Clang no Assembly":
|
|
|
|
|
runBench("bench_summary_bls12_381", "clang", useAsm = false)
|
|
|
|
|
|
|
|
|
|
# --
|
|
|
|
|
|
|
|
|
|
task bench_summary_bn254_nogami, "Run summary benchmarks for BN254-Nogami - Default compiler":
|
|
|
|
|
runBench("bench_summary_bn254_nogami")
|
|
|
|
|
|
|
|
|
|
task bench_summary_bn254_nogami_gcc, "Run summary benchmarks for BN254-Nogami - GCC":
|
|
|
|
|
runBench("bench_summary_bn254_nogami", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_summary_bn254_nogami_clang, "Run summary benchmarks for BN254-Nogami - Clang":
|
|
|
|
|
runBench("bench_summary_bn254_nogami", "clang")
|
|
|
|
|
|
|
|
|
|
task bench_summary_bn254_nogami_gcc_noasm, "Run summary benchmarks for BN254-Nogami - GCC no Assembly":
|
|
|
|
|
runBench("bench_summary_bn254_nogami", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_summary_bn254_nogami_clang_noasm, "Run summary benchmarks for BN254-Nogami - Clang no Assembly":
|
|
|
|
|
runBench("bench_summary_bn254_nogami", "clang", useAsm = false)
|
|
|
|
|
|
|
|
|
|
# --
|
|
|
|
|
|
|
|
|
|
task bench_summary_bn254_snarks, "Run summary benchmarks for BN254-Snarks - Default compiler":
|
|
|
|
|
runBench("bench_summary_bn254_snarks")
|
|
|
|
|
|
|
|
|
|
task bench_summary_bn254_snarks_gcc, "Run summary benchmarks for BN254-Snarks - GCC":
|
|
|
|
|
runBench("bench_summary_bn254_snarks", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_summary_bn254_snarks_clang, "Run summary benchmarks for BN254-Snarks - Clang":
|
|
|
|
|
runBench("bench_summary_bn254_snarks", "clang")
|
|
|
|
|
|
|
|
|
|
task bench_summary_bn254_snarks_gcc_noasm, "Run summary benchmarks for BN254-Snarks - GCC no Assembly":
|
|
|
|
|
runBench("bench_summary_bn254_snarks", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_summary_bn254_snarks_clang_noasm, "Run summary benchmarks for BN254-Snarks - Clang no Assembly":
|
|
|
|
|
runBench("bench_summary_bn254_snarks", "clang", useAsm = false)
|
|
|
|
|
|
2022-04-26 22:58:48 +00:00
|
|
|
|
# --
|
|
|
|
|
|
|
|
|
|
task bench_summary_pasta, "Run summary benchmarks for the Pasta curves - Default compiler":
|
|
|
|
|
runBench("bench_summary_pasta")
|
|
|
|
|
|
|
|
|
|
task bench_summary_pasta_gcc, "Run summary benchmarks for the Pasta curves - GCC":
|
|
|
|
|
runBench("bench_summary_pasta", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_summary_pasta_clang, "Run summary benchmarks for the Pasta curves - Clang":
|
|
|
|
|
runBench("bench_summary_pasta", "clang")
|
|
|
|
|
|
|
|
|
|
task bench_summary_pasta_gcc_noasm, "Run summary benchmarks for the Pasta curves - GCC no Assembly":
|
|
|
|
|
runBench("bench_summary_pasta", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_summary_pasta_clang_noasm, "Run summary benchmarks for the Pasta curves - Clang no Assembly":
|
|
|
|
|
runBench("bench_summary_pasta", "clang", useAsm = false)
|
|
|
|
|
|
2021-02-14 13:24:48 +00:00
|
|
|
|
# Hashes
|
|
|
|
|
# ------------------------------------------
|
|
|
|
|
|
2020-12-15 18:18:36 +00:00
|
|
|
|
task bench_sha256, "Run SHA256 benchmarks":
|
|
|
|
|
runBench("bench_sha256")
|
2021-08-13 20:07:26 +00:00
|
|
|
|
|
|
|
|
|
# Hash-to-curve
|
|
|
|
|
# ------------------------------------------
|
|
|
|
|
task bench_hash_to_curve, "Run Hash-to-Curve benchmarks":
|
|
|
|
|
runBench("bench_hash_to_curve")
|
|
|
|
|
|
|
|
|
|
task bench_hash_to_curve_gcc, "Run Hash-to-Curve benchmarks":
|
|
|
|
|
runBench("bench_hash_to_curve", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_hash_to_curve_clang, "Run Hash-to-Curve benchmarks":
|
|
|
|
|
runBench("bench_hash_to_curve", "clang")
|
|
|
|
|
|
|
|
|
|
task bench_hash_to_curve_gcc_noasm, "Run Hash-to-Curve benchmarks":
|
|
|
|
|
runBench("bench_hash_to_curve", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_hash_to_curve_clang_noasm, "Run Hash-to-Curve benchmarks":
|
|
|
|
|
runBench("bench_hash_to_curve", "clang", useAsm = false)
|
2022-02-26 20:22:34 +00:00
|
|
|
|
|
|
|
|
|
# BLS signatures
|
|
|
|
|
# ------------------------------------------
|
|
|
|
|
task bench_blssig_on_bls12_381_g2, "Run Hash-to-Curve benchmarks":
|
|
|
|
|
runBench("bench_blssig_on_bls12_381_g2")
|
|
|
|
|
|
|
|
|
|
task bench_blssig_on_bls12_381_g2_gcc, "Run Hash-to-Curve benchmarks":
|
|
|
|
|
runBench("bench_blssig_on_bls12_381_g2", "gcc")
|
|
|
|
|
|
|
|
|
|
task bench_blssig_on_bls12_381_g2_clang, "Run Hash-to-Curve benchmarks":
|
|
|
|
|
runBench("bench_blssig_on_bls12_381_g2", "clang")
|
|
|
|
|
|
|
|
|
|
task bench_blssig_on_bls12_381_g2_gcc_noasm, "Run Hash-to-Curve benchmarks":
|
|
|
|
|
runBench("bench_blssig_on_bls12_381_g2", "gcc", useAsm = false)
|
|
|
|
|
|
|
|
|
|
task bench_blssig_on_bls12_381_g2_clang_noasm, "Run Hash-to-Curve benchmarks":
|
|
|
|
|
runBench("bench_blssig_on_bls12_381_g2", "clang", useAsm = false)
|