Skip to content

Commit

Permalink
Add ECDH key generation to bench.
Browse files Browse the repository at this point in the history
  • Loading branch information
dajiaji committed Nov 25, 2023
1 parent 642161b commit a2e3d86
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions bench/ecdh.bench.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Deno.bench("P-256::generateKeyPair", async (b) => {
b.start();
const _ret = await globalThis.crypto.subtle.generateKey(
{ name: "ECDH", namedCurve: "P-256" },
true,
["deriveBits"],
);
b.end();
});

Deno.bench("P-384::generateKeyPair", async (b) => {
b.start();
const _ret = await globalThis.crypto.subtle.generateKey(
{ name: "ECDH", namedCurve: "P-384" },
true,
["deriveBits"],
);
b.end();
});

0 comments on commit a2e3d86

Please sign in to comment.