diff --git a/ffi/go/mcl/mcl.go b/ffi/go/mcl/mcl.go index 887d08e..1dd9b84 100644 --- a/ffi/go/mcl/mcl.go +++ b/ffi/go/mcl/mcl.go @@ -200,6 +200,16 @@ func (x *Fr) SetLittleEndianMod(buf []byte) error { return nil } +// SetBigEndianMod -- +func (x *Fr) SetBigEndianMod(buf []byte) error { + // #nosec + err := C.mclBnFr_setBigEndianMod(x.getPointer(), unsafe.Pointer(&buf[0]), C.size_t(len(buf))) + if err != 0 { + return fmt.Errorf("err mclBnFr_setBigEndianMod %x", err) + } + return nil +} + // IsEqual -- func (x *Fr) IsEqual(rhs *Fr) bool { return C.mclBnFr_isEqual(x.getPointer(), rhs.getPointer()) == 1 @@ -370,6 +380,16 @@ func (x *Fp) SetLittleEndianMod(buf []byte) error { return nil } +// SetBigEndianMod -- +func (x *Fp) SetBigEndianMod(buf []byte) error { + // #nosec + err := C.mclBnFp_setBigEndianMod(x.getPointer(), unsafe.Pointer(&buf[0]), C.size_t(len(buf))) + if err != 0 { + return fmt.Errorf("err mclBnFp_setBigEndianMod %x", err) + } + return nil +} + // IsEqual -- func (x *Fp) IsEqual(rhs *Fp) bool { return C.mclBnFp_isEqual(x.getPointer(), rhs.getPointer()) == 1