Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Commit

Permalink
Add comments to index.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Nov 8, 2020
1 parent 86b4e9d commit 02f2273
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*! noble-bls12-381 - MIT License (c) Paul Miller (paulmillr.com) */
// bls12-381 is a construction of two curves.
// 1. Fq: (x, y) - can be used for private keys
// 2. Fq2: (x1, x2+i), (y1, y2+i) - (imaginary numbers) can be used for signatures
Expand Down Expand Up @@ -396,6 +397,7 @@ export async function verify(signature: Bytes, message: Bytes, publicKey: Bytes)
return exp.equals(Fq12.ONE);
}

// pk1 + pk2 + pk3 = pkA
export function aggregatePublicKeys(publicKeys: Bytes[]): Uint8Array {
if (!publicKeys.length) throw new Error('Expected non-empty array');
const agg = publicKeys
Expand Down Expand Up @@ -439,4 +441,5 @@ export async function verifyBatch(messages: Bytes[], publicKeys: Bytes[], signat
}
}

// Pre-compute points. Refer to README.
PointG1.BASE.calcMultiplyPrecomputes(4);

0 comments on commit 02f2273

Please sign in to comment.