Skip to content

Commit

Permalink
Merge pull request #178 from ChainSafe/jeluard/use-noble-hashes
Browse files Browse the repository at this point in the history
Simplify crypto usage
  • Loading branch information
matthewkeil authored Apr 22, 2024
2 parents 3b4db7d + e36077f commit 1e29a6c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 311 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@
"@chainsafe/eslint-plugin-node": "^11.2.3",
"@chainsafe/threads": "^1.9.0",
"@lodestar/spec-test-util": "1.13.0",
"@noble/hashes": "^1.4.0",
"@types/chai": "^4.2.9",
"@types/mocha": "^10.0.0",
"@types/node": "^20.11.13",
"@typescript-eslint/eslint-plugin": "^4.31.1",
"@typescript-eslint/parser": "^4.31.1",
"buffer": "^6.0.3",
"chai": "^4.3.6",
"crypto-browserify": "^3.12.0",
"eslint": "^7.14.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-prettier": "^3.1.4",
Expand Down
4 changes: 2 additions & 2 deletions test/util.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import crypto from "crypto";
import {randomBytes} from "@noble/hashes/utils";

export function randomMessage(): Uint8Array {
return crypto.randomBytes(32);
return randomBytes(32);
}

export function getN<T>(n: number, getter: () => T): T[] {
Expand Down
4 changes: 1 addition & 3 deletions webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ module.exports = {
plugins: [
new ResolveTypeScriptPlugin(),
],
alias: {
"crypto": "crypto-browserify",
},
fallback: {
fs: false,
path: false,
stream: false,
crypto: false,
child_process: false,
},
},
Expand Down
Loading

0 comments on commit 1e29a6c

Please sign in to comment.