MCPcopy Index your code
hub / github.com/nodejs/node / AEAD_Bench

Function AEAD_Bench

benchmark/crypto/aes-gcm-throughput.js:20–39  ·  view source on GitHub ↗
(cipher, message, associate_data, key, iv, n, len)

Source from the content-addressed store, hash-verified

18}
19
20function AEAD_Bench(cipher, message, associate_data, key, iv, n, len) {
21 const written = n * len;
22 const bits = written * 8;
23 const mbits = bits / (1024 * 1024);
24
25 for (let i = 0; i < n; i++) {
26 const alice = crypto.createCipheriv(cipher, key, iv);
27 alice.setAAD(associate_data);
28 const enc = alice.update(message);
29 alice.final();
30 const tag = alice.getAuthTag();
31 const bob = crypto.createDecipheriv(cipher, key, iv);
32 bob.setAuthTag(tag);
33 bob.setAAD(associate_data);
34 bob.update(enc);
35 bob.final();
36 }
37
38 bench.end(mbits);
39}

Callers 1

mainFunction · 0.85

Calls 3

updateMethod · 0.65
finalMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…