native: fix error message on unexpected BLS12-381 curve point

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
Anna Shaleva 2023-10-05 13:31:15 +03:00
parent b5a75b1485
commit a2d28272ef

View file

@ -272,7 +272,7 @@ func blsPointPairing(a, b blsPoint) (blsPoint, error) {
x = new(bls12381.G1Affine)
x.FromJacobian(p)
default:
return blsPoint{}, fmt.Errorf("pairing: unexpected bls12381 point type (g1): %T", x)
return blsPoint{}, fmt.Errorf("pairing: unexpected bls12381 point type (g1): %T", p)
}
switch p := b.point.(type) {
case *bls12381.G2Affine:
@ -281,7 +281,7 @@ func blsPointPairing(a, b blsPoint) (blsPoint, error) {
y = new(bls12381.G2Affine)
y.FromJacobian(p)
default:
return blsPoint{}, fmt.Errorf("pairing: unexpected bls12381 point type (g2): %T", x)
return blsPoint{}, fmt.Errorf("pairing: unexpected bls12381 point type (g2): %T", p)
}
gt, err := bls12381.Pair([]bls12381.G1Affine{*x}, []bls12381.G2Affine{*y})