BLS12Pairing

Git Source

State Variables

BLS12_PAIRING

BLS12_377_PAIRING precompile address.

uint256 private constant BLS12_PAIRING = 0x0807;

Functions

verify

Checks that a signature is valid for the octet string message under the public key PK See https://tools.ietf.org/html/draft-irtf-cfrg-bls-signature-04#section-2.8

function verify(Bls12G1 memory public_key, Bls12G2 memory signature, Bls12G2 memory message)
    internal
    view
    returns (bool);

Parameters

NameTypeDescription
public_keyBls12G1Public key in BLS12-377 G1.
signatureBls12G2Signature in BLS12-377 G2.
messageBls12G2An octet string.

Returns

NameTypeDescription
<none>boolResult, either VALID or INVALID.

pairing

Computes a "product" of pairings.

function pairing(Bls12G1[] memory a, Bls12G2[] memory b) internal view returns (bool);

Parameters

NameTypeDescription
aBls12G1[]List of Bls12G1.
bBls12G2[]List of Bls12G2.

Returns

NameTypeDescription
<none>boolTrue if pairing output is 1.