|
|
|
@ -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 |
|
|
|
|