Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine du Hamel <duhamelantoine1995@gmail.com>2022-02-26 20:12:48 +0300
committerGitHub <noreply@github.com>2022-02-26 20:12:48 +0300
commit6ee42284984e2baf7a5316460900d38dd1563fb7 (patch)
tree0663b6642091bfb0f3e47c3f53250551fc76b811 /benchmark
parentaa97c9d973b336f0e92aa3a5f60e7b24a6053c6c (diff)
crypto: validate `this` value for `webcrypto.getRandomValues`
PR-URL: https://github.com/nodejs/node/pull/41760 Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/crypto/webcrypto-digest.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/benchmark/crypto/webcrypto-digest.js b/benchmark/crypto/webcrypto-digest.js
index 2d95f868f66..4acd82878da 100644
--- a/benchmark/crypto/webcrypto-digest.js
+++ b/benchmark/crypto/webcrypto-digest.js
@@ -3,11 +3,9 @@
const common = require('../common.js');
const {
createHash,
- webcrypto: {
- subtle,
- getRandomValues
- }
+ webcrypto,
} = require('crypto');
+const { subtle } = webcrypto;
const bench = common.createBenchmark(main, {
sync: ['createHash', 'subtle'],
@@ -50,7 +48,7 @@ function measureSubtle(n, data, method) {
}
function main({ n, sync, data, method }) {
- data = getRandomValues(Buffer.alloc(data));
+ data = webcrypto.getRandomValues(Buffer.alloc(data));
switch (sync) {
case 'createHash': return measureLegacy(n, data, method);
case 'subtle': return measureSubtle(n, data, method);