diff --git a/constantine/math/bigints_raw.nim b/constantine/math/bigints_raw.nim index abf8e7d..a1d78f1 100644 --- a/constantine/math/bigints_raw.nim +++ b/constantine/math/bigints_raw.nim @@ -84,7 +84,11 @@ type ## otherwise each bigint routines would have an instantiation for ## each static `bits` parameter. ## - while not forcing the caller to preallocate computation buffers - ## for the high-level API + ## for the high-level API and enforcing bitsizes + ## - avoids runtime bound-checks on the view + ## for performance + ## and to ensure exception-free code + ## even when compiled in non "-d:danger" mode ## ## As with the BigInt type: ## - "bitLength" is the internal bitlength of the integer @@ -240,8 +244,6 @@ func sub*(a: BigIntViewMut, b: BigIntViewAny, ctl: CTBool[Word]): CTBool[Word] = # # ############################################################ -# TODO: push boundsCheck off. They would be extremely costly. - func shlAddMod(a: BigIntViewMut, c: Word, M: BigIntViewConst) = ## Fused modular left-shift + add ## Shift input `a` by a word and add `c` modulo `M`