summaryrefslogtreecommitdiff
path: root/benchmark/crypto
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2016-02-24 22:30:10 -0800
committerRich Trott <rtrott@gmail.com>2016-02-27 20:15:17 -0800
commitdcfda1007bb74a8354a47852bebe830a23916b6d (patch)
treec2c21681a7c0fa25bf74c8ecaaa0c19c5a3e6316 /benchmark/crypto
parent7fc6645982855ced40bf4af4b002a30b30510ac0 (diff)
downloadandroid-node-v8-dcfda1007bb74a8354a47852bebe830a23916b6d.tar.gz
android-node-v8-dcfda1007bb74a8354a47852bebe830a23916b6d.tar.bz2
android-node-v8-dcfda1007bb74a8354a47852bebe830a23916b6d.zip
tools,benchmark: increase lint compliance
In the hopes of soon having the benchmark code linted, this change groups all the likely non-controversial lint-compliance changes such as indentation, semi-colon usage, and single-vs.-double quotation marks. Other lint rules may have subtle performance implications in the V8 currently shipped with Node.js. Those changes will require more careful review and will be in a separate change. PR-URL: https://github.com/nodejs/node/pull/5429 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Brian White <mscdex@mscdex.net>
Diffstat (limited to 'benchmark/crypto')
-rw-r--r--benchmark/crypto/aes-gcm-throughput.js2
-rw-r--r--benchmark/crypto/cipher-stream.js1
-rw-r--r--benchmark/crypto/hash-stream-creation.js3
-rw-r--r--benchmark/crypto/hash-stream-throughput.js3
-rw-r--r--benchmark/crypto/rsa-encrypt-decrypt-throughput.js3
-rw-r--r--benchmark/crypto/rsa-sign-verify-throughput.js4
6 files changed, 3 insertions, 13 deletions
diff --git a/benchmark/crypto/aes-gcm-throughput.js b/benchmark/crypto/aes-gcm-throughput.js
index 8d4eba54cd..fc379b21b7 100644
--- a/benchmark/crypto/aes-gcm-throughput.js
+++ b/benchmark/crypto/aes-gcm-throughput.js
@@ -31,7 +31,7 @@ function AEAD_Bench(cipher, message, associate_data, key, iv, n, len) {
var bob = crypto.createDecipheriv(cipher, key, iv);
bob.setAuthTag(tag);
bob.setAAD(associate_data);
- var clear = bob.update(enc);
+ bob.update(enc);
bob.final();
}
diff --git a/benchmark/crypto/cipher-stream.js b/benchmark/crypto/cipher-stream.js
index df1ae8d696..affed1b462 100644
--- a/benchmark/crypto/cipher-stream.js
+++ b/benchmark/crypto/cipher-stream.js
@@ -96,7 +96,6 @@ function legacyWrite(alice, bob, message, encoding, writes) {
written += dec.length;
dec = bob.final();
written += dec.length;
- var bits = written * 8;
var gbits = written / (1024 * 1024 * 1024);
bench.end(gbits);
}
diff --git a/benchmark/crypto/hash-stream-creation.js b/benchmark/crypto/hash-stream-creation.js
index 31b6706c02..4bcd37f00a 100644
--- a/benchmark/crypto/hash-stream-creation.js
+++ b/benchmark/crypto/hash-stream-creation.js
@@ -21,9 +21,6 @@ function main(conf) {
api = 'legacy';
}
- var crypto = require('crypto');
- var assert = require('assert');
-
var message;
var encoding;
switch (conf.type) {
diff --git a/benchmark/crypto/hash-stream-throughput.js b/benchmark/crypto/hash-stream-throughput.js
index 2a17ce576c..050bbeb1ae 100644
--- a/benchmark/crypto/hash-stream-throughput.js
+++ b/benchmark/crypto/hash-stream-throughput.js
@@ -20,9 +20,6 @@ function main(conf) {
api = 'legacy';
}
- var crypto = require('crypto');
- var assert = require('assert');
-
var message;
var encoding;
switch (conf.type) {
diff --git a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js
index 86d3de4600..cf0579134c 100644
--- a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js
+++ b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js
@@ -23,7 +23,6 @@ var bench = common.createBenchmark(main, {
});
function main(conf) {
- var crypto = require('crypto');
var message = (new Buffer(conf.len)).fill('b');
bench.start();
@@ -39,7 +38,7 @@ function StreamWrite(algo, keylen, message, n, len) {
var publicKey = RSA_PublicPem[keylen];
for (var i = 0; i < n; i++) {
var enc = crypto.privateEncrypt(privateKey, message);
- var clear = crypto.publicDecrypt(publicKey, enc);
+ crypto.publicDecrypt(publicKey, enc);
}
bench.end(kbits);
diff --git a/benchmark/crypto/rsa-sign-verify-throughput.js b/benchmark/crypto/rsa-sign-verify-throughput.js
index 200e573294..779cc8bca1 100644
--- a/benchmark/crypto/rsa-sign-verify-throughput.js
+++ b/benchmark/crypto/rsa-sign-verify-throughput.js
@@ -24,7 +24,6 @@ var bench = common.createBenchmark(main, {
});
function main(conf) {
- var crypto = require('crypto');
var message = (new Buffer(conf.len)).fill('b');
bench.start();
@@ -37,7 +36,6 @@ function StreamWrite(algo, keylen, message, writes, len) {
var kbits = bits / (1024);
var privateKey = RSA_PrivatePem[keylen];
- var publicKey = RSA_PublicPem[keylen];
var s = crypto.createSign(algo);
var v = crypto.createVerify(algo);
@@ -46,7 +44,7 @@ function StreamWrite(algo, keylen, message, writes, len) {
v.update(message);
}
- var sign = s.sign(privateKey, 'binary');
+ s.sign(privateKey, 'binary');
s.end();
v.end();