(n, algorithm, message, nonce, options)
| 31 | } |
| 32 | |
| 33 | function measureAsync(n, algorithm, message, nonce, options) { |
| 34 | let remaining = n; |
| 35 | function done(err) { |
| 36 | assert.ifError(err); |
| 37 | if (--remaining === 0) |
| 38 | bench.end(n); |
| 39 | } |
| 40 | bench.start(); |
| 41 | for (let i = 0; i < n; ++i) |
| 42 | argon2(algorithm, { ...options, message, nonce, tagLength: 64 }, done); |
| 43 | } |
| 44 | |
| 45 | function main({ n, mode, algorithm, ...options }) { |
| 46 | // Message, nonce, secret, associated data & tag length do not affect performance |