diff --git a/package.json b/package.json index cfcd404..2a0ea16 100644 --- a/package.json +++ b/package.json @@ -127,6 +127,5 @@ "@chainsafe/blst": { "optional": true } - }, - "packageManager": "yarn@1.22.21+sha256.dbed5b7e10c552ba0e1a545c948d5473bc6c5a28ce22a8fd27e493e3e5eb6370" + } } diff --git a/src/blst-native/secretKey.ts b/src/blst-native/secretKey.ts index 47b61a2..d95499c 100644 --- a/src/blst-native/secretKey.ts +++ b/src/blst-native/secretKey.ts @@ -1,5 +1,5 @@ import blst from "@chainsafe/blst"; -import {randomBytes} from "@noble/hashes/utils"; +import crypto from "crypto"; import {bytesToHex, hexToBytes, isZeroUint8Array} from "../helpers/index.js"; import {SECRET_KEY_LENGTH} from "../constants.js"; import {SecretKey as ISecretKey} from "../types.js"; @@ -25,7 +25,7 @@ export class SecretKey implements ISecretKey { } static fromKeygen(entropy?: Uint8Array): SecretKey { - const sk = blst.SecretKey.fromKeygen(entropy || randomBytes(SECRET_KEY_LENGTH)); + const sk = blst.SecretKey.fromKeygen(entropy || crypto.randomBytes(SECRET_KEY_LENGTH)); return new SecretKey(sk); } diff --git a/webpack.config.cjs b/webpack.config.cjs index a87fef7..7c0991d 100644 --- a/webpack.config.cjs +++ b/webpack.config.cjs @@ -25,6 +25,7 @@ module.exports = { fs: false, path: false, stream: false, + crypto: false, child_process: false, }, },