Unsed imports cleanup (#97)

This commit is contained in:
Mamy Ratsimbazafy 2020-10-04 17:33:17 +02:00 committed by GitHub
parent fc1c3472ce
commit d622f48507
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 23 additions and 46 deletions

View File

@ -11,8 +11,7 @@ import
std/macros,
# Internal
../../config/common,
../../primitives,
../limbs
../../primitives
# ############################################################
#

View File

@ -12,7 +12,6 @@ import
# Internal
../../config/common,
../../primitives,
../limbs,
./limbs_asm_montred_x86
# ############################################################

View File

@ -12,7 +12,6 @@ import
# Internal
../../config/common,
../../primitives,
../limbs,
./limbs_asm_montred_x86
# ############################################################

View File

@ -11,8 +11,7 @@ import
std/macros,
# Internal
../../config/common,
../../primitives,
../limbs
../../primitives
# ############################################################
#

View File

@ -12,7 +12,6 @@ import
# Internal
../../config/common,
../../primitives,
../limbs,
./limbs_asm_montred_x86
# ############################################################

View File

@ -27,7 +27,6 @@
import
../primitives,
../config/[common, type_fp, curves],
../io/io_bigints,
./bigints, ./limbs_montgomery
when UseASM_X86_64:

View File

@ -7,7 +7,7 @@
# at your option. This file may not be copied, modified, or distributed except according to those terms.
import
../config/[common, curves, type_bigint, type_fp],
../config/[common, curves, type_fp],
../primitives,
./bigints,
./finite_fields,

View File

@ -7,7 +7,7 @@
# at your option. This file may not be copied, modified, or distributed except according to those terms.
import
../config/[common, curves, type_fp],
../config/[curves, type_fp],
./bigints,
../curves/zoo_inversions

View File

@ -10,8 +10,7 @@ import
../primitives,
../config/[common, type_fp, curves],
../curves/zoo_square_roots,
../io/[io_bigints, io_fields],
./bigints, ./finite_fields, ./limbs_montgomery
./bigints, ./finite_fields
# ############################################################
#

View File

@ -162,7 +162,7 @@ func montyMul_FIPS(r: var Limbs, a, b, M: Limbs, m0ninv: BaseType) =
discard z.csub(M, v.isNonZero() or not(z < M))
r = z
func montySquare_CIOS_nocarry(r: var Limbs, a, M: Limbs, m0ninv: BaseType) =
func montySquare_CIOS_nocarry(r: var Limbs, a, M: Limbs, m0ninv: BaseType) {.used.}=
## Montgomery Multiplication using Coarse Grained Operand Scanning (CIOS)
## and no-carry optimization.
## This requires the most significant word of the Modulus
@ -206,7 +206,7 @@ func montySquare_CIOS_nocarry(r: var Limbs, a, M: Limbs, m0ninv: BaseType) =
discard t.csub(M, not(t < M))
r = t
func montySquare_CIOS(r: var Limbs, a, M: Limbs, m0ninv: BaseType) =
func montySquare_CIOS(r: var Limbs, a, M: Limbs, m0ninv: BaseType) {.used.}=
## Montgomery Multiplication using Coarse Grained Operand Scanning (CIOS)
##
## Architectural Support for Long Integer Modulo Arithmetic on Risc-Based Smart Cards

View File

@ -11,9 +11,7 @@ import
std/macros,
# Internal
./precompute,
./curves_declaration,
./type_fp,
../io/io_bigints
./curves_declaration
{.experimental: "dynamicBindSym".}

View File

@ -14,11 +14,8 @@ import
../config/[common, curves, type_bigint],
../curves/zoo_glv,
../arithmetic,
../io/io_bigints,
../towers,
../isogeny/frobenius,
./ec_shortweierstrass_affine,
./ec_shortweierstrass_projective
../isogeny/frobenius
# ############################################################
#

View File

@ -13,8 +13,6 @@ import
../towers,
./ec_shortweierstrass_affine
import ../io/io_fields
# ############################################################
#
# Elliptic Curve in Short Weierstrass form

View File

@ -7,8 +7,6 @@
# at your option. This file may not be copied, modified, or distributed except according to those terms.
import
# Standard library
std/[tables, unittest, times],
# Internals
../config/common,
../arithmetic,

View File

@ -8,7 +8,6 @@
import
./io_bigints,
../config/curves,
../arithmetic/finite_fields
# No exceptions allowed

View File

@ -8,7 +8,7 @@
import
../primitives,
../config/[common, curves],
../config/curves,
../arithmetic,
../towers,
../isogeny/frobenius

View File

@ -9,13 +9,10 @@
import
std/typetraits,
../primitives,
../config/[common, curves],
../config/curves,
../arithmetic,
../towers,
../elliptic/[
ec_shortweierstrass_affine,
ec_shortweierstrass_projective
],
../elliptic/ec_shortweierstrass_affine,
../io/io_towers
type

View File

@ -7,16 +7,14 @@
# at your option. This file may not be copied, modified, or distributed except according to those terms.
import
std/typetraits,
../primitives,
../config/[common, curves],
../config/curves,
../arithmetic,
../towers,
../elliptic/[
ec_shortweierstrass_affine,
ec_shortweierstrass_projective
],
../io/io_towers,
./lines_common
export lines_common

View File

@ -8,7 +8,7 @@
import
../primitives,
../config/[common, curves],
../config/curves,
../arithmetic,
../towers,
./lines_projective

View File

@ -9,7 +9,6 @@
import
../config/[curves, type_fp],
../towers,
../io/io_bigints,
../elliptic/[
ec_shortweierstrass_affine,
ec_shortweierstrass_projective

View File

@ -438,7 +438,7 @@ func adc*(a: var Assembler_x86, dst, src: Operand) =
a.codeFragment("adc", src, dst)
a.areFlagsClobbered = true
if dst.desc.rm != Reg:
if dst.desc.rm in {Mem, MemOffsettable, AnyRegOrMem}:
{.warning: "Using addcarry with a memory destination, this incurs significant performance penalties.".}
func adc*(a: var Assembler_x86, dst: Operand, imm: int) =
@ -447,7 +447,7 @@ func adc*(a: var Assembler_x86, dst: Operand, imm: int) =
a.codeFragment("adc", imm, dst)
a.areFlagsClobbered = true
if dst.desc.rm != Reg:
if dst.desc.rm in {Mem, MemOffsettable, AnyRegOrMem}:
{.warning: "Using addcarry with a memory destination, this incurs significant performance penalties.".}
func sub*(a: var Assembler_x86, dst, src: Operand) =

View File

@ -42,7 +42,7 @@ import
# | CH-SQR3 | 1M + 4S | 11A + 2B + 1 Div2 |
# | CH-SQR3x | 1M + 4S | 14A + 2B |
func square_Chung_Hasan_SQR2(r: var CubicExt, a: CubicExt) =
func square_Chung_Hasan_SQR2(r: var CubicExt, a: CubicExt) {.used.}=
## Returns r = a²
mixin prod, square, sum
var v3{.noInit.}, v4{.noInit.}, v5{.noInit.}: typeof(r.c0)

View File

@ -9,7 +9,7 @@
import
../arithmetic,
../config/[common, curves],
../config/common,
../primitives,
../io/io_bigints,
./tower_common,

View File

@ -59,7 +59,7 @@ func `*=`*(a: var Fp2, _: typedesc[SexticNonResidue]) {.inline.} =
# Yet another const tuple unpacking bug
const u = Fp2.C.get_SNR_Fp2()[0] # Sextic non-residue to construct 𝔽p12
const v = Fp2.C.get_SNR_Fp2()[1]
const Beta = Fp2.C.get_QNR_Fp() # Quadratic non-residue to construct 𝔽p2
const Beta {.used.} = Fp2.C.get_QNR_Fp() # Quadratic non-residue to construct 𝔽p2
# ξ = u + v x
# and x² = β
#
@ -136,9 +136,9 @@ func `*`*(_: typedesc[ξ], a: Fp2): Fp2 {.inline, noInit.} =
## Multiply an element of 𝔽p2 by the quadratic and cubic non-residue
## chosen to construct 𝔽p4/𝔽p6
# Yet another const tuple unpacking bug
const u = Fp2.C.get_CNR_Fp2()[0] # Quadratic & Cubic non-residue to construct 𝔽p4/𝔽p6
const u = Fp2.C.get_CNR_Fp2()[0] # Quadratic & Cubic non-residue to construct 𝔽p4/𝔽p6
const v = Fp2.C.get_CNR_Fp2()[1]
const Beta = Fp2.C.get_QNR_Fp() # Quadratic non-residue to construct 𝔽p2
const Beta {.used.} = Fp2.C.get_QNR_Fp() # Quadratic non-residue to construct 𝔽p2
# ξ = u + v x
# and x² = β
#
@ -162,7 +162,7 @@ func `*=`*(a: var Fp2, _: typedesc[ξ]) {.inline.} =
# Yet another const tuple unpacking bug
const u = Fp2.C.get_CNR_Fp2()[0] # Cubic non-residue to construct 𝔽p6
const v = Fp2.C.get_CNR_Fp2()[1]
const Beta = Fp2.C.get_QNR_Fp() # Quadratic non-residue to construct 𝔽p2
const Beta {.used.} = Fp2.C.get_QNR_Fp() # Quadratic non-residue to construct 𝔽p2
# ξ = u + v x
# and x² = β
#

View File

@ -17,7 +17,7 @@ import
../constantine/elliptic/ec_shortweierstrass_projective,
../constantine/hash_to_curve/cofactors,
# Test utilities
../helpers/[prng_unsafe, static_for]
../helpers/prng_unsafe
export
prng_unsafe, times, unittest,