Skip to content

Commit

Permalink
refactor(math/config/curves): math/config/curves moved out of math to…
Browse files Browse the repository at this point in the history
… a 'named' folder + use project-root path + prepare for using named fields and not just named curves for STARK primes (#400)
  • Loading branch information
mratsim authored Jun 25, 2024
1 parent 5290d6b commit 0718fce
Show file tree
Hide file tree
Showing 429 changed files with 1,670 additions and 1,694 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import
# Stdlib
system/ansi_c, std/[strformat, os, strutils, math, cpuinfo, streams, strscans],
# Constantine
../../constantine/threadpool
constantine/threadpool

when defined(linux):
# bench
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import
# STD lib
std/[os, strutils, cpuinfo, strformat, math],
# Library
../../constantine/threadpool,
constantine/threadpool,
# bench
../wtime, ../resources

Expand Down
2 changes: 1 addition & 1 deletion benchmarks-threadpool/dfs/threadpool_dfs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import
# Stdlib
std/[strformat, os, strutils, cpuinfo],
# Library
../../constantine/threadpool
constantine/threadpool

when not defined(windows):
# bench
Expand Down
2 changes: 1 addition & 1 deletion benchmarks-threadpool/fibonacci/threadpool_fib.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import
# STD lib
std/[os, strutils, cpuinfo, strformat, math],
# Library
../../constantine/threadpool
constantine/threadpool

when not defined(windows):
# bench
Expand Down
2 changes: 1 addition & 1 deletion benchmarks-threadpool/heat/threadpool_heat.nim
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import
# Stdlib
system/ansi_c, std/[strformat, os, strutils, math, cpuinfo],
# Library
../../constantine/threadpool
constantine/threadpool
when not defined(windows):
# bench
import ../wtime, ../resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import
# Stdlib
system/ansi_c, std/[os, strutils, cpuinfo, math, strformat, locks],
# Constantine
../../constantine/threadpool
constantine/threadpool

when not defined(windows):
# bench
Expand Down
4 changes: 2 additions & 2 deletions benchmarks-threadpool/logsumexp/threadpool_logsumexp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import
# Stdlib
system/ansi_c, std/[strformat, os, strutils, cpuinfo, math, random, locks],
# Constantine
../../constantine/threadpool
constantine/threadpool

when not defined(windows):
# bench
Expand Down Expand Up @@ -399,4 +399,4 @@ proc main() =

tp.shutdown()

main()
main()
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import
# Stdlib
system/ansi_c, std/[strformat, os, strutils, math, cpuinfo],
# Library
../../constantine/threadpool,
constantine/threadpool,
# bench
../wtime, ../resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import
# Stdlib
system/ansi_c, std/[strformat, os, strutils, math, cpuinfo],
# Constantine
../../constantine/threadpool
constantine/threadpool

when not defined(windows):
# bench
Expand Down Expand Up @@ -316,4 +316,4 @@ proc main() =
wv_free(bufOut)
wv_free(bufIn)

main()
main()
2 changes: 1 addition & 1 deletion benchmarks-threadpool/nqueens/threadpool_nqueens.nim
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import
# Stdlib
system/ansi_c, std/[strformat, os, strutils, cpuinfo],
# library
../../constantine/threadpool
constantine/threadpool

when not defined(windows):
# bench
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import
# STD lib
system/ansi_c, std/[os, strutils, cpuinfo, strformat, math],
# Library
../../constantine/threadpool,
constantine/threadpool,
# bench
../wtime, ../resources

Expand Down
4 changes: 2 additions & 2 deletions benchmarks/bench_blueprint.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

import
# Internal
../constantine/platforms/abstractions,
constantine/platforms/abstractions,
# Helpers
../helpers/prng_unsafe,
helpers/prng_unsafe,
./platforms,
# Standard library
std/[monotimes, times, strformat, strutils, macros]
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/bench_ec_g1.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import
# Internals
../constantine/math/config/curves,
../constantine/math/arithmetic,
../constantine/math/elliptic/[
constantine/named/algebra,
constantine/math/arithmetic,
constantine/math/elliptic/[
ec_shortweierstrass_projective,
ec_shortweierstrass_jacobian,
ec_shortweierstrass_jacobian_extended],
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/bench_ec_g1_batch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import
# Internals
../constantine/math/config/curves,
../constantine/math/arithmetic,
../constantine/math/elliptic/[
constantine/named/algebra,
constantine/math/arithmetic,
constantine/math/elliptic/[
ec_shortweierstrass_projective,
ec_shortweierstrass_jacobian,
ec_shortweierstrass_jacobian_extended],
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/bench_ec_g1_scalar_mul.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import
# Internals
../constantine/math/config/curves,
../constantine/math/arithmetic,
../constantine/math/elliptic/[
constantine/named/algebra,
constantine/math/arithmetic,
constantine/math/elliptic/[
ec_shortweierstrass_projective,
ec_shortweierstrass_jacobian],
# Helpers
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/bench_ec_g2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

import
# Internals
../constantine/math/config/curves,
../constantine/math/arithmetic,
../constantine/math/extension_fields,
../constantine/math/elliptic/[
constantine/named/algebra,
constantine/math/arithmetic,
constantine/math/extension_fields,
constantine/math/elliptic/[
ec_shortweierstrass_projective,
ec_shortweierstrass_jacobian,
ec_shortweierstrass_jacobian_extended],
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/bench_ec_g2_scalar_mul.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

import
# Internals
../constantine/math/config/curves,
../constantine/math/arithmetic,
../constantine/math/extension_fields,
../constantine/math/elliptic/[
constantine/named/algebra,
constantine/math/arithmetic,
constantine/math/extension_fields,
constantine/math/elliptic/[
ec_shortweierstrass_projective,
ec_shortweierstrass_jacobian],
# Helpers
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/bench_ec_msm_bandersnatch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

import
# Internals
../constantine/math/config/curves,
../constantine/math/arithmetic,
../constantine/math/elliptic/ec_twistededwards_projective,
constantine/named/algebra,
constantine/math/arithmetic,
constantine/math/elliptic/ec_twistededwards_projective,
# Helpers
../helpers/prng_unsafe,
helpers/prng_unsafe,
./bench_elliptic_parallel_template

# ############################################################
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/bench_ec_msm_bls12_381_g1.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

import
# Internals
../constantine/math/config/curves,
../constantine/math/arithmetic,
../constantine/math/elliptic/[
constantine/named/algebra,
constantine/math/arithmetic,
constantine/math/elliptic/[
ec_shortweierstrass_projective,
ec_shortweierstrass_jacobian],
# Helpers
../helpers/prng_unsafe,
helpers/prng_unsafe,
./bench_elliptic_parallel_template

# ############################################################
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/bench_ec_msm_bls12_381_g2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

import
# Internals
../constantine/math/config/curves,
../constantine/math/extension_fields,
../constantine/math/elliptic/[
constantine/named/algebra,
constantine/math/extension_fields,
constantine/math/elliptic/[
ec_shortweierstrass_projective,
ec_shortweierstrass_jacobian],
# Helpers
../helpers/prng_unsafe,
helpers/prng_unsafe,
./bench_elliptic_parallel_template

# ############################################################
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/bench_ec_msm_bn254_snarks_g1.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import
# Internals
../constantine/math/config/curves,
../constantine/math/arithmetic,
../constantine/math/elliptic/[
constantine/named/algebra,
constantine/math/arithmetic,
constantine/math/elliptic/[
ec_shortweierstrass_projective,
ec_shortweierstrass_jacobian],
# Helpers
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/bench_ec_msm_pasta.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

import
# Internals
../constantine/math/config/curves,
../constantine/math/arithmetic,
../constantine/math/elliptic/[
constantine/named/algebra,
constantine/math/arithmetic,
constantine/math/elliptic/[
ec_shortweierstrass_projective,
ec_shortweierstrass_jacobian],
# Helpers
../helpers/prng_unsafe,
helpers/prng_unsafe,
./bench_elliptic_parallel_template

# ############################################################
Expand Down
12 changes: 6 additions & 6 deletions benchmarks/bench_elliptic_parallel_template.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import
# Internals
../constantine/math/config/curves,
../constantine/math/arithmetic,
../constantine/math/elliptic/[
constantine/named/algebra,
constantine/math/arithmetic,
constantine/math/elliptic/[
ec_shortweierstrass_affine,
ec_shortweierstrass_projective,
ec_shortweierstrass_jacobian,
Expand All @@ -19,11 +19,11 @@ import
ec_multi_scalar_mul,
ec_scalar_mul, ec_scalar_mul_vartime,
ec_multi_scalar_mul_parallel],
../constantine/math/constants/zoo_subgroups,
constantine/named/zoo_subgroups,
# Threadpool
../constantine/threadpool/[threadpool, partitioners],
constantine/threadpool/[threadpool, partitioners],
# Helpers
../helpers/prng_unsafe,
helpers/prng_unsafe,
./bench_elliptic_template,
./bench_blueprint

Expand Down
16 changes: 8 additions & 8 deletions benchmarks/bench_elliptic_template.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@

import
# Internals
../constantine/platforms/abstractions,
../constantine/math/config/curves,
../constantine/math/arithmetic,
../constantine/math/io/io_bigints,
../constantine/math/elliptic/[
constantine/platforms/abstractions,
constantine/named/algebra,
constantine/math/arithmetic,
constantine/math/io/io_bigints,
constantine/math/elliptic/[
ec_shortweierstrass_affine,
ec_shortweierstrass_projective,
ec_shortweierstrass_jacobian,
ec_shortweierstrass_jacobian_extended,
ec_shortweierstrass_batch_ops,
ec_scalar_mul, ec_endomorphism_accel],
../constantine/math/constants/zoo_subgroups,
constantine/named/zoo_subgroups,
# Helpers
../helpers/prng_unsafe,
helpers/prng_unsafe,
./platforms,
./bench_blueprint,
# Reference unsafe scalar multiplication
../constantine/math/elliptic/ec_scalar_mul_vartime
constantine/math/elliptic/ec_scalar_mul_vartime

export notes
export abstractions # generic sandwich on SecretBool and SecretBool in Jacobian sum
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/bench_eth_bls_signatures.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

import
# Internals
../constantine/[
constantine/[
ethereum_bls_signatures_parallel,
ethereum_eip2333_bls12381_key_derivation],
../constantine/math/arithmetic,
../constantine/threadpool/threadpool,
constantine/math/arithmetic,
constantine/threadpool/threadpool,
# Std
std/[os, cpuinfo],
# Helpers
../helpers/prng_unsafe,
helpers/prng_unsafe,
./bench_blueprint

proc separator*() = separator(180)
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/bench_eth_eip2537_subgroup_checks_impact.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

import
# Internals
../constantine/math/config/curves,
../constantine/math/arithmetic,
../constantine/math/extension_fields,
../constantine/math/elliptic/ec_shortweierstrass_jacobian,
constantine/named/algebra,
constantine/math/arithmetic,
constantine/math/extension_fields,
constantine/math/elliptic/ec_shortweierstrass_jacobian,
# Helpers
./bench_elliptic_template

Expand Down
14 changes: 7 additions & 7 deletions benchmarks/bench_eth_eip4844_kzg.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

import
# Internals
../constantine/ethereum_eip4844_kzg_parallel,
../constantine/math/io/io_fields,
../constantine/math/config/[curves, type_ff],
../constantine/threadpool/threadpool,
../constantine/csprngs/sysrand,
../constantine/platforms/primitives,
constantine/ethereum_eip4844_kzg_parallel,
constantine/named/algebra,
constantine/math/io/io_fields,
constantine/threadpool/threadpool,
constantine/csprngs/sysrand,
constantine/platforms/primitives,
# Helpers
../helpers/prng_unsafe,
helpers/prng_unsafe,
./bench_blueprint,
# Standard library
std/[os, strutils]
Expand Down
Loading

0 comments on commit 0718fce

Please sign in to comment.