Skip to main content
@tevm/voltaire
@tevm/voltaire / crypto/Bls12381 / Pairing

Pairing

Functions

batchVerify()

batchVerify(items): boolean
Defined in: src/crypto/Bls12381/Pairing/index.js:136 Batch verify multiple BLS signatures on different messages

Parameters

items
object[] Array of signature verification items

Returns

boolean True if all signatures are valid

Throws


pair()

pair(p, q): never
Defined in: src/crypto/Bls12381/Pairing/index.js:69 Compute single pairing e(P, Q)

Parameters

p
Bls12381G1PointType G1 point
q
Bls12381G2PointType G2 point

Returns

never Throws - not implemented in pure JS

Throws


pairingCheck()

pairingCheck(pairs): boolean
Defined in: src/crypto/Bls12381/Pairing/index.js:32 Pairing check: verify that product of pairings equals identity e(P1, Q1) * e(P2, Q2) * … * e(Pn, Qn) = 1 This is the core operation used in BLS signature verification.

Parameters

pairs
[Bls12381G1PointType, Bls12381G2PointType][] Array of (G1, G2) point pairs

Returns

boolean True if pairing product equals identity

Throws

If any point is invalid

verifyAggregateSignature()

verifyAggregateSignature(aggregatedSignature, aggregatedPublicKey, messagePoint): boolean
Defined in: src/crypto/Bls12381/Pairing/index.js:117 Verify aggregate BLS signature (same message) All signers signed the same message.

Parameters

aggregatedSignature
Bls12381G1PointType Aggregated signature (G1 point)
aggregatedPublicKey
Bls12381G2PointType Aggregated public key (G2 point)
messagePoint
Bls12381G1PointType Hashed message (G1 point)

Returns

boolean True if aggregate signature is valid

Throws


verifySignature()

verifySignature(signature, publicKey, messagePoint): boolean
Defined in: src/crypto/Bls12381/Pairing/index.js:97 Verify BLS signature using pairing check Verifies: e(signature, G2_generator) = e(H(message), publicKey) Equivalent to: e(signature, G2_gen) * e(-H(msg), pubKey) = 1

Parameters

signature
Bls12381G1PointType Signature (G1 point)
publicKey
Bls12381G2PointType Public key (G2 point)
messagePoint
Bls12381G1PointType Hashed message (G1 point)

Returns

boolean True if signature is valid

Throws