[go] add SetBigEndianMode

update-fork
MITSUNARI Shigeo 4 years ago
parent 6612374e3b
commit d33f8c6856
  1. 20
      ffi/go/mcl/mcl.go

@ -200,6 +200,16 @@ func (x *Fr) SetLittleEndianMod(buf []byte) error {
return nil 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 -- // IsEqual --
func (x *Fr) IsEqual(rhs *Fr) bool { func (x *Fr) IsEqual(rhs *Fr) bool {
return C.mclBnFr_isEqual(x.getPointer(), rhs.getPointer()) == 1 return C.mclBnFr_isEqual(x.getPointer(), rhs.getPointer()) == 1
@ -370,6 +380,16 @@ func (x *Fp) SetLittleEndianMod(buf []byte) error {
return nil 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 -- // IsEqual --
func (x *Fp) IsEqual(rhs *Fp) bool { func (x *Fp) IsEqual(rhs *Fp) bool {
return C.mclBnFp_isEqual(x.getPointer(), rhs.getPointer()) == 1 return C.mclBnFp_isEqual(x.getPointer(), rhs.getPointer()) == 1

Loading…
Cancel
Save