Skip to content

Commit

Permalink
chore: address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jeluard committed Apr 22, 2024
1 parent 5692461 commit e36077f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,5 @@
"@chainsafe/blst": {
"optional": true
}
},
"packageManager": "[email protected]+sha256.dbed5b7e10c552ba0e1a545c948d5473bc6c5a28ce22a8fd27e493e3e5eb6370"
}
}
4 changes: 2 additions & 2 deletions src/blst-native/secretKey.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module.exports = {
fs: false,
path: false,
stream: false,
crypto: false,
child_process: false,
},
},
Expand Down

0 comments on commit e36077f

Please sign in to comment.