(n, op, key, keys, ciphertexts)
| 71 | }); |
| 72 | |
| 73 | function measureSync(n, op, key, keys, ciphertexts) { |
| 74 | bench.start(); |
| 75 | for (let i = 0; i < n; ++i) { |
| 76 | const k = key || keys[i]; |
| 77 | if (op === 'encapsulate') { |
| 78 | crypto.encapsulate(k); |
| 79 | } else { |
| 80 | crypto.decapsulate(k, ciphertexts[i]); |
| 81 | } |
| 82 | } |
| 83 | bench.end(n); |
| 84 | } |
| 85 | |
| 86 | function measureAsync(n, op, key, keys, ciphertexts) { |
| 87 | let remaining = n; |