File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed
Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ func (c *CurveBase) NewZrFromInt(i int64) driver.Zr {
6565 return & BaseZr {Int : * big .NewInt (i ), Modulus : c .Modulus }
6666}
6767
68+ func (c * CurveBase ) NewZrFromUInt64 (i uint64 ) driver.Zr {
69+ return & BaseZr {Int : * new (big.Int ).SetUint64 (i ), Modulus : c .Modulus }
70+ }
71+
6872func (c * CurveBase ) NewRandomZr (rng io.Reader ) driver.Zr {
6973 bi , err := rand .Int (rng , & c .Modulus )
7074 if err != nil {
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ type Curve interface {
3030 NewG2 () G2
3131 NewZrFromBytes (b []byte ) Zr
3232 NewZrFromInt (i int64 ) Zr
33+ NewZrFromUInt64 (i uint64 ) Zr
3334 NewG1FromBytes (b []byte ) G1
3435 NewG1FromCompressed (b []byte ) G1
3536 NewG2FromBytes (b []byte ) G2
Original file line number Diff line number Diff line change @@ -483,6 +483,10 @@ func (c *Curve) NewZrFromInt(i int64) *Zr {
483483 return & Zr {zr : c .c .NewZrFromInt (i ), curveID : c .curveID }
484484}
485485
486+ func (c * Curve ) NewZrFromUInt64 (i uint64 ) * Zr {
487+ return & Zr {zr : c .c .NewZrFromUInt64 (i ), curveID : c .curveID }
488+ }
489+
486490func (c * Curve ) NewG2 () * G2 {
487491 return & G2 {g2 : c .c .NewG2 (), curveID : c .curveID }
488492}
You can’t perform that action at this time.
0 commit comments