mirror of
https://github.com/logos-storage/constantine.git
synced 2026-01-03 21:53:06 +00:00
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:
parent
5dc97927c5
commit
8229bf384b
@ -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)
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user