Skip to content

Commit

Permalink
feat: update blst, build code and make minor version change
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkeil committed Apr 9, 2024
1 parent beff833 commit 58a3955
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lib/blst-native/publicKey.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import blst from "../../temp-deps/blst-ts/dist/lib/index.js";
import blst from "@chainsafe/blst";
import { EmptyAggregateError } from "../errors.js";
import { bytesToHex, hexToBytes } from "../helpers/index.js";
import { PointFormat } from "../types.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/blst-native/secretKey.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import blst from "../../temp-deps/blst-ts/dist/lib/index.js";
import blst from "@chainsafe/blst";
import { SecretKey as ISecretKey } from "../types.js";
import { PublicKey } from "./publicKey.js";
import { Signature } from "./signature.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/blst-native/secretKey.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import blst from "../../temp-deps/blst-ts/dist/lib/index.js";
import blst from "@chainsafe/blst";
import { bytesToHex, hexToBytes, isZeroUint8Array, randomBytes } from "../helpers/index.js";
import { SECRET_KEY_LENGTH } from "../constants.js";
import { PublicKey } from "./publicKey.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/blst-native/signature.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import blst from "../../temp-deps/blst-ts/dist/lib/index.js";
import blst from "@chainsafe/blst";
import { bytesToHex, hexToBytes } from "../helpers/index.js";
import { PointFormat } from "../types.js";
import { EmptyAggregateError, ZeroSignatureError } from "../errors.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/functional.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import blst from "../temp-deps/blst-ts/dist/lib/index.js";
import blst from "@chainsafe/blst";
import { validateBytes } from "./helpers/index.js";
import { NotInitializedError } from "./errors.js";
// Returned type is enforced at each implementation's index
Expand Down
2 changes: 1 addition & 1 deletion lib/tsconfig.build.tsbuildinfo

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions lib/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ export interface IBls {
PublicKey: typeof PublicKey;
Signature: typeof Signature;
sign(secretKey: Uint8Array, message: Uint8Array): Uint8Array;
aggregatePublicKeys(publicKeys: Uint8Array[]): Uint8Array;
aggregateSignatures(signatures: Uint8Array[]): Uint8Array;
verify(publicKey: Uint8Array, message: Uint8Array, signature: Uint8Array): boolean;
verifyAggregate(publicKeys: Uint8Array[], message: Uint8Array, signature: Uint8Array): boolean;
verifyMultiple(publicKeys: Uint8Array[], messages: Uint8Array[], signature: Uint8Array): boolean;
aggregatePublicKeys(publicKeys: PublicKeyArg[]): Uint8Array;
aggregateSignatures(signatures: SignatureArg[]): Uint8Array;
verify(publicKey: PublicKeyArg, message: Uint8Array, signature: SignatureArg): boolean;
verifyAggregate(publicKeys: PublicKeyArg[], message: Uint8Array, signature: SignatureArg): boolean;
verifyMultiple(publicKeys: PublicKeyArg[], messages: Uint8Array[], signature: SignatureArg): boolean;
verifyMultipleSignatures(sets: {
publicKey: Uint8Array;
publicKey: PublicKeyArg;
message: Uint8Array;
signature: Uint8Array;
signature: SignatureArg;
}[]): boolean;
asyncVerify(message: Uint8Array, publicKey: PublicKeyArg, signature: SignatureArg): Promise<boolean>;
asyncVerifyAggregate(message: Uint8Array, publicKeys: PublicKeyArg[], signature: SignatureArg): Promise<boolean>;
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chainsafe/bls",
"version": "7.1.2",
"version": "7.2.0",
"description": "Implementation of bls signature verification for ethereum 2.0",
"engines": {
"node": ">=14.8.0"
Expand Down Expand Up @@ -61,7 +61,6 @@
"bls"
],
"scripts": {
"preinstall": "cd temp-deps/blst-ts && npm install --no-package-lock",
"clean": "rm -rf lib && rm -rf dist && rm -f tsconfig.tsbuildinfo",
"check-build": "node -e \"(async function() { await import('./lib/index.js') })()\"",
"build": "tsc --incremental --project tsconfig.build.json",
Expand Down Expand Up @@ -119,11 +118,11 @@
"v8-profiler-next": "1.3.0"
},
"peerDependencies": {
"@chainsafe/blst": "^0.2.4"
"@chainsafe/blst": "^1.0.0"
},
"peerDependenciesMeta": {
"@chainsafe/blst": {
"optional": true
}
}
}
}
2 changes: 1 addition & 1 deletion src/blst-native/publicKey.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import blst from "../../temp-deps/blst-ts/dist/lib/index.js";
import blst from "@chainsafe/blst";
import {EmptyAggregateError} from "../errors.js";
import {bytesToHex, hexToBytes} from "../helpers/index.js";
import {PointFormat, PublicKey as IPublicKey, CoordType} from "../types.js";
Expand Down
2 changes: 1 addition & 1 deletion src/blst-native/secretKey.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import blst from "../../temp-deps/blst-ts/dist/lib/index.js";
import blst from "@chainsafe/blst";
import {bytesToHex, hexToBytes, isZeroUint8Array, randomBytes} from "../helpers/index.js";
import {SECRET_KEY_LENGTH} from "../constants.js";
import {SecretKey as ISecretKey} from "../types.js";
Expand Down
2 changes: 1 addition & 1 deletion src/blst-native/signature.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import blst from "../../temp-deps/blst-ts/dist/lib/index.js";
import blst from "@chainsafe/blst";
import {bytesToHex, hexToBytes} from "../helpers/index.js";
import {PointFormat, Signature as ISignature, CoordType} from "../types.js";
import {PublicKey} from "./publicKey.js";
Expand Down
2 changes: 1 addition & 1 deletion src/functional.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import blst from "../temp-deps/blst-ts/dist/lib/index.js";
import blst from "@chainsafe/blst";
import {IBls, PublicKeyArg, SignatureArg} from "./types.js";
import {validateBytes} from "./helpers/index.js";
import {NotInitializedError} from "./errors.js";
Expand Down

0 comments on commit 58a3955

Please sign in to comment.