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.

This commit is contained in:
Mamy André-Ratsimbazafy 2020-02-08 11:51:17 +01:00
parent 5dc97927c5
commit 8229bf384b
No known key found for this signature in database
GPG Key ID: 7B88AD1FE79492E1
1 changed files with 0 additions and 10 deletions

View File

@ -94,11 +94,6 @@ func add*[bits](a: var BigInt[bits], b: BigInt[bits], ctl: CTBool[Word]): CTBool
## Returns the "carry flag" ## Returns the "carry flag"
result.addImpl(a, b, ctl) 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]) = template subImpl[bits](result: CTBool[Word], a: var BigInt[bits], b: BigInt[bits], ctl: CTBool[Word]) =
## Constant-time big integer in-place substraction ## Constant-time big integer in-place substraction
## Returns the "borrow flag" ## 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 ## Constant-time big integer in-place addition
## Returns the "carry flag" ## Returns the "carry flag"
result.subImpl(a, b, ctl) 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)