Remove outdated TODOs [skip ci]

- noinline consts: https://github.com/nim-lang/RFCs/issues/257
This commit is contained in:
mratsim 2020-10-11 21:33:59 +02:00
parent 6530596032
commit 1383aae105
13 changed files with 5 additions and 27 deletions

View File

@ -6,7 +6,7 @@
# * 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.
when defined(amd64): # TODO defined(i386) but it seems lie RDTSC call is misconfigured
when defined(amd64): # TODO defined(i386) but it seems like RDTSC call is misconfigured
import platforms/x86
export getTicks, cpuName

View File

@ -142,7 +142,6 @@ const useDebug = [
proc test(flags, path: string, commandFile = false) =
# commandFile should be a "file" but Nimscript doesn't support IO
# TODO: use a proper runner
if not dirExists "build":
mkDir "build"
# Compilation language is controlled by WEAVE_TEST_LANG

View File

@ -107,8 +107,6 @@ func steinsGCD*(v: var Limbs, a: Limbs, F, M: Limbs, bits: int, mp1div2: Limbs)
# TODO: the inlining of primitives like `csub` is bad for codesize
# but there is a 80% slowdown without it.
# TODO: The `cmov` in `cadd` and `csub` always retest the condition
# which is probably costly here given how many we have.
var a = a
var b = M

View File

@ -22,7 +22,6 @@ import
# - properly cross the compile-time -> runtime boundary
# - avoid inlining large const arrays at the call site
# for example when using the `r2modP` constant in multiple overloads in the same module
# TODO: check that those constants use extern const to avoid duplication across modules
type
CurveFamily* = enum
@ -352,9 +351,9 @@ macro declareCurves*(curves: untyped): untyped =
## ...
## ]
##
## TODO: Ensure that
## 1. the modulus is not inlined at runtime to avoid codesize explosion.
## 2. is not duplicated across compilation modules.
## Ensure that
## 1. the modulus is not inlined at runtime to avoid codesize explosion.
## 2. is not duplicated across compilation modules.
curves.expectKind(nnkStmtList)
curvesDefinitions.parseCurveDecls(curves)

View File

@ -56,11 +56,6 @@ func decomposeEndo*[M, scalBits, L: static int](
## - Conditional negate is about 10 cycles per Fp, on G2 projective we have 3 (coords) * 2 (Fp2) * 10 (cycles) ~= 60 cycles
## We need to test the mini scalar, which is 65 bits so 2 Fp so about 2 cycles
## and negate it as well.
##
## However solution 1 seems to cause issues (TODO)
## with some of the BLS12-381 test cases (6 and 9)
## - 0x5668a2332db27199dcfb7cbdfca6317c2ff128db26d7df68483e0a095ec8e88f
## - 0x644dc62869683f0c93f38eaef2ba6912569dc91ec2806e46b4a3dd6a4421dad1
# Equal when no window or no negative handling, greater otherwise
static: doAssert L >= (scalBits + M - 1) div M + 1

View File

@ -111,7 +111,6 @@ func trySetFromCoordX*[F, Tw](
## Note: Dedicated robust procedures for hashing-to-curve
## will be provided, this is intended for testing purposes.
P.y.curve_eq_rhs(x, Tw)
# TODO: supports non p ≡ 3 (mod 4) modulus like BLS12-377
result = sqrt_if_square(P.y)
func neg*(P: var ECP_ShortW_Aff, Q: ECP_ShortW_Aff) =

View File

@ -92,7 +92,6 @@ func trySetFromCoordsXandZ*[F; Tw](
## Note: Dedicated robust procedures for hashing-to-curve
## will be provided, this is intended for testing purposes.
P.y.curve_eq_rhs(x, Tw)
# TODO: supports non p ≡ 3 (mod 4) modulus like BLS12-377
result = sqrt_if_square(P.y)
var z2 {.noInit.}: F
@ -116,7 +115,6 @@ func trySetFromCoordX*[F; Tw](
## Note: Dedicated robust procedures for hashing-to-curve
## will be provided, this is intended for testing purposes.
P.y.curve_eq_rhs(x, Tw)
# TODO: supports non p ≡ 3 (mod 4) modulus like BLS12-377
result = sqrt_if_square(P.y)
P.x = x
P.z.setOne()

View File

@ -86,7 +86,6 @@ func trySetFromCoordsXandZ*[F; Tw](
## Note: Dedicated robust procedures for hashing-to-curve
## will be provided, this is intended for testing purposes.
P.y.curve_eq_rhs(x, Tw)
# TODO: supports non p ≡ 3 (mod 4) modulus like BLS12-377
result = sqrt_if_square(P.y)
P.x.prod(x, z)
@ -107,7 +106,6 @@ func trySetFromCoordX*[F; Tw](
## Note: Dedicated robust procedures for hashing-to-curve
## will be provided, this is intended for testing purposes.
P.y.curve_eq_rhs(x, Tw)
# TODO: supports non p ≡ 3 (mod 4) modulus like BLS12-377
result = sqrt_if_square(P.y)
P.x = x
P.z.setOne()

View File

@ -36,8 +36,6 @@ func toHex*[EC](P: EC): string =
## CT:
## - no leaks
##
## TODO: only normalize and don't display the Z coordinate
##
## This proc output may change format in the future
var aff {.noInit.}: ECP_ShortW_Aff[EC.F, EC.Tw]

View File

@ -52,7 +52,6 @@ func millerLoopGenericBLS12*[C](
) =
## Generic Miller Loop for BLS12 curve
## Computes f{u,Q}(P) with u the BLS curve parameter
# TODO: retrieve the curve parameter from the curve declaration
# Boundary cases
# Loop start
@ -147,9 +146,6 @@ func finalExpHard_BLS12*[C](f: var Fp12[C]) =
#
# p14: 3 Φ₁₂(p(x))/r(x) = (x1)² (x+p) (x²+p²1) + 3
#
# TODO: paper costs are 4Eₓ+Eₓ/₂+7M₁₂+S₁₂+F₁+F₂
# so we have an extra cyclotomic squaring since we use 5Eₓ
#
# with
# - Eₓ being f^x
# - Eₓ/₂ being f^(x/2)

View File

@ -49,7 +49,6 @@ func millerLoopGenericBN*[C](
) =
## Generic Miller Loop for BN curves
## Computes f{6u+2,Q}(P) with u the BN curve parameter
# TODO: retrieve the curve parameter from the curve declaration
# TODO - boundary cases
# Loop start

View File

@ -216,7 +216,6 @@ func `*=`*(a: var Fp4, _: typedesc[γ]) {.inline.} =
func `*=`*(a: var Fp2, b: Fp) =
## Multiply an element of Fp2 by an element of Fp
# TODO: make generic and move to tower_field_extensions
a.c0 *= b
a.c1 *= b

View File

@ -72,7 +72,7 @@ proc binary_prologue[C: static Curve, N: static int](
doAssert len >= aW, "Expected at most " & $len & " bytes but wrote " & $aW & " for " & toHex(aBuf) & " (big-endian)"
doAssert len >= bW, "Expected at most " & $len & " bytes but wrote " & $bW & " for " & toHex(bBuf) & " (big-endian)"
# Build the bigint - TODO more fields codecs
# Build the bigint
aTest = Fp[C].fromBig BigInt[bits].fromRawUint(aBuf.toOpenArray(0, aW-1), bigEndian)
bTest = Fp[C].fromBig BigInt[bits].fromRawUint(bBuf.toOpenArray(0, bW-1), bigEndian)