Skip to content

Commit 99061f0

Browse files
author
Will Bamberg
committed
Change name of setup(); add comment
1 parent 0edba5b commit 99061f0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

web-crypto/derive-key/ecdh.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@
9898
);
9999
}
100100

101-
async function setup() {
102-
// Generate 2 ECDH key pairs: one for Alice and one for Bob.
101+
async function agreeSharedSecretKey() {
102+
// Generate 2 ECDH key pairs: one for Alice and one for Bob
103+
// In more normal usage, they would generate their key pairs
104+
// separately and exchange public keys securely
103105
let alicesKeyPair = await window.crypto.subtle.generateKey(
104106
{
105107
name: "ECDH",
@@ -137,6 +139,6 @@
137139
});
138140
}
139141

140-
setup();
142+
agreeSharedSecretKey();
141143

142144
})();

0 commit comments

Comments
 (0)