diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18e4636..0a29676 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -213,6 +213,12 @@ jobs: nimble refresh --verbose -y nimble install --verbose -y gmp jsony asynctools + - name: Print Nim version + if: runner.os != 'Windows' + shell: bash + run: | + nim -v + - name: Run Constantine tests (UNIX with Assembly) if: runner.os != 'Windows' && matrix.target.BACKEND == 'ASM' shell: bash diff --git a/benchmarks/bench_elliptic_parallel_template.nim b/benchmarks/bench_elliptic_parallel_template.nim index f1a50fd..8fe33a5 100644 --- a/benchmarks/bench_elliptic_parallel_template.nim +++ b/benchmarks/bench_elliptic_parallel_template.nim @@ -21,7 +21,7 @@ import ec_multi_scalar_mul_parallel], ../constantine/math/constants/zoo_subgroups, # Threadpool - ../constantine/platforms/threadpool/threadpool, + ../constantine/threadpool/threadpool, # Helpers ../helpers/prng_unsafe, ./bench_elliptic_template, diff --git a/constantine.nimble b/constantine.nimble index 807b440..5278b26 100644 --- a/constantine.nimble +++ b/constantine.nimble @@ -152,6 +152,7 @@ proc genHeaders(bindingsName: string) = echo "Generating header: include/" & bindingsName & ".h" exec "nim c -d:CttGenerateHeaders " & " -d:release " & + " --verbosity:0 --hints:off --warnings:off " & " --out:" & bindingsName & "_gen_header.exe --outdir:build " & " --nimcache:nimcache/bindings_curves_headers/" & bindingsName & "_header" & " bindings_generators/" & bindingsName & ".nim" @@ -253,187 +254,187 @@ const testDesc: seq[tuple[path: string, useGMP: bool]] = @[ # Primitives # ---------------------------------------------------------- - ("tests/math/t_primitives.nim", false), - ("tests/math/t_primitives_extended_precision.nim", false), + ("tests/primitives/t_primitives.nim", false), + ("tests/primitives/t_primitives_extended_precision.nim", false), + ("tests/primitives/t_io_unsaturated.nim", false), # Big ints # ---------------------------------------------------------- - ("tests/math/t_io_bigints.nim", false), - ("tests/math/t_io_unsaturated.nim", false), - # ("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), + ("tests/math_bigints/t_io_bigints.nim", false), + # ("tests/math_bigints/t_bigints.nim", false), + # ("tests/math_bigints/t_bigints_multimod.nim", false), + # ("tests/math_bigints/t_bigints_mod_vs_gmp.nim", true), + # ("tests/math_bigints/t_bigints_mul_vs_gmp.nim", true), + # ("tests/math_bigints/t_bigints_mul_high_words_vs_gmp.nim", true), # Field # ---------------------------------------------------------- - ("tests/math/t_io_fields", false), - # ("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), - # ("tests/math/t_fp_cubic_root.nim", false), + ("tests/math_fields/t_io_fields", false), + # ("tests/math_fields/t_finite_fields.nim", false), + # ("tests/math_fields/t_finite_fields_conditional_arithmetic.nim", false), + # ("tests/math_fields/t_finite_fields_mulsquare.nim", false), + # ("tests/math_fields/t_finite_fields_sqrt.nim", false), + # ("tests/math_fields/t_finite_fields_powinv.nim", false), + # ("tests/math_fields/t_finite_fields_vs_gmp.nim", true), + # ("tests/math_fields/t_fp_cubic_root.nim", false), # Double-precision finite fields # ---------------------------------------------------------- - # ("tests/math/t_finite_fields_double_precision.nim", false), + # ("tests/math_fields/t_finite_fields_double_precision.nim", false), # Towers of extension fields # ---------------------------------------------------------- - # ("tests/math/t_fp2.nim", false), - # ("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), - ("tests/math/t_fp12_anti_regression.nim", false), + # ("tests/math_extension_fields/t_fp2.nim", false), + # ("tests/math_extension_fields/t_fp2_sqrt.nim", false), + # ("tests/math_extension_fields/t_fp4.nim", false), + # ("tests/math_extension_fields/t_fp6_bn254_nogami.nim", false), + # ("tests/math_extension_fields/t_fp6_bn254_snarks.nim", false), + # ("tests/math_extension_fields/t_fp6_bls12_377.nim", false), + # ("tests/math_extension_fields/t_fp6_bls12_381.nim", false), + # ("tests/math_extension_fields/t_fp6_bw6_761.nim", false), + # ("tests/math_extension_fields/t_fp12_bn254_nogami.nim", false), + # ("tests/math_extension_fields/t_fp12_bn254_snarks.nim", false), + # ("tests/math_extension_fields/t_fp12_bls12_377.nim", false), + # ("tests/math_extension_fields/t_fp12_bls12_381.nim", false), + # ("tests/math_extension_fields/t_fp12_exponentiation.nim", false), + ("tests/math_extension_fields/t_fp12_anti_regression.nim", false), - # ("tests/math/t_fp4_frobenius.nim", false), - # ("tests/math/t_fp6_frobenius.nim", false), - # ("tests/math/t_fp12_frobenius.nim", false), + # ("tests/math_extension_fields/t_fp4_frobenius.nim", false), + # ("tests/math_extension_fields/t_fp6_frobenius.nim", false), + # ("tests/math_extension_fields/t_fp12_frobenius.nim", false), # Elliptic curve arithmetic # ---------------------------------------------------------- - # ("tests/math/t_ec_conversion.nim", false), + # ("tests/math_elliptic_curves/t_ec_conversion.nim", false), # Elliptic curve arithmetic G1 # ---------------------------------------------------------- - # ("tests/math/t_ec_shortw_prj_g1_add_double.nim", false), - # ("tests/math/t_ec_shortw_prj_g1_mul_sanity.nim", false), - # ("tests/math/t_ec_shortw_prj_g1_mul_distri.nim", false), - ("tests/math/t_ec_shortw_prj_g1_mul_vs_ref.nim", false), - # ("tests/math/t_ec_shortw_prj_g1_mixed_add.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g1_add_double.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g1_mul_sanity.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g1_mul_distri.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_prj_g1_mul_vs_ref.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g1_mixed_add.nim", false), - # ("tests/math/t_ec_shortw_jac_g1_add_double.nim", false), - # ("tests/math/t_ec_shortw_jac_g1_mul_sanity.nim", false), - # ("tests/math/t_ec_shortw_jac_g1_mul_distri.nim", false), - ("tests/math/t_ec_shortw_jac_g1_mul_vs_ref.nim", false), - # ("tests/math/t_ec_shortw_jac_g1_mixed_add.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g1_add_double.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g1_mul_sanity.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g1_mul_distri.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_jac_g1_mul_vs_ref.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g1_mixed_add.nim", false), - ("tests/math/t_ec_shortw_jacext_g1_add_double.nim", false), - ("tests/math/t_ec_shortw_jacext_g1_mixed_add.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_jacext_g1_add_double.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_jacext_g1_mixed_add.nim", false), - # ("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), + # ("tests/math_elliptic_curves/t_ec_twedwards_prj_add_double", false), + # ("tests/math_elliptic_curves/t_ec_twedwards_prj_mul_sanity", false), + # ("tests/math_elliptic_curves/t_ec_twedwards_prj_mul_distri", false), # Elliptic curve arithmetic G2 # ---------------------------------------------------------- - # ("tests/math/t_ec_shortw_prj_g2_add_double_bn254_snarks.nim", false), - # ("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), - ("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), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bn254_snarks.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bn254_snarks.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bn254_snarks.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bn254_snarks.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bn254_snarks.nim", false), - # ("tests/math/t_ec_shortw_prj_g2_add_double_bls12_381.nim", false), - # ("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), - ("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), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bls12_381.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bls12_381.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bls12_381.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bls12_381.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bls12_381.nim", false), - # ("tests/math/t_ec_shortw_prj_g2_add_double_bls12_377.nim", false), - # ("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), - ("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), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bls12_377.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bls12_377.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bls12_377.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bls12_377.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bls12_377.nim", false), - # ("tests/math/t_ec_shortw_prj_g2_add_double_bw6_761.nim", false), - # ("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), - ("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), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bw6_761.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bw6_761.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bw6_761.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bw6_761.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bw6_761.nim", false), - # ("tests/math/t_ec_shortw_jac_g2_add_double_bn254_snarks.nim", false), - # ("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), - ("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), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bn254_snarks.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bn254_snarks.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bn254_snarks.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bn254_snarks.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bn254_snarks.nim", false), - # ("tests/math/t_ec_shortw_jac_g2_add_double_bls12_381.nim", false), - # ("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), - ("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), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bls12_381.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bls12_381.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bls12_381.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bls12_381.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bls12_381.nim", false), - # ("tests/math/t_ec_shortw_jac_g2_add_double_bls12_377.nim", false), - # ("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), - ("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), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bls12_377.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bls12_377.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bls12_377.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bls12_377.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bls12_377.nim", false), - # ("tests/math/t_ec_shortw_jac_g2_add_double_bw6_761.nim", false), - # ("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), - ("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), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bw6_761.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bw6_761.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bw6_761.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bw6_761.nim", false), + # ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bw6_761.nim", false), # Elliptic curve arithmetic vs Sagemath # ---------------------------------------------------------- - ("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), - ("tests/math/t_ec_sage_pallas.nim", false), - ("tests/math/t_ec_sage_vesta.nim", false), + ("tests/math_elliptic_curves/t_ec_frobenius.nim", false), + ("tests/math_elliptic_curves/t_ec_sage_bn254_nogami.nim", false), + ("tests/math_elliptic_curves/t_ec_sage_bn254_snarks.nim", false), + ("tests/math_elliptic_curves/t_ec_sage_bls12_377.nim", false), + ("tests/math_elliptic_curves/t_ec_sage_bls12_381.nim", false), + ("tests/math_elliptic_curves/t_ec_sage_pallas.nim", false), + ("tests/math_elliptic_curves/t_ec_sage_vesta.nim", false), # Edge cases highlighted by past bugs # ---------------------------------------------------------- - ("tests/math/t_ec_shortw_prj_edge_cases.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_prj_edge_cases.nim", false), # Elliptic curve arithmetic - batch computation # ---------------------------------------------------------- - ("tests/math/t_ec_shortw_prj_g1_sum_reduce.nim", false), - ("tests/math/t_ec_shortw_jac_g1_sum_reduce.nim", false), - ("tests/math/t_ec_shortw_jacext_g1_sum_reduce.nim", false), - ("tests/math/t_ec_shortw_prj_g1_msm.nim", false), - ("tests/math/t_ec_shortw_jac_g1_msm.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_prj_g1_sum_reduce.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_jac_g1_sum_reduce.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_jacext_g1_sum_reduce.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_prj_g1_msm.nim", false), + ("tests/math_elliptic_curves/t_ec_shortw_jac_g1_msm.nim", false), # Subgroups and cofactors # ---------------------------------------------------------- - # ("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), + # ("tests/math_elliptic_curves/t_ec_subgroups_bn254_nogami.nim", false), + # ("tests/math_elliptic_curves/t_ec_subgroups_bn254_snarks.nim", false), + # ("tests/math_elliptic_curves/t_ec_subgroups_bls12_377.nim", false), + # ("tests/math_elliptic_curves/t_ec_subgroups_bls12_381.nim", false), - # ("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), + # ("tests/math_pairings/t_pairing_bn254_nogami_gt_subgroup.nim", false), + # ("tests/math_pairings/t_pairing_bn254_snarks_gt_subgroup.nim", false), + # ("tests/math_pairings/t_pairing_bls12_377_gt_subgroup.nim", false), + # ("tests/math_pairings/t_pairing_bls12_381_gt_subgroup.nim", false), + # ("tests/math_pairings/t_pairing_bw6_761_gt_subgroup.nim", false), # Pairing # ---------------------------------------------------------- - # ("tests/math/t_pairing_bls12_377_line_functions.nim", false), - # ("tests/math/t_pairing_bls12_381_line_functions.nim", false), - # ("tests/math/t_pairing_mul_fp12_by_lines.nim", false), - ("tests/math/t_pairing_cyclotomic_subgroup.nim", false), - ("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), + # ("tests/math_pairings/t_pairing_bls12_377_line_functions.nim", false), + # ("tests/math_pairings/t_pairing_bls12_381_line_functions.nim", false), + # ("tests/math_pairings/t_pairing_mul_fp12_by_lines.nim", false), + ("tests/math_pairings/t_pairing_cyclotomic_subgroup.nim", false), + ("tests/math_pairings/t_pairing_bn254_nogami_optate.nim", false), + ("tests/math_pairings/t_pairing_bn254_snarks_optate.nim", false), + ("tests/math_pairings/t_pairing_bls12_377_optate.nim", false), + ("tests/math_pairings/t_pairing_bls12_381_optate.nim", false), # Multi-Pairing # ---------------------------------------------------------- - ("tests/math/t_pairing_bn254_nogami_multi.nim", false), - ("tests/math/t_pairing_bn254_snarks_multi.nim", false), - ("tests/math/t_pairing_bls12_377_multi.nim", false), - ("tests/math/t_pairing_bls12_381_multi.nim", false), + ("tests/math_pairings/t_pairing_bn254_nogami_multi.nim", false), + ("tests/math_pairings/t_pairing_bn254_snarks_multi.nim", false), + ("tests/math_pairings/t_pairing_bls12_377_multi.nim", false), + ("tests/math_pairings/t_pairing_bls12_381_multi.nim", false), # Prime order fields # ---------------------------------------------------------- - ("tests/math/t_fr.nim", false), + ("tests/math_fields/t_fr.nim", false), # Hashing to elliptic curves # ---------------------------------------------------------- @@ -453,21 +454,21 @@ const testDescNvidia: seq[string] = @[ ] const testDescThreadpool: seq[string] = @[ - "constantine/platforms/threadpool/examples/e01_simple_tasks.nim", - "constantine/platforms/threadpool/examples/e02_parallel_pi.nim", - "constantine/platforms/threadpool/examples/e03_parallel_for.nim", - "constantine/platforms/threadpool/examples/e04_parallel_reduce.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 - # "constantine/platforms/threadpool/benchmarks/black_scholes/threadpool_black_scholes.nim", # Need input file - "constantine/platforms/threadpool/benchmarks/matrix_transposition/threadpool_transposes.nim", - "constantine/platforms/threadpool/benchmarks/histogram_2D/threadpool_histogram.nim", - "constantine/platforms/threadpool/benchmarks/logsumexp/threadpool_logsumexp.nim", + "constantine/threadpool/examples/e01_simple_tasks.nim", + "constantine/threadpool/examples/e02_parallel_pi.nim", + "constantine/threadpool/examples/e03_parallel_for.nim", + "constantine/threadpool/examples/e04_parallel_reduce.nim", + # "constantine/threadpool/benchmarks/bouncing_producer_consumer/threadpool_bpc.nim", # Need timing not implemented on Windows + "constantine/threadpool/benchmarks/dfs/threadpool_dfs.nim", + "constantine/threadpool/benchmarks/fibonacci/threadpool_fib.nim", + "constantine/threadpool/benchmarks/heat/threadpool_heat.nim", + # "constantine/threadpool/benchmarks/matmul_cache_oblivious/threadpool_matmul_co.nim", + "constantine/threadpool/benchmarks/nqueens/threadpool_nqueens.nim", + # "constantine/threadpool/benchmarks/single_task_producer/threadpool_spc.nim", # Need timing not implemented on Windows + # "constantine/threadpool/benchmarks/black_scholes/threadpool_black_scholes.nim", # Need input file + "constantine/threadpool/benchmarks/matrix_transposition/threadpool_transposes.nim", + "constantine/threadpool/benchmarks/histogram_2D/threadpool_histogram.nim", + "constantine/threadpool/benchmarks/logsumexp/threadpool_logsumexp.nim", ] const testDescMultithreadedCrypto: seq[string] = @[ @@ -508,8 +509,8 @@ const benchDesc = [ # For temporary (hopefully) investigation that can only be reproduced in CI const useDebug = [ - "tests/math/t_bigints.nim", - "tests/math/t_hash_sha256_vs_openssl.nim", + "tests/math_bigints/t_bigints.nim", + "tests/t_hash_sha256_vs_openssl.nim", ] # Skip sanitizers for specific tests diff --git a/constantine/math/elliptic/ec_multi_scalar_mul_parallel.nim b/constantine/math/elliptic/ec_multi_scalar_mul_parallel.nim index 0d6a2ed..3aa99be 100644 --- a/constantine/math/elliptic/ec_multi_scalar_mul_parallel.nim +++ b/constantine/math/elliptic/ec_multi_scalar_mul_parallel.nim @@ -11,7 +11,7 @@ import ./ec_multi_scalar_mul_scheduler, ./ec_endomorphism_accel, ../extension_fields, ../constants/zoo_endomorphisms, - ../../platforms/threadpool/[threadpool, partitioners] + ../../threadpool/[threadpool, partitioners] export bestBucketBitSize # No exceptions allowed in core cryptographic operations diff --git a/constantine/math/elliptic/ec_shortweierstrass_batch_ops_parallel.nim b/constantine/math/elliptic/ec_shortweierstrass_batch_ops_parallel.nim index a1ff61d..9db3221 100644 --- a/constantine/math/elliptic/ec_shortweierstrass_batch_ops_parallel.nim +++ b/constantine/math/elliptic/ec_shortweierstrass_batch_ops_parallel.nim @@ -8,7 +8,7 @@ import ../../platforms/abstractions, - ../../platforms/threadpool/[threadpool, partitioners], + ../../threadpool/[threadpool, partitioners], ./ec_shortweierstrass_affine, ./ec_shortweierstrass_jacobian, ./ec_shortweierstrass_projective, diff --git a/constantine/platforms/constant_time/ct_routines.nim b/constantine/platforms/constant_time/ct_routines.nim index 596cdfa..aa7ed04 100644 --- a/constantine/platforms/constant_time/ct_routines.nim +++ b/constantine/platforms/constant_time/ct_routines.nim @@ -157,7 +157,10 @@ template `<=`*[T: Ct](x, y: T): CTBool[T] = not(y < x) template `xor`*[T: Ct](x, y: CTBool[T]): CTBool[T] = - CTBool[T](noteq(T(x), T(y))) + {.push hint[ConvFromXtoItselfNotNeeded]: off.} + let r = CTBool[T](noteq(T(x), T(y))) + {.pop.} + r # ############################################################ # diff --git a/constantine/platforms/isa/simd_x86.nim b/constantine/platforms/isa/simd_x86.nim index 487637d..9bd4d04 100644 --- a/constantine/platforms/isa/simd_x86.nim +++ b/constantine/platforms/isa/simd_x86.nim @@ -6,6 +6,8 @@ # * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0). # at your option. This file may not be copied, modified, or distributed except according to those terms. +{.push used.} # Some SIMDs are implemented but not exported. + static: doAssert defined(i386) or defined(amd64) # SIMD throughput and latency: @@ -123,7 +125,7 @@ func mm_shuffle_epi8(a, b: m128i): m128i {.importc: "_mm_shuffle_epi8", x86.} ## if z is set, the corresponding d is set to zero. ## otherwise uvwx represents a binary number in 0..15, ## the corresponding d will be set to a(uvwx) - ## + ## ## for i in 0 ..< 16: ## if bitand(b[i], 0x80) != 0: ## dst[i] = 0 @@ -139,7 +141,7 @@ func mm_shuffle_epi8(a, b: m128i): m128i {.importc: "_mm_shuffle_epi8", x86.} func mm_blend_epi16(a, b: m128i, imm8: int32 or uint32): m128i {.importc: "_mm_blend_epi16", x86.} ## Blend packed 16-bit integers from a and b using control mask imm8, ## and store the results in dst. - ## + ## ## FOR j := 0 to 7 ## i := j*16 ## IF imm8[j] @@ -175,7 +177,7 @@ func mm_mask_add_epi32(src: m128i, mask: mmask8, a, b: m128i): m128i {.importc: func mm_sha256msg1_epu32(a, b: m128i): m128i {.importc: "_mm_sha256msg1_epu32", x86.} ## Perform an intermediate calculation for the next four SHA256 message values (unsigned 32-bit integers) ## using previous message values from a and b, and store the result in dst. - ## + ## ## W4 := b[31:0] ## W3 := a[127:96] ## W2 := a[95:64] @@ -189,7 +191,7 @@ func mm_sha256msg1_epu32(a, b: m128i): m128i {.importc: "_mm_sha256msg1_epu32", func mm_sha256msg2_epu32(a, b: m128i): m128i {.importc: "_mm_sha256msg2_epu32", x86.} ## Perform the final calculation for the next four SHA256 message values (unsigned 32-bit integers) ## using previous message values from a and b, and store the result in dst. - ## + ## ## W14 := b[95:64] ## W15 := b[127:96] ## W16 := a[31:0] + sigma1(W14) @@ -208,7 +210,7 @@ func mm_sha256rnds2_epu32(cdgh, abef, k: m128i): m128i {.importc: "_mm_sha256rnd ## and a pre-computed sum of the next 2 round message values (unsigned 32-bit integers) ## and the corresponding round constants from k, ## and store the updated SHA256 state (A,B,E,F) in dst. - ## + ## ## A[0] := b[127:96] ## B[0] := b[95:64] ## C[0] := a[127:96] @@ -269,9 +271,9 @@ template shuf_u32x4*(a: m128i, mask: int32 or uint32): m128i = template blend_u16x8*(a, b: m128i, mask: int32 or uint32): m128i = mm_blend_epi16(a, b, mask) -template sha256_msg1*(a, b: m128i): m128i = +template sha256_msg1*(a, b: m128i): m128i = mm_sha256msg1_epu32(a, b) -template sha256_msg2*(a, b: m128i): m128i = +template sha256_msg2*(a, b: m128i): m128i = mm_sha256msg2_epu32(a, b) template sha256_2rounds*(cdgh, abef, k: m128i): m128i = mm_sha256rnds2_epu32(cdgh, abef, k) \ No newline at end of file diff --git a/constantine/platforms/threadpool/README.md b/constantine/threadpool/README.md similarity index 100% rename from constantine/platforms/threadpool/README.md rename to constantine/threadpool/README.md diff --git a/constantine/platforms/threadpool/benchmarks/black_scholes/README.md b/constantine/threadpool/benchmarks/black_scholes/README.md similarity index 100% rename from constantine/platforms/threadpool/benchmarks/black_scholes/README.md rename to constantine/threadpool/benchmarks/black_scholes/README.md diff --git a/constantine/platforms/threadpool/benchmarks/black_scholes/README_Parsec.txt b/constantine/threadpool/benchmarks/black_scholes/README_Parsec.txt similarity index 100% rename from constantine/platforms/threadpool/benchmarks/black_scholes/README_Parsec.txt rename to constantine/threadpool/benchmarks/black_scholes/README_Parsec.txt diff --git a/constantine/platforms/threadpool/benchmarks/black_scholes/blackscholes.c b/constantine/threadpool/benchmarks/black_scholes/blackscholes.c similarity index 100% rename from constantine/platforms/threadpool/benchmarks/black_scholes/blackscholes.c rename to constantine/threadpool/benchmarks/black_scholes/blackscholes.c diff --git a/constantine/platforms/threadpool/benchmarks/black_scholes/blackscholes.simd.c b/constantine/threadpool/benchmarks/black_scholes/blackscholes.simd.c similarity index 100% rename from constantine/platforms/threadpool/benchmarks/black_scholes/blackscholes.simd.c rename to constantine/threadpool/benchmarks/black_scholes/blackscholes.simd.c diff --git a/constantine/platforms/threadpool/benchmarks/black_scholes/c.m4.pthreads b/constantine/threadpool/benchmarks/black_scholes/c.m4.pthreads similarity index 100% rename from constantine/platforms/threadpool/benchmarks/black_scholes/c.m4.pthreads rename to constantine/threadpool/benchmarks/black_scholes/c.m4.pthreads diff --git a/constantine/platforms/threadpool/benchmarks/black_scholes/inputgen.c b/constantine/threadpool/benchmarks/black_scholes/inputgen.c similarity index 100% rename from constantine/platforms/threadpool/benchmarks/black_scholes/inputgen.c rename to constantine/threadpool/benchmarks/black_scholes/inputgen.c diff --git a/constantine/platforms/threadpool/benchmarks/black_scholes/openmp_black_scholes.nim b/constantine/threadpool/benchmarks/black_scholes/openmp_black_scholes.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/black_scholes/openmp_black_scholes.nim rename to constantine/threadpool/benchmarks/black_scholes/openmp_black_scholes.nim diff --git a/constantine/platforms/threadpool/benchmarks/black_scholes/optionData.txt b/constantine/threadpool/benchmarks/black_scholes/optionData.txt similarity index 100% rename from constantine/platforms/threadpool/benchmarks/black_scholes/optionData.txt rename to constantine/threadpool/benchmarks/black_scholes/optionData.txt diff --git a/constantine/platforms/threadpool/benchmarks/black_scholes/test10000options.txt b/constantine/threadpool/benchmarks/black_scholes/test10000options.txt similarity index 100% rename from constantine/platforms/threadpool/benchmarks/black_scholes/test10000options.txt rename to constantine/threadpool/benchmarks/black_scholes/test10000options.txt diff --git a/constantine/platforms/threadpool/benchmarks/black_scholes/threadpool_black_scholes.nim b/constantine/threadpool/benchmarks/black_scholes/threadpool_black_scholes.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/black_scholes/threadpool_black_scholes.nim rename to constantine/threadpool/benchmarks/black_scholes/threadpool_black_scholes.nim diff --git a/constantine/platforms/threadpool/benchmarks/bouncing_producer_consumer/README.md b/constantine/threadpool/benchmarks/bouncing_producer_consumer/README.md similarity index 100% rename from constantine/platforms/threadpool/benchmarks/bouncing_producer_consumer/README.md rename to constantine/threadpool/benchmarks/bouncing_producer_consumer/README.md diff --git a/constantine/platforms/threadpool/benchmarks/bouncing_producer_consumer/threadpool_bpc.nim b/constantine/threadpool/benchmarks/bouncing_producer_consumer/threadpool_bpc.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/bouncing_producer_consumer/threadpool_bpc.nim rename to constantine/threadpool/benchmarks/bouncing_producer_consumer/threadpool_bpc.nim diff --git a/constantine/platforms/threadpool/benchmarks/dfs/threadpool_dfs.nim b/constantine/threadpool/benchmarks/dfs/threadpool_dfs.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/dfs/threadpool_dfs.nim rename to constantine/threadpool/benchmarks/dfs/threadpool_dfs.nim diff --git a/constantine/platforms/threadpool/benchmarks/fibonacci/README.md b/constantine/threadpool/benchmarks/fibonacci/README.md similarity index 100% rename from constantine/platforms/threadpool/benchmarks/fibonacci/README.md rename to constantine/threadpool/benchmarks/fibonacci/README.md diff --git a/constantine/platforms/threadpool/benchmarks/fibonacci/stdnim_fib.nim b/constantine/threadpool/benchmarks/fibonacci/stdnim_fib.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/fibonacci/stdnim_fib.nim rename to constantine/threadpool/benchmarks/fibonacci/stdnim_fib.nim diff --git a/constantine/platforms/threadpool/benchmarks/fibonacci/threadpool_fib.nim b/constantine/threadpool/benchmarks/fibonacci/threadpool_fib.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/fibonacci/threadpool_fib.nim rename to constantine/threadpool/benchmarks/fibonacci/threadpool_fib.nim diff --git a/constantine/platforms/threadpool/benchmarks/heat/stdnim_heat.nim b/constantine/threadpool/benchmarks/heat/stdnim_heat.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/heat/stdnim_heat.nim rename to constantine/threadpool/benchmarks/heat/stdnim_heat.nim diff --git a/constantine/platforms/threadpool/benchmarks/heat/threadpool_heat.nim b/constantine/threadpool/benchmarks/heat/threadpool_heat.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/heat/threadpool_heat.nim rename to constantine/threadpool/benchmarks/heat/threadpool_heat.nim diff --git a/constantine/platforms/threadpool/benchmarks/histogram_2D/README.md b/constantine/threadpool/benchmarks/histogram_2D/README.md similarity index 100% rename from constantine/platforms/threadpool/benchmarks/histogram_2D/README.md rename to constantine/threadpool/benchmarks/histogram_2D/README.md diff --git a/constantine/platforms/threadpool/benchmarks/histogram_2D/openmp_histogram.c b/constantine/threadpool/benchmarks/histogram_2D/openmp_histogram.c similarity index 100% rename from constantine/platforms/threadpool/benchmarks/histogram_2D/openmp_histogram.c rename to constantine/threadpool/benchmarks/histogram_2D/openmp_histogram.c diff --git a/constantine/platforms/threadpool/benchmarks/histogram_2D/threadpool_histogram.nim b/constantine/threadpool/benchmarks/histogram_2D/threadpool_histogram.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/histogram_2D/threadpool_histogram.nim rename to constantine/threadpool/benchmarks/histogram_2D/threadpool_histogram.nim diff --git a/constantine/platforms/threadpool/benchmarks/logsumexp/README.md b/constantine/threadpool/benchmarks/logsumexp/README.md similarity index 100% rename from constantine/platforms/threadpool/benchmarks/logsumexp/README.md rename to constantine/threadpool/benchmarks/logsumexp/README.md diff --git a/constantine/platforms/threadpool/benchmarks/logsumexp/threadpool_logsumexp.nim b/constantine/threadpool/benchmarks/logsumexp/threadpool_logsumexp.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/logsumexp/threadpool_logsumexp.nim rename to constantine/threadpool/benchmarks/logsumexp/threadpool_logsumexp.nim diff --git a/constantine/platforms/threadpool/benchmarks/matmul_cache_oblivious/README.md b/constantine/threadpool/benchmarks/matmul_cache_oblivious/README.md similarity index 100% rename from constantine/platforms/threadpool/benchmarks/matmul_cache_oblivious/README.md rename to constantine/threadpool/benchmarks/matmul_cache_oblivious/README.md diff --git a/constantine/platforms/threadpool/benchmarks/matmul_cache_oblivious/threadpool_matmul_co.nim b/constantine/threadpool/benchmarks/matmul_cache_oblivious/threadpool_matmul_co.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/matmul_cache_oblivious/threadpool_matmul_co.nim rename to constantine/threadpool/benchmarks/matmul_cache_oblivious/threadpool_matmul_co.nim diff --git a/constantine/platforms/threadpool/benchmarks/matrix_transposition/README.md b/constantine/threadpool/benchmarks/matrix_transposition/README.md similarity index 100% rename from constantine/platforms/threadpool/benchmarks/matrix_transposition/README.md rename to constantine/threadpool/benchmarks/matrix_transposition/README.md diff --git a/constantine/platforms/threadpool/benchmarks/matrix_transposition/openmp_transposes.nim b/constantine/threadpool/benchmarks/matrix_transposition/openmp_transposes.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/matrix_transposition/openmp_transposes.nim rename to constantine/threadpool/benchmarks/matrix_transposition/openmp_transposes.nim diff --git a/constantine/platforms/threadpool/benchmarks/matrix_transposition/threadpool_transposes.nim b/constantine/threadpool/benchmarks/matrix_transposition/threadpool_transposes.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/matrix_transposition/threadpool_transposes.nim rename to constantine/threadpool/benchmarks/matrix_transposition/threadpool_transposes.nim diff --git a/constantine/platforms/threadpool/benchmarks/nqueens/stdnim_nqueens.nim b/constantine/threadpool/benchmarks/nqueens/stdnim_nqueens.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/nqueens/stdnim_nqueens.nim rename to constantine/threadpool/benchmarks/nqueens/stdnim_nqueens.nim diff --git a/constantine/platforms/threadpool/benchmarks/nqueens/threadpool_nqueens.nim b/constantine/threadpool/benchmarks/nqueens/threadpool_nqueens.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/nqueens/threadpool_nqueens.nim rename to constantine/threadpool/benchmarks/nqueens/threadpool_nqueens.nim diff --git a/constantine/platforms/threadpool/benchmarks/resources.nim b/constantine/threadpool/benchmarks/resources.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/resources.nim rename to constantine/threadpool/benchmarks/resources.nim diff --git a/constantine/platforms/threadpool/benchmarks/single_task_producer/README.md b/constantine/threadpool/benchmarks/single_task_producer/README.md similarity index 100% rename from constantine/platforms/threadpool/benchmarks/single_task_producer/README.md rename to constantine/threadpool/benchmarks/single_task_producer/README.md diff --git a/constantine/platforms/threadpool/benchmarks/single_task_producer/threadpool_spc.nim b/constantine/threadpool/benchmarks/single_task_producer/threadpool_spc.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/single_task_producer/threadpool_spc.nim rename to constantine/threadpool/benchmarks/single_task_producer/threadpool_spc.nim diff --git a/constantine/platforms/threadpool/benchmarks/wtime.h b/constantine/threadpool/benchmarks/wtime.h similarity index 100% rename from constantine/platforms/threadpool/benchmarks/wtime.h rename to constantine/threadpool/benchmarks/wtime.h diff --git a/constantine/platforms/threadpool/benchmarks/wtime.nim b/constantine/threadpool/benchmarks/wtime.nim similarity index 100% rename from constantine/platforms/threadpool/benchmarks/wtime.nim rename to constantine/threadpool/benchmarks/wtime.nim diff --git a/constantine/platforms/threadpool/crossthread/backoff.nim b/constantine/threadpool/crossthread/backoff.nim similarity index 100% rename from constantine/platforms/threadpool/crossthread/backoff.nim rename to constantine/threadpool/crossthread/backoff.nim diff --git a/constantine/platforms/threadpool/crossthread/scoped_barriers.nim b/constantine/threadpool/crossthread/scoped_barriers.nim similarity index 100% rename from constantine/platforms/threadpool/crossthread/scoped_barriers.nim rename to constantine/threadpool/crossthread/scoped_barriers.nim diff --git a/constantine/platforms/threadpool/crossthread/taskqueues.nim b/constantine/threadpool/crossthread/taskqueues.nim similarity index 99% rename from constantine/platforms/threadpool/crossthread/taskqueues.nim rename to constantine/threadpool/crossthread/taskqueues.nim index cd30763..8e71c7f 100644 --- a/constantine/platforms/threadpool/crossthread/taskqueues.nim +++ b/constantine/threadpool/crossthread/taskqueues.nim @@ -34,8 +34,8 @@ import std/atomics, + ../../platforms/allocs, ../instrumentation, - ../../allocs, ./tasks_flowvars type diff --git a/constantine/platforms/threadpool/crossthread/tasks_flowvars.nim b/constantine/threadpool/crossthread/tasks_flowvars.nim similarity index 99% rename from constantine/platforms/threadpool/crossthread/tasks_flowvars.nim rename to constantine/threadpool/crossthread/tasks_flowvars.nim index 8e4caaf..64a4c75 100644 --- a/constantine/platforms/threadpool/crossthread/tasks_flowvars.nim +++ b/constantine/threadpool/crossthread/tasks_flowvars.nim @@ -8,10 +8,10 @@ import std/atomics, - ./scoped_barriers, + ../../platforms/allocs, + ../primitives/futexes, ../instrumentation, - ../../allocs, - ../primitives/futexes + ./scoped_barriers # Tasks have an efficient design so that a single heap allocation # is required per `spawn`. diff --git a/constantine/platforms/threadpool/demos/raytracing/README.md b/constantine/threadpool/demos/raytracing/README.md similarity index 100% rename from constantine/platforms/threadpool/demos/raytracing/README.md rename to constantine/threadpool/demos/raytracing/README.md diff --git a/constantine/platforms/threadpool/demos/raytracing/ray_trace_300samples_nim_nested.png b/constantine/threadpool/demos/raytracing/ray_trace_300samples_nim_nested.png similarity index 100% rename from constantine/platforms/threadpool/demos/raytracing/ray_trace_300samples_nim_nested.png rename to constantine/threadpool/demos/raytracing/ray_trace_300samples_nim_nested.png diff --git a/constantine/platforms/threadpool/demos/raytracing/ray_trace_300samples_nim_threaded.png b/constantine/threadpool/demos/raytracing/ray_trace_300samples_nim_threaded.png similarity index 100% rename from constantine/platforms/threadpool/demos/raytracing/ray_trace_300samples_nim_threaded.png rename to constantine/threadpool/demos/raytracing/ray_trace_300samples_nim_threaded.png diff --git a/constantine/platforms/threadpool/demos/raytracing/smallpt.cpp b/constantine/threadpool/demos/raytracing/smallpt.cpp similarity index 100% rename from constantine/platforms/threadpool/demos/raytracing/smallpt.cpp rename to constantine/threadpool/demos/raytracing/smallpt.cpp diff --git a/constantine/platforms/threadpool/demos/raytracing/smallpt.nim b/constantine/threadpool/demos/raytracing/smallpt.nim similarity index 100% rename from constantine/platforms/threadpool/demos/raytracing/smallpt.nim rename to constantine/threadpool/demos/raytracing/smallpt.nim diff --git a/constantine/platforms/threadpool/docs/design.md b/constantine/threadpool/docs/design.md similarity index 100% rename from constantine/platforms/threadpool/docs/design.md rename to constantine/threadpool/docs/design.md diff --git a/constantine/platforms/threadpool/docs/partitioners.md b/constantine/threadpool/docs/partitioners.md similarity index 100% rename from constantine/platforms/threadpool/docs/partitioners.md rename to constantine/threadpool/docs/partitioners.md diff --git a/constantine/platforms/threadpool/docs/random_permutations.md b/constantine/threadpool/docs/random_permutations.md similarity index 100% rename from constantine/platforms/threadpool/docs/random_permutations.md rename to constantine/threadpool/docs/random_permutations.md diff --git a/constantine/platforms/threadpool/examples/e01_simple_tasks.nim b/constantine/threadpool/examples/e01_simple_tasks.nim similarity index 100% rename from constantine/platforms/threadpool/examples/e01_simple_tasks.nim rename to constantine/threadpool/examples/e01_simple_tasks.nim diff --git a/constantine/platforms/threadpool/examples/e02_parallel_pi.nim b/constantine/threadpool/examples/e02_parallel_pi.nim similarity index 100% rename from constantine/platforms/threadpool/examples/e02_parallel_pi.nim rename to constantine/threadpool/examples/e02_parallel_pi.nim diff --git a/constantine/platforms/threadpool/examples/e03_parallel_for.nim b/constantine/threadpool/examples/e03_parallel_for.nim similarity index 100% rename from constantine/platforms/threadpool/examples/e03_parallel_for.nim rename to constantine/threadpool/examples/e03_parallel_for.nim diff --git a/constantine/platforms/threadpool/examples/e04_parallel_reduce.nim b/constantine/threadpool/examples/e04_parallel_reduce.nim similarity index 100% rename from constantine/platforms/threadpool/examples/e04_parallel_reduce.nim rename to constantine/threadpool/examples/e04_parallel_reduce.nim diff --git a/constantine/platforms/threadpool/instrumentation.nim b/constantine/threadpool/instrumentation.nim similarity index 100% rename from constantine/platforms/threadpool/instrumentation.nim rename to constantine/threadpool/instrumentation.nim diff --git a/constantine/platforms/threadpool/parallel_offloading.nim b/constantine/threadpool/parallel_offloading.nim similarity index 99% rename from constantine/platforms/threadpool/parallel_offloading.nim rename to constantine/threadpool/parallel_offloading.nim index 249f372..b963855 100644 --- a/constantine/platforms/threadpool/parallel_offloading.nim +++ b/constantine/threadpool/parallel_offloading.nim @@ -8,7 +8,7 @@ import std/macros, ./crossthread/tasks_flowvars, - ../ast_rebuilder + ../platforms/ast_rebuilder # Parallel offloading API # ----------------------- diff --git a/constantine/platforms/threadpool/partitioners.nim b/constantine/threadpool/partitioners.nim similarity index 100% rename from constantine/platforms/threadpool/partitioners.nim rename to constantine/threadpool/partitioners.nim diff --git a/constantine/platforms/threadpool/primitives/barriers.md b/constantine/threadpool/primitives/barriers.md similarity index 100% rename from constantine/platforms/threadpool/primitives/barriers.md rename to constantine/threadpool/primitives/barriers.md diff --git a/constantine/platforms/threadpool/primitives/barriers.nim b/constantine/threadpool/primitives/barriers.nim similarity index 100% rename from constantine/platforms/threadpool/primitives/barriers.nim rename to constantine/threadpool/primitives/barriers.nim diff --git a/constantine/platforms/threadpool/primitives/barriers_macos.nim b/constantine/threadpool/primitives/barriers_macos.nim similarity index 100% rename from constantine/platforms/threadpool/primitives/barriers_macos.nim rename to constantine/threadpool/primitives/barriers_macos.nim diff --git a/constantine/platforms/threadpool/primitives/barriers_posix.nim b/constantine/threadpool/primitives/barriers_posix.nim similarity index 100% rename from constantine/platforms/threadpool/primitives/barriers_posix.nim rename to constantine/threadpool/primitives/barriers_posix.nim diff --git a/constantine/platforms/threadpool/primitives/barriers_windows.nim b/constantine/threadpool/primitives/barriers_windows.nim similarity index 100% rename from constantine/platforms/threadpool/primitives/barriers_windows.nim rename to constantine/threadpool/primitives/barriers_windows.nim diff --git a/constantine/platforms/threadpool/primitives/futexes.nim b/constantine/threadpool/primitives/futexes.nim similarity index 100% rename from constantine/platforms/threadpool/primitives/futexes.nim rename to constantine/threadpool/primitives/futexes.nim diff --git a/constantine/platforms/threadpool/primitives/futexes_linux.nim b/constantine/threadpool/primitives/futexes_linux.nim similarity index 100% rename from constantine/platforms/threadpool/primitives/futexes_linux.nim rename to constantine/threadpool/primitives/futexes_linux.nim diff --git a/constantine/platforms/threadpool/primitives/futexes_macos.nim b/constantine/threadpool/primitives/futexes_macos.nim similarity index 100% rename from constantine/platforms/threadpool/primitives/futexes_macos.nim rename to constantine/threadpool/primitives/futexes_macos.nim diff --git a/constantine/platforms/threadpool/primitives/futexes_windows.nim b/constantine/threadpool/primitives/futexes_windows.nim similarity index 100% rename from constantine/platforms/threadpool/primitives/futexes_windows.nim rename to constantine/threadpool/primitives/futexes_windows.nim diff --git a/constantine/platforms/threadpool/primitives/timers.nim b/constantine/threadpool/primitives/timers.nim similarity index 100% rename from constantine/platforms/threadpool/primitives/timers.nim rename to constantine/threadpool/primitives/timers.nim diff --git a/constantine/platforms/threadpool/threadpool.nim b/constantine/threadpool/threadpool.nim similarity index 99% rename from constantine/platforms/threadpool/threadpool.nim rename to constantine/threadpool/threadpool.nim index 75d9541..f308761 100644 --- a/constantine/platforms/threadpool/threadpool.nim +++ b/constantine/threadpool/threadpool.nim @@ -21,14 +21,14 @@ import ./instrumentation, ./primitives/barriers, ./parallel_offloading, - ../allocs, ../bithacks + ../platforms/[allocs, bithacks] export # flowvars Flowvar, isSpawned, isReady when defined(TP_Metrics): - import ../static_for + import ../platforms/static_for import system/ansi_c # ############################################################ diff --git a/tests/math/t_bigints_mod_vs_gmp.nim b/tests/math_arbitrary_precision/t_bigints_mod_vs_gmp.nim similarity index 100% rename from tests/math/t_bigints_mod_vs_gmp.nim rename to tests/math_arbitrary_precision/t_bigints_mod_vs_gmp.nim diff --git a/tests/math/support/canaries.nim b/tests/math_bigints/support/canaries.nim similarity index 100% rename from tests/math/support/canaries.nim rename to tests/math_bigints/support/canaries.nim diff --git a/tests/math/t_bigints.nim b/tests/math_bigints/t_bigints.nim similarity index 100% rename from tests/math/t_bigints.nim rename to tests/math_bigints/t_bigints.nim diff --git a/tests/math/t_bigints_mul_high_words_vs_gmp.nim b/tests/math_bigints/t_bigints_mul_high_words_vs_gmp.nim similarity index 100% rename from tests/math/t_bigints_mul_high_words_vs_gmp.nim rename to tests/math_bigints/t_bigints_mul_high_words_vs_gmp.nim diff --git a/tests/math/t_bigints_mul_vs_gmp.nim b/tests/math_bigints/t_bigints_mul_vs_gmp.nim similarity index 100% rename from tests/math/t_bigints_mul_vs_gmp.nim rename to tests/math_bigints/t_bigints_mul_vs_gmp.nim diff --git a/tests/math/t_bigints_multimod.nim b/tests/math_bigints/t_bigints_multimod.nim similarity index 100% rename from tests/math/t_bigints_multimod.nim rename to tests/math_bigints/t_bigints_multimod.nim diff --git a/tests/math/t_io_bigints.nim b/tests/math_bigints/t_io_bigints.nim similarity index 100% rename from tests/math/t_io_bigints.nim rename to tests/math_bigints/t_io_bigints.nim diff --git a/tests/math/t_ec_conversion.nim b/tests/math_elliptic_curves/t_ec_conversion.nim similarity index 100% rename from tests/math/t_ec_conversion.nim rename to tests/math_elliptic_curves/t_ec_conversion.nim diff --git a/tests/math/t_ec_frobenius.nim b/tests/math_elliptic_curves/t_ec_frobenius.nim similarity index 100% rename from tests/math/t_ec_frobenius.nim rename to tests/math_elliptic_curves/t_ec_frobenius.nim diff --git a/tests/math/t_ec_sage_bls12_377.nim b/tests/math_elliptic_curves/t_ec_sage_bls12_377.nim similarity index 100% rename from tests/math/t_ec_sage_bls12_377.nim rename to tests/math_elliptic_curves/t_ec_sage_bls12_377.nim diff --git a/tests/math/t_ec_sage_bls12_381.nim b/tests/math_elliptic_curves/t_ec_sage_bls12_381.nim similarity index 100% rename from tests/math/t_ec_sage_bls12_381.nim rename to tests/math_elliptic_curves/t_ec_sage_bls12_381.nim diff --git a/tests/math/t_ec_sage_bn254_nogami.nim b/tests/math_elliptic_curves/t_ec_sage_bn254_nogami.nim similarity index 100% rename from tests/math/t_ec_sage_bn254_nogami.nim rename to tests/math_elliptic_curves/t_ec_sage_bn254_nogami.nim diff --git a/tests/math/t_ec_sage_bn254_snarks.nim b/tests/math_elliptic_curves/t_ec_sage_bn254_snarks.nim similarity index 100% rename from tests/math/t_ec_sage_bn254_snarks.nim rename to tests/math_elliptic_curves/t_ec_sage_bn254_snarks.nim diff --git a/tests/math/t_ec_sage_bw6_761_g1.nim b/tests/math_elliptic_curves/t_ec_sage_bw6_761_g1.nim similarity index 100% rename from tests/math/t_ec_sage_bw6_761_g1.nim rename to tests/math_elliptic_curves/t_ec_sage_bw6_761_g1.nim diff --git a/tests/math/t_ec_sage_bw6_761_g2.nim b/tests/math_elliptic_curves/t_ec_sage_bw6_761_g2.nim similarity index 100% rename from tests/math/t_ec_sage_bw6_761_g2.nim rename to tests/math_elliptic_curves/t_ec_sage_bw6_761_g2.nim diff --git a/tests/math/t_ec_sage_pallas.nim b/tests/math_elliptic_curves/t_ec_sage_pallas.nim similarity index 100% rename from tests/math/t_ec_sage_pallas.nim rename to tests/math_elliptic_curves/t_ec_sage_pallas.nim diff --git a/tests/math/t_ec_sage_template.nim b/tests/math_elliptic_curves/t_ec_sage_template.nim similarity index 100% rename from tests/math/t_ec_sage_template.nim rename to tests/math_elliptic_curves/t_ec_sage_template.nim diff --git a/tests/math/t_ec_sage_vesta.nim b/tests/math_elliptic_curves/t_ec_sage_vesta.nim similarity index 100% rename from tests/math/t_ec_sage_vesta.nim rename to tests/math_elliptic_curves/t_ec_sage_vesta.nim diff --git a/tests/math/t_ec_shortw_jac_g1_add_double.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g1_add_double.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g1_add_double.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g1_add_double.nim diff --git a/tests/math/t_ec_shortw_jac_g1_mixed_add.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g1_mixed_add.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g1_mixed_add.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g1_mixed_add.nim diff --git a/tests/math/t_ec_shortw_jac_g1_msm.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g1_msm.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g1_msm.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g1_msm.nim diff --git a/tests/math/t_ec_shortw_jac_g1_mul_distri.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g1_mul_distri.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g1_mul_distri.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g1_mul_distri.nim diff --git a/tests/math/t_ec_shortw_jac_g1_mul_sanity.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g1_mul_sanity.nim similarity index 94% rename from tests/math/t_ec_shortw_jac_g1_mul_sanity.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g1_mul_sanity.nim index 4c1ca9b..18d4563 100644 --- a/tests/math/t_ec_shortw_jac_g1_mul_sanity.nim +++ b/tests/math_elliptic_curves/t_ec_shortw_jac_g1_mul_sanity.nim @@ -10,9 +10,9 @@ import # Standard library std/[unittest, times], # Internals - ../../constantine/math/config/[common, curves], - ../../constantine/math/[arithmetic, primitives], - ../../constantine/math/io/[io_bigints, io_fields, io_ec], + ../../constantine/math/config/curves, + ../../constantine/math/arithmetic, + ../../constantine/math/io/io_fields, ../../constantine/math/elliptic/[ec_shortweierstrass_affine, ec_shortweierstrass_jacobian, ec_scalar_mul], # Test utilities ../../helpers/prng_unsafe, diff --git a/tests/math/t_ec_shortw_jac_g1_mul_vs_ref.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g1_mul_vs_ref.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g1_mul_vs_ref.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g1_mul_vs_ref.nim diff --git a/tests/math/t_ec_shortw_jac_g1_sum_reduce.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g1_sum_reduce.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g1_sum_reduce.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g1_sum_reduce.nim diff --git a/tests/math/t_ec_shortw_jac_g2_add_double_bls12_377.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bls12_377.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_add_double_bls12_377.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bls12_377.nim diff --git a/tests/math/t_ec_shortw_jac_g2_add_double_bls12_381.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bls12_381.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_add_double_bls12_381.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bls12_381.nim diff --git a/tests/math/t_ec_shortw_jac_g2_add_double_bn254_snarks.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bn254_snarks.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_add_double_bn254_snarks.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bn254_snarks.nim diff --git a/tests/math/t_ec_shortw_jac_g2_add_double_bw6_761.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bw6_761.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_add_double_bw6_761.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bw6_761.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mixed_add_bls12_377.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bls12_377.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mixed_add_bls12_377.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bls12_377.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mixed_add_bls12_381.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bls12_381.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mixed_add_bls12_381.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bls12_381.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mixed_add_bn254_snarks.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bn254_snarks.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mixed_add_bn254_snarks.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bn254_snarks.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mixed_add_bw6_761.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bw6_761.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mixed_add_bw6_761.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bw6_761.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mul_distri_bls12_377.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bls12_377.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mul_distri_bls12_377.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bls12_377.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mul_distri_bls12_381.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bls12_381.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mul_distri_bls12_381.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bls12_381.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mul_distri_bn254_snarks.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bn254_snarks.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mul_distri_bn254_snarks.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bn254_snarks.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mul_distri_bw6_761.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bw6_761.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mul_distri_bw6_761.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bw6_761.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mul_sanity_bls12_377.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bls12_377.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mul_sanity_bls12_377.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bls12_377.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mul_sanity_bls12_381.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bls12_381.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mul_sanity_bls12_381.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bls12_381.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mul_sanity_bn254_snarks.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bn254_snarks.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mul_sanity_bn254_snarks.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bn254_snarks.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mul_sanity_bw6_761.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bw6_761.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mul_sanity_bw6_761.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bw6_761.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bls12_377.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bls12_377.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bls12_377.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bls12_377.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bls12_381.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bls12_381.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bls12_381.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bls12_381.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bn254_snarks.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bn254_snarks.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bn254_snarks.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bn254_snarks.nim diff --git a/tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bw6_761.nim b/tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bw6_761.nim similarity index 100% rename from tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bw6_761.nim rename to tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bw6_761.nim diff --git a/tests/math/t_ec_shortw_jacext_g1_add_double.nim b/tests/math_elliptic_curves/t_ec_shortw_jacext_g1_add_double.nim similarity index 100% rename from tests/math/t_ec_shortw_jacext_g1_add_double.nim rename to tests/math_elliptic_curves/t_ec_shortw_jacext_g1_add_double.nim diff --git a/tests/math/t_ec_shortw_jacext_g1_mixed_add.nim b/tests/math_elliptic_curves/t_ec_shortw_jacext_g1_mixed_add.nim similarity index 100% rename from tests/math/t_ec_shortw_jacext_g1_mixed_add.nim rename to tests/math_elliptic_curves/t_ec_shortw_jacext_g1_mixed_add.nim diff --git a/tests/math/t_ec_shortw_jacext_g1_sum_reduce.nim b/tests/math_elliptic_curves/t_ec_shortw_jacext_g1_sum_reduce.nim similarity index 100% rename from tests/math/t_ec_shortw_jacext_g1_sum_reduce.nim rename to tests/math_elliptic_curves/t_ec_shortw_jacext_g1_sum_reduce.nim diff --git a/tests/math/t_ec_shortw_prj_edge_cases.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_edge_cases.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_edge_cases.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_edge_cases.nim diff --git a/tests/math/t_ec_shortw_prj_g1_add_double.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g1_add_double.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g1_add_double.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g1_add_double.nim diff --git a/tests/math/t_ec_shortw_prj_g1_mixed_add.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g1_mixed_add.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g1_mixed_add.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g1_mixed_add.nim diff --git a/tests/math/t_ec_shortw_prj_g1_msm.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g1_msm.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g1_msm.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g1_msm.nim diff --git a/tests/math/t_ec_shortw_prj_g1_mul_distri.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g1_mul_distri.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g1_mul_distri.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g1_mul_distri.nim diff --git a/tests/math/t_ec_shortw_prj_g1_mul_sanity.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g1_mul_sanity.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g1_mul_sanity.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g1_mul_sanity.nim diff --git a/tests/math/t_ec_shortw_prj_g1_mul_vs_ref.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g1_mul_vs_ref.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g1_mul_vs_ref.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g1_mul_vs_ref.nim diff --git a/tests/math/t_ec_shortw_prj_g1_sum_reduce.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g1_sum_reduce.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g1_sum_reduce.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g1_sum_reduce.nim diff --git a/tests/math/t_ec_shortw_prj_g2_add_double_bls12_377.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bls12_377.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_add_double_bls12_377.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bls12_377.nim diff --git a/tests/math/t_ec_shortw_prj_g2_add_double_bls12_381.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bls12_381.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_add_double_bls12_381.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bls12_381.nim diff --git a/tests/math/t_ec_shortw_prj_g2_add_double_bn254_snarks.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bn254_snarks.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_add_double_bn254_snarks.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bn254_snarks.nim diff --git a/tests/math/t_ec_shortw_prj_g2_add_double_bw6_761.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bw6_761.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_add_double_bw6_761.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bw6_761.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mixed_add_bls12_377.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bls12_377.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mixed_add_bls12_377.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bls12_377.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mixed_add_bls12_381.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bls12_381.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mixed_add_bls12_381.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bls12_381.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mixed_add_bn254_snarks.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bn254_snarks.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mixed_add_bn254_snarks.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bn254_snarks.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mixed_add_bw6_761.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bw6_761.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mixed_add_bw6_761.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bw6_761.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mul_distri_bls12_377.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bls12_377.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mul_distri_bls12_377.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bls12_377.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mul_distri_bls12_381.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bls12_381.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mul_distri_bls12_381.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bls12_381.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mul_distri_bn254_snarks.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bn254_snarks.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mul_distri_bn254_snarks.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bn254_snarks.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mul_distri_bw6_761.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bw6_761.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mul_distri_bw6_761.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bw6_761.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mul_sanity_bls12_377.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bls12_377.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mul_sanity_bls12_377.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bls12_377.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mul_sanity_bls12_381.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bls12_381.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mul_sanity_bls12_381.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bls12_381.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mul_sanity_bn254_snarks.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bn254_snarks.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mul_sanity_bn254_snarks.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bn254_snarks.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mul_sanity_bw6_761.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bw6_761.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mul_sanity_bw6_761.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bw6_761.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bls12_377.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bls12_377.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bls12_377.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bls12_377.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bls12_381.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bls12_381.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bls12_381.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bls12_381.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bn254_snarks.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bn254_snarks.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bn254_snarks.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bn254_snarks.nim diff --git a/tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bw6_761.nim b/tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bw6_761.nim similarity index 100% rename from tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bw6_761.nim rename to tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bw6_761.nim diff --git a/tests/math/t_ec_subgroups_bls12_377.nim b/tests/math_elliptic_curves/t_ec_subgroups_bls12_377.nim similarity index 100% rename from tests/math/t_ec_subgroups_bls12_377.nim rename to tests/math_elliptic_curves/t_ec_subgroups_bls12_377.nim diff --git a/tests/math/t_ec_subgroups_bls12_381.nim b/tests/math_elliptic_curves/t_ec_subgroups_bls12_381.nim similarity index 100% rename from tests/math/t_ec_subgroups_bls12_381.nim rename to tests/math_elliptic_curves/t_ec_subgroups_bls12_381.nim diff --git a/tests/math/t_ec_subgroups_bn254_nogami.nim b/tests/math_elliptic_curves/t_ec_subgroups_bn254_nogami.nim similarity index 100% rename from tests/math/t_ec_subgroups_bn254_nogami.nim rename to tests/math_elliptic_curves/t_ec_subgroups_bn254_nogami.nim diff --git a/tests/math/t_ec_subgroups_bn254_snarks.nim b/tests/math_elliptic_curves/t_ec_subgroups_bn254_snarks.nim similarity index 100% rename from tests/math/t_ec_subgroups_bn254_snarks.nim rename to tests/math_elliptic_curves/t_ec_subgroups_bn254_snarks.nim diff --git a/tests/math/t_ec_template.nim b/tests/math_elliptic_curves/t_ec_template.nim similarity index 100% rename from tests/math/t_ec_template.nim rename to tests/math_elliptic_curves/t_ec_template.nim diff --git a/tests/math/t_ec_twedwards_prj_add_double.nim b/tests/math_elliptic_curves/t_ec_twedwards_prj_add_double.nim similarity index 100% rename from tests/math/t_ec_twedwards_prj_add_double.nim rename to tests/math_elliptic_curves/t_ec_twedwards_prj_add_double.nim diff --git a/tests/math/t_ec_twedwards_prj_mul_distri.nim b/tests/math_elliptic_curves/t_ec_twedwards_prj_mul_distri.nim similarity index 100% rename from tests/math/t_ec_twedwards_prj_mul_distri.nim rename to tests/math_elliptic_curves/t_ec_twedwards_prj_mul_distri.nim diff --git a/tests/math/t_ec_twedwards_prj_mul_sanity.nim b/tests/math_elliptic_curves/t_ec_twedwards_prj_mul_sanity.nim similarity index 100% rename from tests/math/t_ec_twedwards_prj_mul_sanity.nim rename to tests/math_elliptic_curves/t_ec_twedwards_prj_mul_sanity.nim diff --git a/tests/math/t_ec_twedwards_prj_mul_vs_ref.nim b/tests/math_elliptic_curves/t_ec_twedwards_prj_mul_vs_ref.nim similarity index 100% rename from tests/math/t_ec_twedwards_prj_mul_vs_ref.nim rename to tests/math_elliptic_curves/t_ec_twedwards_prj_mul_vs_ref.nim diff --git a/tests/math/vectors/tv_BLS12_377_scalar_mul_G1_128bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G1_128bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_377_scalar_mul_G1_128bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G1_128bit.json diff --git a/tests/math/vectors/tv_BLS12_377_scalar_mul_G1_253bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G1_253bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_377_scalar_mul_G1_253bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G1_253bit.json diff --git a/tests/math/vectors/tv_BLS12_377_scalar_mul_G1_32bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G1_32bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_377_scalar_mul_G1_32bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G1_32bit.json diff --git a/tests/math/vectors/tv_BLS12_377_scalar_mul_G1_64bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G1_64bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_377_scalar_mul_G1_64bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G1_64bit.json diff --git a/tests/math/vectors/tv_BLS12_377_scalar_mul_G2_128bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G2_128bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_377_scalar_mul_G2_128bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G2_128bit.json diff --git a/tests/math/vectors/tv_BLS12_377_scalar_mul_G2_253bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G2_253bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_377_scalar_mul_G2_253bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G2_253bit.json diff --git a/tests/math/vectors/tv_BLS12_377_scalar_mul_G2_32bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G2_32bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_377_scalar_mul_G2_32bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G2_32bit.json diff --git a/tests/math/vectors/tv_BLS12_377_scalar_mul_G2_64bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G2_64bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_377_scalar_mul_G2_64bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_377_scalar_mul_G2_64bit.json diff --git a/tests/math/vectors/tv_BLS12_381_scalar_mul_G1_128bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G1_128bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_381_scalar_mul_G1_128bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G1_128bit.json diff --git a/tests/math/vectors/tv_BLS12_381_scalar_mul_G1_255bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G1_255bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_381_scalar_mul_G1_255bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G1_255bit.json diff --git a/tests/math/vectors/tv_BLS12_381_scalar_mul_G1_32bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G1_32bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_381_scalar_mul_G1_32bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G1_32bit.json diff --git a/tests/math/vectors/tv_BLS12_381_scalar_mul_G1_64bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G1_64bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_381_scalar_mul_G1_64bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G1_64bit.json diff --git a/tests/math/vectors/tv_BLS12_381_scalar_mul_G2_128bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G2_128bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_381_scalar_mul_G2_128bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G2_128bit.json diff --git a/tests/math/vectors/tv_BLS12_381_scalar_mul_G2_255bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G2_255bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_381_scalar_mul_G2_255bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G2_255bit.json diff --git a/tests/math/vectors/tv_BLS12_381_scalar_mul_G2_32bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G2_32bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_381_scalar_mul_G2_32bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G2_32bit.json diff --git a/tests/math/vectors/tv_BLS12_381_scalar_mul_G2_64bit.json b/tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G2_64bit.json similarity index 100% rename from tests/math/vectors/tv_BLS12_381_scalar_mul_G2_64bit.json rename to tests/math_elliptic_curves/vectors/tv_BLS12_381_scalar_mul_G2_64bit.json diff --git a/tests/math/vectors/tv_BN254_Nogami_scalar_mul_G1_254bit.json b/tests/math_elliptic_curves/vectors/tv_BN254_Nogami_scalar_mul_G1_254bit.json similarity index 100% rename from tests/math/vectors/tv_BN254_Nogami_scalar_mul_G1_254bit.json rename to tests/math_elliptic_curves/vectors/tv_BN254_Nogami_scalar_mul_G1_254bit.json diff --git a/tests/math/vectors/tv_BN254_Nogami_scalar_mul_G2_254bit.json b/tests/math_elliptic_curves/vectors/tv_BN254_Nogami_scalar_mul_G2_254bit.json similarity index 100% rename from tests/math/vectors/tv_BN254_Nogami_scalar_mul_G2_254bit.json rename to tests/math_elliptic_curves/vectors/tv_BN254_Nogami_scalar_mul_G2_254bit.json diff --git a/tests/math/vectors/tv_BN254_Snarks_scalar_mul_G1_128bit.json b/tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G1_128bit.json similarity index 100% rename from tests/math/vectors/tv_BN254_Snarks_scalar_mul_G1_128bit.json rename to tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G1_128bit.json diff --git a/tests/math/vectors/tv_BN254_Snarks_scalar_mul_G1_254bit.json b/tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G1_254bit.json similarity index 100% rename from tests/math/vectors/tv_BN254_Snarks_scalar_mul_G1_254bit.json rename to tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G1_254bit.json diff --git a/tests/math/vectors/tv_BN254_Snarks_scalar_mul_G1_32bit.json b/tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G1_32bit.json similarity index 100% rename from tests/math/vectors/tv_BN254_Snarks_scalar_mul_G1_32bit.json rename to tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G1_32bit.json diff --git a/tests/math/vectors/tv_BN254_Snarks_scalar_mul_G1_64bit.json b/tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G1_64bit.json similarity index 100% rename from tests/math/vectors/tv_BN254_Snarks_scalar_mul_G1_64bit.json rename to tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G1_64bit.json diff --git a/tests/math/vectors/tv_BN254_Snarks_scalar_mul_G2_128bit.json b/tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G2_128bit.json similarity index 100% rename from tests/math/vectors/tv_BN254_Snarks_scalar_mul_G2_128bit.json rename to tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G2_128bit.json diff --git a/tests/math/vectors/tv_BN254_Snarks_scalar_mul_G2_254bit.json b/tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G2_254bit.json similarity index 100% rename from tests/math/vectors/tv_BN254_Snarks_scalar_mul_G2_254bit.json rename to tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G2_254bit.json diff --git a/tests/math/vectors/tv_BN254_Snarks_scalar_mul_G2_32bit.json b/tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G2_32bit.json similarity index 100% rename from tests/math/vectors/tv_BN254_Snarks_scalar_mul_G2_32bit.json rename to tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G2_32bit.json diff --git a/tests/math/vectors/tv_BN254_Snarks_scalar_mul_G2_64bit.json b/tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G2_64bit.json similarity index 100% rename from tests/math/vectors/tv_BN254_Snarks_scalar_mul_G2_64bit.json rename to tests/math_elliptic_curves/vectors/tv_BN254_Snarks_scalar_mul_G2_64bit.json diff --git a/tests/math/vectors/tv_BW6_761_scalar_mul_G1_377bit.json b/tests/math_elliptic_curves/vectors/tv_BW6_761_scalar_mul_G1_377bit.json similarity index 100% rename from tests/math/vectors/tv_BW6_761_scalar_mul_G1_377bit.json rename to tests/math_elliptic_curves/vectors/tv_BW6_761_scalar_mul_G1_377bit.json diff --git a/tests/math/vectors/tv_BW6_761_scalar_mul_G2_377bit.json b/tests/math_elliptic_curves/vectors/tv_BW6_761_scalar_mul_G2_377bit.json similarity index 100% rename from tests/math/vectors/tv_BW6_761_scalar_mul_G2_377bit.json rename to tests/math_elliptic_curves/vectors/tv_BW6_761_scalar_mul_G2_377bit.json diff --git a/tests/math/vectors/tv_Pallas_scalar_mul_G1_255bit.json b/tests/math_elliptic_curves/vectors/tv_Pallas_scalar_mul_G1_255bit.json similarity index 100% rename from tests/math/vectors/tv_Pallas_scalar_mul_G1_255bit.json rename to tests/math_elliptic_curves/vectors/tv_Pallas_scalar_mul_G1_255bit.json diff --git a/tests/math/vectors/tv_Vesta_scalar_mul_G1_255bit.json b/tests/math_elliptic_curves/vectors/tv_Vesta_scalar_mul_G1_255bit.json similarity index 100% rename from tests/math/vectors/tv_Vesta_scalar_mul_G1_255bit.json rename to tests/math_elliptic_curves/vectors/tv_Vesta_scalar_mul_G1_255bit.json diff --git a/tests/math/t_fp12_anti_regression.nim b/tests/math_extension_fields/t_fp12_anti_regression.nim similarity index 100% rename from tests/math/t_fp12_anti_regression.nim rename to tests/math_extension_fields/t_fp12_anti_regression.nim diff --git a/tests/math/t_fp12_bls12_377.nim b/tests/math_extension_fields/t_fp12_bls12_377.nim similarity index 100% rename from tests/math/t_fp12_bls12_377.nim rename to tests/math_extension_fields/t_fp12_bls12_377.nim diff --git a/tests/math/t_fp12_bls12_381.nim b/tests/math_extension_fields/t_fp12_bls12_381.nim similarity index 100% rename from tests/math/t_fp12_bls12_381.nim rename to tests/math_extension_fields/t_fp12_bls12_381.nim diff --git a/tests/math/t_fp12_bn254_nogami.nim b/tests/math_extension_fields/t_fp12_bn254_nogami.nim similarity index 100% rename from tests/math/t_fp12_bn254_nogami.nim rename to tests/math_extension_fields/t_fp12_bn254_nogami.nim diff --git a/tests/math/t_fp12_bn254_snarks.nim b/tests/math_extension_fields/t_fp12_bn254_snarks.nim similarity index 100% rename from tests/math/t_fp12_bn254_snarks.nim rename to tests/math_extension_fields/t_fp12_bn254_snarks.nim diff --git a/tests/math/t_fp12_exponentiation.nim b/tests/math_extension_fields/t_fp12_exponentiation.nim similarity index 100% rename from tests/math/t_fp12_exponentiation.nim rename to tests/math_extension_fields/t_fp12_exponentiation.nim diff --git a/tests/math/t_fp12_frobenius.nim b/tests/math_extension_fields/t_fp12_frobenius.nim similarity index 100% rename from tests/math/t_fp12_frobenius.nim rename to tests/math_extension_fields/t_fp12_frobenius.nim diff --git a/tests/math/t_fp2.nim b/tests/math_extension_fields/t_fp2.nim similarity index 100% rename from tests/math/t_fp2.nim rename to tests/math_extension_fields/t_fp2.nim diff --git a/tests/math/t_fp2_frobenius.nim b/tests/math_extension_fields/t_fp2_frobenius.nim similarity index 100% rename from tests/math/t_fp2_frobenius.nim rename to tests/math_extension_fields/t_fp2_frobenius.nim diff --git a/tests/math/t_fp2_sqrt.nim b/tests/math_extension_fields/t_fp2_sqrt.nim similarity index 100% rename from tests/math/t_fp2_sqrt.nim rename to tests/math_extension_fields/t_fp2_sqrt.nim diff --git a/tests/math/t_fp4.nim b/tests/math_extension_fields/t_fp4.nim similarity index 100% rename from tests/math/t_fp4.nim rename to tests/math_extension_fields/t_fp4.nim diff --git a/tests/math/t_fp4_frobenius.nim b/tests/math_extension_fields/t_fp4_frobenius.nim similarity index 100% rename from tests/math/t_fp4_frobenius.nim rename to tests/math_extension_fields/t_fp4_frobenius.nim diff --git a/tests/math/t_fp6_bls12_377.nim b/tests/math_extension_fields/t_fp6_bls12_377.nim similarity index 100% rename from tests/math/t_fp6_bls12_377.nim rename to tests/math_extension_fields/t_fp6_bls12_377.nim diff --git a/tests/math/t_fp6_bls12_381.nim b/tests/math_extension_fields/t_fp6_bls12_381.nim similarity index 100% rename from tests/math/t_fp6_bls12_381.nim rename to tests/math_extension_fields/t_fp6_bls12_381.nim diff --git a/tests/math/t_fp6_bn254_nogami.nim b/tests/math_extension_fields/t_fp6_bn254_nogami.nim similarity index 100% rename from tests/math/t_fp6_bn254_nogami.nim rename to tests/math_extension_fields/t_fp6_bn254_nogami.nim diff --git a/tests/math/t_fp6_bn254_snarks.nim b/tests/math_extension_fields/t_fp6_bn254_snarks.nim similarity index 100% rename from tests/math/t_fp6_bn254_snarks.nim rename to tests/math_extension_fields/t_fp6_bn254_snarks.nim diff --git a/tests/math/t_fp6_bw6_761.nim b/tests/math_extension_fields/t_fp6_bw6_761.nim similarity index 100% rename from tests/math/t_fp6_bw6_761.nim rename to tests/math_extension_fields/t_fp6_bw6_761.nim diff --git a/tests/math/t_fp6_frobenius.nim b/tests/math_extension_fields/t_fp6_frobenius.nim similarity index 100% rename from tests/math/t_fp6_frobenius.nim rename to tests/math_extension_fields/t_fp6_frobenius.nim diff --git a/tests/math/t_fp_tower_frobenius_template.nim b/tests/math_extension_fields/t_fp_tower_frobenius_template.nim similarity index 100% rename from tests/math/t_fp_tower_frobenius_template.nim rename to tests/math_extension_fields/t_fp_tower_frobenius_template.nim diff --git a/tests/math/t_fp_tower_template.nim b/tests/math_extension_fields/t_fp_tower_template.nim similarity index 100% rename from tests/math/t_fp_tower_template.nim rename to tests/math_extension_fields/t_fp_tower_template.nim diff --git a/tests/math/t_finite_fields.nim b/tests/math_fields/t_finite_fields.nim similarity index 100% rename from tests/math/t_finite_fields.nim rename to tests/math_fields/t_finite_fields.nim diff --git a/tests/math/t_finite_fields.nim.cfg b/tests/math_fields/t_finite_fields.nim.cfg similarity index 100% rename from tests/math/t_finite_fields.nim.cfg rename to tests/math_fields/t_finite_fields.nim.cfg diff --git a/tests/math/t_finite_fields_conditional_arithmetic.nim b/tests/math_fields/t_finite_fields_conditional_arithmetic.nim similarity index 100% rename from tests/math/t_finite_fields_conditional_arithmetic.nim rename to tests/math_fields/t_finite_fields_conditional_arithmetic.nim diff --git a/tests/math/t_finite_fields_double_precision.nim b/tests/math_fields/t_finite_fields_double_precision.nim similarity index 100% rename from tests/math/t_finite_fields_double_precision.nim rename to tests/math_fields/t_finite_fields_double_precision.nim diff --git a/tests/math/t_finite_fields_double_precision.nim.cfg b/tests/math_fields/t_finite_fields_double_precision.nim.cfg similarity index 100% rename from tests/math/t_finite_fields_double_precision.nim.cfg rename to tests/math_fields/t_finite_fields_double_precision.nim.cfg diff --git a/tests/math/t_finite_fields_mulsquare.nim b/tests/math_fields/t_finite_fields_mulsquare.nim similarity index 100% rename from tests/math/t_finite_fields_mulsquare.nim rename to tests/math_fields/t_finite_fields_mulsquare.nim diff --git a/tests/math/t_finite_fields_mulsquare.nim.cfg b/tests/math_fields/t_finite_fields_mulsquare.nim.cfg similarity index 100% rename from tests/math/t_finite_fields_mulsquare.nim.cfg rename to tests/math_fields/t_finite_fields_mulsquare.nim.cfg diff --git a/tests/math/t_finite_fields_powinv.nim b/tests/math_fields/t_finite_fields_powinv.nim similarity index 100% rename from tests/math/t_finite_fields_powinv.nim rename to tests/math_fields/t_finite_fields_powinv.nim diff --git a/tests/math/t_finite_fields_powinv.nim.cfg b/tests/math_fields/t_finite_fields_powinv.nim.cfg similarity index 100% rename from tests/math/t_finite_fields_powinv.nim.cfg rename to tests/math_fields/t_finite_fields_powinv.nim.cfg diff --git a/tests/math/t_finite_fields_sqrt.nim b/tests/math_fields/t_finite_fields_sqrt.nim similarity index 100% rename from tests/math/t_finite_fields_sqrt.nim rename to tests/math_fields/t_finite_fields_sqrt.nim diff --git a/tests/math/t_finite_fields_sqrt.nim.cfg b/tests/math_fields/t_finite_fields_sqrt.nim.cfg similarity index 100% rename from tests/math/t_finite_fields_sqrt.nim.cfg rename to tests/math_fields/t_finite_fields_sqrt.nim.cfg diff --git a/tests/math/t_finite_fields_vs_gmp.nim b/tests/math_fields/t_finite_fields_vs_gmp.nim similarity index 100% rename from tests/math/t_finite_fields_vs_gmp.nim rename to tests/math_fields/t_finite_fields_vs_gmp.nim diff --git a/tests/math/t_fp_cubic_root.nim b/tests/math_fields/t_fp_cubic_root.nim similarity index 100% rename from tests/math/t_fp_cubic_root.nim rename to tests/math_fields/t_fp_cubic_root.nim diff --git a/tests/math/t_fr.nim b/tests/math_fields/t_fr.nim similarity index 100% rename from tests/math/t_fr.nim rename to tests/math_fields/t_fr.nim diff --git a/tests/math/t_io_fields.nim b/tests/math_fields/t_io_fields.nim similarity index 100% rename from tests/math/t_io_fields.nim rename to tests/math_fields/t_io_fields.nim diff --git a/tests/math/t_io_fields.nim.cfg b/tests/math_fields/t_io_fields.nim.cfg similarity index 100% rename from tests/math/t_io_fields.nim.cfg rename to tests/math_fields/t_io_fields.nim.cfg diff --git a/tests/math/t_pairing_bls12_377_gt_subgroup.nim b/tests/math_pairings/t_pairing_bls12_377_gt_subgroup.nim similarity index 100% rename from tests/math/t_pairing_bls12_377_gt_subgroup.nim rename to tests/math_pairings/t_pairing_bls12_377_gt_subgroup.nim diff --git a/tests/math/t_pairing_bls12_377_line_functions.nim b/tests/math_pairings/t_pairing_bls12_377_line_functions.nim similarity index 100% rename from tests/math/t_pairing_bls12_377_line_functions.nim rename to tests/math_pairings/t_pairing_bls12_377_line_functions.nim diff --git a/tests/math/t_pairing_bls12_377_multi.nim b/tests/math_pairings/t_pairing_bls12_377_multi.nim similarity index 100% rename from tests/math/t_pairing_bls12_377_multi.nim rename to tests/math_pairings/t_pairing_bls12_377_multi.nim diff --git a/tests/math/t_pairing_bls12_377_optate.nim b/tests/math_pairings/t_pairing_bls12_377_optate.nim similarity index 100% rename from tests/math/t_pairing_bls12_377_optate.nim rename to tests/math_pairings/t_pairing_bls12_377_optate.nim diff --git a/tests/math/t_pairing_bls12_381_gt_subgroup.nim b/tests/math_pairings/t_pairing_bls12_381_gt_subgroup.nim similarity index 100% rename from tests/math/t_pairing_bls12_381_gt_subgroup.nim rename to tests/math_pairings/t_pairing_bls12_381_gt_subgroup.nim diff --git a/tests/math/t_pairing_bls12_381_line_functions.nim b/tests/math_pairings/t_pairing_bls12_381_line_functions.nim similarity index 100% rename from tests/math/t_pairing_bls12_381_line_functions.nim rename to tests/math_pairings/t_pairing_bls12_381_line_functions.nim diff --git a/tests/math/t_pairing_bls12_381_multi.nim b/tests/math_pairings/t_pairing_bls12_381_multi.nim similarity index 100% rename from tests/math/t_pairing_bls12_381_multi.nim rename to tests/math_pairings/t_pairing_bls12_381_multi.nim diff --git a/tests/math/t_pairing_bls12_381_optate.nim b/tests/math_pairings/t_pairing_bls12_381_optate.nim similarity index 100% rename from tests/math/t_pairing_bls12_381_optate.nim rename to tests/math_pairings/t_pairing_bls12_381_optate.nim diff --git a/tests/math/t_pairing_bn254_nogami_gt_subgroup.nim b/tests/math_pairings/t_pairing_bn254_nogami_gt_subgroup.nim similarity index 100% rename from tests/math/t_pairing_bn254_nogami_gt_subgroup.nim rename to tests/math_pairings/t_pairing_bn254_nogami_gt_subgroup.nim diff --git a/tests/math/t_pairing_bn254_nogami_multi.nim b/tests/math_pairings/t_pairing_bn254_nogami_multi.nim similarity index 100% rename from tests/math/t_pairing_bn254_nogami_multi.nim rename to tests/math_pairings/t_pairing_bn254_nogami_multi.nim diff --git a/tests/math/t_pairing_bn254_nogami_optate.nim b/tests/math_pairings/t_pairing_bn254_nogami_optate.nim similarity index 100% rename from tests/math/t_pairing_bn254_nogami_optate.nim rename to tests/math_pairings/t_pairing_bn254_nogami_optate.nim diff --git a/tests/math/t_pairing_bn254_snarks_gt_subgroup.nim b/tests/math_pairings/t_pairing_bn254_snarks_gt_subgroup.nim similarity index 100% rename from tests/math/t_pairing_bn254_snarks_gt_subgroup.nim rename to tests/math_pairings/t_pairing_bn254_snarks_gt_subgroup.nim diff --git a/tests/math/t_pairing_bn254_snarks_multi.nim b/tests/math_pairings/t_pairing_bn254_snarks_multi.nim similarity index 100% rename from tests/math/t_pairing_bn254_snarks_multi.nim rename to tests/math_pairings/t_pairing_bn254_snarks_multi.nim diff --git a/tests/math/t_pairing_bn254_snarks_optate.nim b/tests/math_pairings/t_pairing_bn254_snarks_optate.nim similarity index 100% rename from tests/math/t_pairing_bn254_snarks_optate.nim rename to tests/math_pairings/t_pairing_bn254_snarks_optate.nim diff --git a/tests/math/t_pairing_bw6_761_gt_subgroup.nim b/tests/math_pairings/t_pairing_bw6_761_gt_subgroup.nim similarity index 100% rename from tests/math/t_pairing_bw6_761_gt_subgroup.nim rename to tests/math_pairings/t_pairing_bw6_761_gt_subgroup.nim diff --git a/tests/math/t_pairing_bw6_761_optate.nim b/tests/math_pairings/t_pairing_bw6_761_optate.nim similarity index 100% rename from tests/math/t_pairing_bw6_761_optate.nim rename to tests/math_pairings/t_pairing_bw6_761_optate.nim diff --git a/tests/math/t_pairing_cyclotomic_subgroup.nim b/tests/math_pairings/t_pairing_cyclotomic_subgroup.nim similarity index 100% rename from tests/math/t_pairing_cyclotomic_subgroup.nim rename to tests/math_pairings/t_pairing_cyclotomic_subgroup.nim diff --git a/tests/math/t_pairing_mul_fp12_by_lines.nim b/tests/math_pairings/t_pairing_mul_fp12_by_lines.nim similarity index 100% rename from tests/math/t_pairing_mul_fp12_by_lines.nim rename to tests/math_pairings/t_pairing_mul_fp12_by_lines.nim diff --git a/tests/math/t_pairing_template.nim b/tests/math_pairings/t_pairing_template.nim similarity index 100% rename from tests/math/t_pairing_template.nim rename to tests/math_pairings/t_pairing_template.nim diff --git a/tests/parallel/t_ec_template_parallel.nim b/tests/parallel/t_ec_template_parallel.nim index becd93c..dc9da46 100644 --- a/tests/parallel/t_ec_template_parallel.nim +++ b/tests/parallel/t_ec_template_parallel.nim @@ -27,7 +27,7 @@ import ec_scalar_mul, ec_multi_scalar_mul, ec_multi_scalar_mul_parallel], - ../../constantine/platforms/threadpool/threadpool, + ../../constantine/threadpool/threadpool, # Test utilities ../../helpers/prng_unsafe diff --git a/tests/math/t_io_unsaturated.nim b/tests/primitives/t_io_unsaturated.nim similarity index 100% rename from tests/math/t_io_unsaturated.nim rename to tests/primitives/t_io_unsaturated.nim diff --git a/tests/math/t_primitives.nim b/tests/primitives/t_primitives.nim similarity index 100% rename from tests/math/t_primitives.nim rename to tests/primitives/t_primitives.nim diff --git a/tests/math/t_primitives_extended_precision.nim b/tests/primitives/t_primitives_extended_precision.nim similarity index 100% rename from tests/math/t_primitives_extended_precision.nim rename to tests/primitives/t_primitives_extended_precision.nim