mirror of
https://github.com/logos-storage/constantine.git
synced 2026-01-04 06:03:08 +00:00
move staticFor to the inner repo, not helpers/ for unblocking nimble install (#216)
This commit is contained in:
parent
a11fca9c60
commit
7c5421ffdc
@ -14,7 +14,6 @@ import
|
|||||||
ec_shortweierstrass_projective,
|
ec_shortweierstrass_projective,
|
||||||
ec_shortweierstrass_jacobian],
|
ec_shortweierstrass_jacobian],
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_elliptic_template
|
./bench_elliptic_template
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import
|
|||||||
ec_shortweierstrass_batch_ops_parallel],
|
ec_shortweierstrass_batch_ops_parallel],
|
||||||
../constantine/platforms/threadpool/threadpool,
|
../constantine/platforms/threadpool/threadpool,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/[static_for, prng_unsafe],
|
../helpers/prng_unsafe,
|
||||||
./bench_elliptic_template,
|
./bench_elliptic_template,
|
||||||
./bench_blueprint
|
./bench_blueprint
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import
|
|||||||
ec_shortweierstrass_projective,
|
ec_shortweierstrass_projective,
|
||||||
ec_shortweierstrass_jacobian],
|
ec_shortweierstrass_jacobian],
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_elliptic_template,
|
./bench_elliptic_template,
|
||||||
# Standard library
|
# Standard library
|
||||||
std/strutils
|
std/strutils
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import
|
|||||||
../helpers/prng_unsafe,
|
../helpers/prng_unsafe,
|
||||||
./bench_blueprint
|
./bench_blueprint
|
||||||
|
|
||||||
export notes
|
export notes, abstractions
|
||||||
proc separator*() = separator(165)
|
proc separator*() = separator(165)
|
||||||
proc smallSeparator*() = separator(8)
|
proc smallSeparator*() = separator(8)
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import
|
|||||||
../constantine/math/io/io_bigints,
|
../constantine/math/io/io_bigints,
|
||||||
../constantine/math/constants/zoo_square_roots,
|
../constantine/math/constants/zoo_square_roots,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_fields_template
|
./bench_fields_template
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import
|
|||||||
../constantine/math/config/curves,
|
../constantine/math/config/curves,
|
||||||
../constantine/math/extension_fields,
|
../constantine/math/extension_fields,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_fields_template
|
./bench_fields_template
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import
|
|||||||
../constantine/math/config/curves,
|
../constantine/math/config/curves,
|
||||||
../constantine/math/extension_fields,
|
../constantine/math/extension_fields,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_fields_template
|
./bench_fields_template
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import
|
|||||||
../constantine/math/config/curves,
|
../constantine/math/config/curves,
|
||||||
../constantine/math/extension_fields,
|
../constantine/math/extension_fields,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_fields_template
|
./bench_fields_template
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import
|
|||||||
../constantine/math/config/curves,
|
../constantine/math/config/curves,
|
||||||
../constantine/math/extension_fields,
|
../constantine/math/extension_fields,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_fields_template
|
./bench_fields_template
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import
|
|||||||
../constantine/math/arithmetic,
|
../constantine/math/arithmetic,
|
||||||
../constantine/math/extension_fields,
|
../constantine/math/extension_fields,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/[prng_unsafe, static_for],
|
../helpers/prng_unsafe,
|
||||||
./platforms,
|
./platforms,
|
||||||
# Standard library
|
# Standard library
|
||||||
std/[monotimes, times, strformat, strutils]
|
std/[monotimes, times, strformat, strutils]
|
||||||
@ -218,7 +218,7 @@ proc reduce2x*(T: typedesc, iters: int) =
|
|||||||
r.redc2x(t)
|
r.redc2x(t)
|
||||||
|
|
||||||
proc reduce2xViaDivision*(T: typedesc, iters: int) =
|
proc reduce2xViaDivision*(T: typedesc, iters: int) =
|
||||||
|
|
||||||
const bits2x = 2 * T.C.getCurveBitWidth()
|
const bits2x = 2 * T.C.getCurveBitWidth()
|
||||||
var r: matchingBigInt(T.C)
|
var r: matchingBigInt(T.C)
|
||||||
let t = rng.random_unsafe(BigInt[bits2x])
|
let t = rng.random_unsafe(BigInt[bits2x])
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import
|
|||||||
../constantine/math/arithmetic,
|
../constantine/math/arithmetic,
|
||||||
../constantine/math/extension_fields,
|
../constantine/math/extension_fields,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_pairing_template
|
./bench_pairing_template
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import
|
|||||||
../constantine/math/arithmetic,
|
../constantine/math/arithmetic,
|
||||||
../constantine/math/extension_fields,
|
../constantine/math/extension_fields,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_pairing_template
|
./bench_pairing_template
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import
|
|||||||
../constantine/math/arithmetic,
|
../constantine/math/arithmetic,
|
||||||
../constantine/math/extension_fields,
|
../constantine/math/extension_fields,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_pairing_template
|
./bench_pairing_template
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import
|
|||||||
../constantine/math/arithmetic,
|
../constantine/math/arithmetic,
|
||||||
../constantine/math/extension_fields,
|
../constantine/math/extension_fields,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_pairing_template
|
./bench_pairing_template
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|||||||
@ -31,6 +31,7 @@ import
|
|||||||
../helpers/prng_unsafe,
|
../helpers/prng_unsafe,
|
||||||
./bench_blueprint
|
./bench_blueprint
|
||||||
|
|
||||||
|
export abstractions
|
||||||
export zoo_pairings # generic sandwich https://github.com/nim-lang/Nim/issues/11225
|
export zoo_pairings # generic sandwich https://github.com/nim-lang/Nim/issues/11225
|
||||||
export notes
|
export notes
|
||||||
proc separator*() = separator(132)
|
proc separator*() = separator(132)
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import
|
|||||||
../constantine/math/arithmetic,
|
../constantine/math/arithmetic,
|
||||||
../constantine/math/extension_fields,
|
../constantine/math/extension_fields,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_summary_template
|
./bench_summary_template
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import
|
|||||||
../constantine/math/arithmetic,
|
../constantine/math/arithmetic,
|
||||||
../constantine/math/extension_fields,
|
../constantine/math/extension_fields,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_summary_template
|
./bench_summary_template
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import
|
|||||||
../constantine/math/arithmetic,
|
../constantine/math/arithmetic,
|
||||||
../constantine/math/extension_fields,
|
../constantine/math/extension_fields,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_summary_template
|
./bench_summary_template
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import
|
|||||||
../constantine/math/arithmetic,
|
../constantine/math/arithmetic,
|
||||||
../constantine/math/extension_fields,
|
../constantine/math/extension_fields,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_summary_template
|
./bench_summary_template
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import
|
|||||||
../constantine/math/arithmetic,
|
../constantine/math/arithmetic,
|
||||||
../constantine/math/extension_fields,
|
../constantine/math/extension_fields,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/static_for,
|
|
||||||
./bench_summary_template
|
./bench_summary_template
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|||||||
@ -32,7 +32,7 @@ import
|
|||||||
../constantine/hashes,
|
../constantine/hashes,
|
||||||
../constantine/hash_to_curve/hash_to_curve,
|
../constantine/hash_to_curve/hash_to_curve,
|
||||||
# Helpers
|
# Helpers
|
||||||
../helpers/[prng_unsafe, static_for],
|
../helpers/prng_unsafe,
|
||||||
./bench_blueprint
|
./bench_blueprint
|
||||||
|
|
||||||
export
|
export
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import
|
|||||||
extended_precision
|
extended_precision
|
||||||
],
|
],
|
||||||
./bithacks,
|
./bithacks,
|
||||||
../../helpers/static_for
|
./static_for
|
||||||
|
|
||||||
export
|
export
|
||||||
ct_types,
|
ct_types,
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
||||||
|
|
||||||
|
|
||||||
import
|
import
|
||||||
# Standard library
|
# Standard library
|
||||||
std/[unittest, times],
|
std/[unittest, times],
|
||||||
# Internal
|
# Internal
|
||||||
@ -17,7 +17,7 @@ import
|
|||||||
../../constantine/math/arithmetic,
|
../../constantine/math/arithmetic,
|
||||||
../../constantine/math_gpu/fields_nvidia,
|
../../constantine/math_gpu/fields_nvidia,
|
||||||
# Test utilities
|
# Test utilities
|
||||||
../../helpers/[prng_unsafe, static_for]
|
../../helpers/prng_unsafe
|
||||||
|
|
||||||
var rng: RngState
|
var rng: RngState
|
||||||
let seed = uint32(getTime().toUnix() and (1'i64 shl 32 - 1)) # unixTime mod 2^32
|
let seed = uint32(getTime().toUnix() and (1'i64 shl 32 - 1)) # unixTime mod 2^32
|
||||||
@ -87,7 +87,7 @@ proc t_field_add(curve: static Curve) =
|
|||||||
let b = rng.random_long01Seq(Fp[curve])
|
let b = rng.random_long01Seq(Fp[curve])
|
||||||
|
|
||||||
var rCPU, rGPU_32, rGPU_64: Fp[curve]
|
var rCPU, rGPU_32, rGPU_64: Fp[curve]
|
||||||
|
|
||||||
rCPU.sum(a, b)
|
rCPU.sum(a, b)
|
||||||
fpAdd32.exec(rGPU_32, a, b)
|
fpAdd32.exec(rGPU_32, a, b)
|
||||||
fpAdd64.exec(rGPU_64, a, b)
|
fpAdd64.exec(rGPU_64, a, b)
|
||||||
@ -101,7 +101,7 @@ proc t_field_add(curve: static Curve) =
|
|||||||
let b = rng.random_long01Seq(Fr[curve])
|
let b = rng.random_long01Seq(Fr[curve])
|
||||||
|
|
||||||
var rCPU, rGPU_32, rGPU_64: Fr[curve]
|
var rCPU, rGPU_32, rGPU_64: Fr[curve]
|
||||||
|
|
||||||
rCPU.sum(a, b)
|
rCPU.sum(a, b)
|
||||||
frAdd32.exec(rGPU_32, a, b)
|
frAdd32.exec(rGPU_32, a, b)
|
||||||
frAdd64.exec(rGPU_64, a, b)
|
frAdd64.exec(rGPU_64, a, b)
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import
|
|||||||
../../constantine/math/config/curves,
|
../../constantine/math/config/curves,
|
||||||
../../constantine/math/io/io_extfields,
|
../../constantine/math/io/io_extfields,
|
||||||
# Test utilities
|
# Test utilities
|
||||||
../../helpers/[prng_unsafe, static_for]
|
../../helpers/prng_unsafe
|
||||||
|
|
||||||
const
|
const
|
||||||
Iters = 2
|
Iters = 2
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import
|
|||||||
../../constantine/math/config/curves,
|
../../constantine/math/config/curves,
|
||||||
../../constantine/math/io/io_extfields,
|
../../constantine/math/io/io_extfields,
|
||||||
# Test utilities
|
# Test utilities
|
||||||
../../helpers/[prng_unsafe, static_for]
|
../../helpers/prng_unsafe
|
||||||
|
|
||||||
const
|
const
|
||||||
Iters = 8
|
Iters = 8
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import
|
|||||||
../../constantine/math/arithmetic,
|
../../constantine/math/arithmetic,
|
||||||
../../constantine/math/isogenies/frobenius,
|
../../constantine/math/isogenies/frobenius,
|
||||||
# Test utilities
|
# Test utilities
|
||||||
../../helpers/[prng_unsafe, static_for]
|
../../helpers/prng_unsafe
|
||||||
|
|
||||||
export unittest # Generic sandwich
|
export unittest # Generic sandwich
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import
|
|||||||
../../constantine/math/arithmetic,
|
../../constantine/math/arithmetic,
|
||||||
../../constantine/math/io/io_extfields,
|
../../constantine/math/io/io_extfields,
|
||||||
# Test utilities
|
# Test utilities
|
||||||
../../helpers/[prng_unsafe, static_for]
|
../../helpers/prng_unsafe
|
||||||
|
|
||||||
export unittest # Generic sandwich
|
export unittest # Generic sandwich
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ import
|
|||||||
ec_scalar_mul],
|
ec_scalar_mul],
|
||||||
../../constantine/math/pairings/lines_eval,
|
../../constantine/math/pairings/lines_eval,
|
||||||
# Test utilities
|
# Test utilities
|
||||||
../../helpers/[prng_unsafe, static_for]
|
../../helpers/prng_unsafe
|
||||||
|
|
||||||
const
|
const
|
||||||
Iters = 4
|
Iters = 4
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import
|
|||||||
ec_shortweierstrass_projective],
|
ec_shortweierstrass_projective],
|
||||||
../../constantine/math/pairings/lines_eval,
|
../../constantine/math/pairings/lines_eval,
|
||||||
# Test utilities
|
# Test utilities
|
||||||
../../helpers/[prng_unsafe, static_for]
|
../../helpers/prng_unsafe
|
||||||
|
|
||||||
const
|
const
|
||||||
Iters = 4
|
Iters = 4
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import
|
|||||||
../../constantine/math/pairings/cyclotomic_subgroups,
|
../../constantine/math/pairings/cyclotomic_subgroups,
|
||||||
../../constantine/math/isogenies/frobenius,
|
../../constantine/math/isogenies/frobenius,
|
||||||
# Test utilities
|
# Test utilities
|
||||||
../../helpers/[prng_unsafe, static_for]
|
../../helpers/prng_unsafe
|
||||||
|
|
||||||
const
|
const
|
||||||
Iters = 4
|
Iters = 4
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import
|
|||||||
../../constantine/math/io/io_extfields,
|
../../constantine/math/io/io_extfields,
|
||||||
../../constantine/math/pairings/lines_eval,
|
../../constantine/math/pairings/lines_eval,
|
||||||
# Test utilities
|
# Test utilities
|
||||||
../../helpers/[prng_unsafe, static_for]
|
../../helpers/prng_unsafe
|
||||||
|
|
||||||
const
|
const
|
||||||
Iters = 8
|
Iters = 8
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user