From 81b0c7f5ae63c5657dbbca23c7186a2fd6aaeabe Mon Sep 17 00:00:00 2001 From: Sun Yimin Date: Fri, 31 May 2024 18:13:14 +0800 Subject: [PATCH] internal/bigmod: make CmpGeq public --- internal/bigmod/nat.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/bigmod/nat.go b/internal/bigmod/nat.go index 6dfa7f0..fd0f077 100644 --- a/internal/bigmod/nat.go +++ b/internal/bigmod/nat.go @@ -155,7 +155,7 @@ func (x *Nat) SetBytes(b []byte, m *Modulus) (*Nat, error) { if err := x.setBytes(b, m); err != nil { return nil, err } - if x.cmpGeq(m.nat) == yes { + if x.CmpGeq(m.nat) == yes { return nil, errors.New("input overflows the modulus") } return x, nil @@ -234,10 +234,10 @@ func (x *Nat) IsZero() choice { return zero } -// cmpGeq returns 1 if x >= y, and 0 otherwise. +// CmpGeq returns 1 if x >= y, and 0 otherwise. // // Both operands must have the same announced length. -func (x *Nat) cmpGeq(y *Nat) choice { +func (x *Nat) CmpGeq(y *Nat) choice { // Eliminate bounds checks in the loop. size := len(x.limbs) xLimbs := x.limbs[:size]