From 411e40b84348bdf1a16d0e7d53277023a97e5882 Mon Sep 17 00:00:00 2001 From: mratsim Date: Mon, 3 Dec 2018 21:10:36 +0100 Subject: [PATCH] use CtTrueCtFalse instead of True/False for alias of the constant time bool --- constantine/field_fp.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/constantine/field_fp.nim b/constantine/field_fp.nim index 7eb66a7..12eceb1 100644 --- a/constantine/field_fp.nim +++ b/constantine/field_fp.nim @@ -36,8 +36,8 @@ type # ############################################################ const - True = ctrue(Word) - False = cfalse(Word) + CtTrue* = ctrue(Word) + CtFalse* = cfalse(Word) template add(a: var Fp, b: Fp, ctl: CTBool[Word]): CTBool[Word] = add(a.value, b.value, ctl) @@ -65,8 +65,8 @@ func `+`*(a, b: Fp): Fp = # return m - b_from_p + a result = a - var ctl = add(result, b, True) - ctl = ctl or not sub(result, Fp.P, False) + var ctl = add(result, b, CtTrue) + ctl = ctl or not sub(result, Fp.P, CtFalse) sub(result, Fp.P, ctl) template scaleadd_impl(a: var Fp, c: Word) =