Skip to content

Commit

Permalink
misc/wasm: use NodeJS crypto library
Browse files Browse the repository at this point in the history
The move to NodeJS 18 allows us to replace the custom
crypto functions with the expanded crypto primitives of
the NodeJS crypto library.

Fixes golang#56860

Change-Id: I8726b4003150f31521f246f613b6976641b9fa69
Reviewed-on: https://go-review.googlesource.com/c/go/+/463975
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Evan Phoenix <evan@phx.io>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
  • Loading branch information
johanbrandhorst committed Feb 12, 2023
1 parent 1605fda commit d35e9f0
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions misc/wasm/wasm_exec_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ globalThis.TextDecoder = require("util").TextDecoder;

globalThis.performance ??= require("performance");

const crypto = require("crypto");
globalThis.crypto = {
getRandomValues(b) {
crypto.randomFillSync(b);
},
};
globalThis.crypto ??= require("crypto");

require("./wasm_exec");

Expand Down

0 comments on commit d35e9f0

Please sign in to comment.