From f6aaf49fea4884bf40a301c0e212ef8379916686 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Fri, 25 Oct 2019 15:14:50 +0900 Subject: [PATCH] [go] add MapToGi --- ffi/go/mcl/mcl.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ffi/go/mcl/mcl.go b/ffi/go/mcl/mcl.go index 641d39c..cf5a8fc 100644 --- a/ffi/go/mcl/mcl.go +++ b/ffi/go/mcl/mcl.go @@ -1044,6 +1044,22 @@ func GTPow(out *GT, x *GT, y *Fr) { C.mclBnGT_pow(out.getPointer(), x.getPointer(), y.getPointer()) } +// MapToG1 -- +func MapToG1(out *G1, x *Fp) error { + if C.mclBnFp_mapToG1(out.getPointer(), x.getPointer()) != 0 { + return fmt.Errorf("err mclBnFp_mapToG1") + } + return nil +} + +// MapToG2 -- +func MapToG2(out *G2, x *Fp2) error { + if C.mclBnFp2_mapToG2(out.getPointer(), x.getPointer()) != 0 { + return fmt.Errorf("err mclBnFp2_mapToG2") + } + return nil +} + // Pairing -- func Pairing(out *GT, x *G1, y *G2) { C.mclBn_pairing(out.getPointer(), x.getPointer(), y.getPointer())