Lines Matching defs:const
2 const common = require('../common.js');
3 const crypto = require('crypto');
4 const keylen = { 'aes-128-gcm': 16, 'aes-192-gcm': 24, 'aes-256-gcm': 32 };
5 const bench = common.createBenchmark(main, {
12 const message = Buffer.alloc(len, 'b');
13 const key = crypto.randomBytes(keylen[cipher]);
14 const iv = crypto.randomBytes(12);
15 const associate_data = Buffer.alloc(16, 'z');
21 const written = n * len;
22 const bits = written * 8;
23 const mbits = bits / (1024 * 1024);
26 const alice = crypto.createCipheriv(cipher, key, iv);
28 const enc = alice.update(message);
30 const tag = alice.getAuthTag();
31 const bob = crypto.createDecipheriv(cipher, key, iv);