diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-01-23 13:17:56 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-02-01 10:49:00 +0100 |
commit | 39ae0b98009e8d235ee7c6d885fd9702a49949ee (patch) | |
tree | dca144507b584305d6da54ae6f8fec36e9981da8 /benchmark/crypto/aes-gcm-throughput.js | |
parent | 794e489eeadbe40fec7928ed9b8f25d7019d795e (diff) | |
download | android-node-v8-39ae0b98009e8d235ee7c6d885fd9702a49949ee.tar.gz android-node-v8-39ae0b98009e8d235ee7c6d885fd9702a49949ee.tar.bz2 android-node-v8-39ae0b98009e8d235ee7c6d885fd9702a49949ee.zip |
benchmark: (crypto) refactor
PR-URL: https://github.com/nodejs/node/pull/18320
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'benchmark/crypto/aes-gcm-throughput.js')
-rw-r--r-- | benchmark/crypto/aes-gcm-throughput.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/benchmark/crypto/aes-gcm-throughput.js b/benchmark/crypto/aes-gcm-throughput.js index 246455de78..5c1e71e728 100644 --- a/benchmark/crypto/aes-gcm-throughput.js +++ b/benchmark/crypto/aes-gcm-throughput.js @@ -8,13 +8,13 @@ const bench = common.createBenchmark(main, { len: [1024, 4 * 1024, 16 * 1024, 64 * 1024, 256 * 1024, 1024 * 1024] }); -function main(conf) { - const message = Buffer.alloc(conf.len, 'b'); - const key = crypto.randomBytes(keylen[conf.cipher]); +function main({ n, len, cipher }) { + const message = Buffer.alloc(len, 'b'); + const key = crypto.randomBytes(keylen[cipher]); const iv = crypto.randomBytes(12); const associate_data = Buffer.alloc(16, 'z'); bench.start(); - AEAD_Bench(conf.cipher, message, associate_data, key, iv, conf.n, conf.len); + AEAD_Bench(cipher, message, associate_data, key, iv, n, len); } function AEAD_Bench(cipher, message, associate_data, key, iv, n, len) { |