|
|
|
@ -313,7 +313,7 @@ func G1Mul(out *G1, x *G1, y *Fr) { |
|
|
|
|
|
|
|
|
|
// G1MulVec -- multi scalar multiplication out = sum mul(xVec[i], yVec[i])
|
|
|
|
|
func G1MulVec(out *G1, xVec []G1, yVec []Fr) { |
|
|
|
|
if len(xVec) != len (yVec) { |
|
|
|
|
if len(xVec) != len(yVec) { |
|
|
|
|
panic("xVec and yVec have the same size") |
|
|
|
|
} |
|
|
|
|
C.mclBnG1_mulVec(out.getPointer(), (*C.mclBnG1)(unsafe.Pointer(&xVec[0])), (*C.mclBnFr)(unsafe.Pointer(&yVec[0])), (C.size_t)(len(xVec))) |
|
|
|
@ -431,7 +431,7 @@ func G2Mul(out *G2, x *G2, y *Fr) { |
|
|
|
|
|
|
|
|
|
// G2MulVec -- multi scalar multiplication out = sum mul(xVec[i], yVec[i])
|
|
|
|
|
func G2MulVec(out *G2, xVec []G2, yVec []Fr) { |
|
|
|
|
if len(xVec) != len (yVec) { |
|
|
|
|
if len(xVec) != len(yVec) { |
|
|
|
|
panic("xVec and yVec have the same size") |
|
|
|
|
} |
|
|
|
|
C.mclBnG2_mulVec(out.getPointer(), (*C.mclBnG2)(unsafe.Pointer(&xVec[0])), (*C.mclBnFr)(unsafe.Pointer(&yVec[0])), (C.size_t)(len(xVec))) |
|
|
|
@ -568,9 +568,9 @@ func MillerLoop(out *GT, x *G1, y *G2) { |
|
|
|
|
C.mclBn_millerLoop(out.getPointer(), x.getPointer(), y.getPointer()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// MillerLoopVec -- multi pairing
|
|
|
|
|
// MillerLoopVec -- multi pairings ; out = prod_i e(xVec[i], yVec[i])
|
|
|
|
|
func MillerLoopVec(out *GT, xVec []G1, yVec []G2) { |
|
|
|
|
if len(xVec) != len (yVec) { |
|
|
|
|
if len(xVec) != len(yVec) { |
|
|
|
|
panic("xVec and yVec have the same size") |
|
|
|
|
} |
|
|
|
|
C.mclBn_millerLoopVec(out.getPointer(), (*C.mclBnG1)(unsafe.Pointer(&xVec[0])), (*C.mclBnG2)(unsafe.Pointer(&yVec[0])), (C.size_t)(len(xVec))) |
|
|
|
|