From 8229bf384bdda1ae90ea93a344243de999a08eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mamy=20Andr=C3=A9-Ratsimbazafy?= Date: Sat, 8 Feb 2020 11:51:17 +0100 Subject: [PATCH] Remove specialization for static big int. They will be stored in the binary bss section and passed as ptr + length to save on codesize anyway. --- constantine/bigints.nim | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/constantine/bigints.nim b/constantine/bigints.nim index a844a3b..93906c3 100644 --- a/constantine/bigints.nim +++ b/constantine/bigints.nim @@ -94,11 +94,6 @@ func add*[bits](a: var BigInt[bits], b: BigInt[bits], ctl: CTBool[Word]): CTBool ## Returns the "carry flag" result.addImpl(a, b, ctl) -func add*[bits](a: var BigInt[bits], b: static BigInt[bits], ctl: CTBool[Word]): CTBool[Word] = - ## Constant-time big integer in-place addition - ## Returns the "carry flag". Specialization for B being a compile-time constant (usually a modulus). - result.addImpl(a, b, ctl) - template subImpl[bits](result: CTBool[Word], a: var BigInt[bits], b: BigInt[bits], ctl: CTBool[Word]) = ## Constant-time big integer in-place substraction ## Returns the "borrow flag" @@ -111,8 +106,3 @@ func sub*[bits](a: var BigInt[bits], b: BigInt[bits], ctl: CTBool[Word]): CTBool ## Constant-time big integer in-place addition ## Returns the "carry flag" result.subImpl(a, b, ctl) - -func sub*[bits](a: var BigInt[bits], b: static BigInt[bits], ctl: CTBool[Word]): CTBool[Word] = - ## Constant-time big integer in-place addition - ## Returns the "carry flag". Specialization for B being a compile-time constant (usually a modulus). - result.subImpl(a, b, ctl)