aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/contrib/examples/keygen-html/src/glue.js
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-02-23 05:29:54 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-03-02 16:42:29 +0100
commit6e09a46be8cf93139cf3904e5411cf424d07c349 (patch)
tree1d05109c320bf67540351f197fc4d9a32fa56c25 /contrib/examples/keygen-html/src/glue.js
parentcompat: workaround netlink refcount bug (diff)
downloadwireguard-monolithic-historical-6e09a46be8cf93139cf3904e5411cf424d07c349.tar.xz
wireguard-monolithic-historical-6e09a46be8cf93139cf3904e5411cf424d07c349.zip
contrib: keygen-html: rewrite in pure javascript
Emscripten is too cumbersome. This code here is much slower, but it's shorter and simpler.
Diffstat (limited to '')
-rw-r--r--contrib/examples/keygen-html/src/glue.js25
1 files changed, 0 insertions, 25 deletions
diff --git a/contrib/examples/keygen-html/src/glue.js b/contrib/examples/keygen-html/src/glue.js
deleted file mode 100644
index 981e533..0000000
--- a/contrib/examples/keygen-html/src/glue.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/*! SPDX-License-Identifier: GPL-2.0
- *
- * Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
- */
-window["WireGuard"] = {
- "generateKeypair": function() {
- var privateKey = Module["_malloc"](32);
- var publicKey = Module["_malloc"](32);
- Module["_curve25519_generate_private"](privateKey);
- Module["_curve25519_generate_public"](publicKey, privateKey);
- var privateBase64 = Module["_malloc"](45);
- var publicBase64 = Module["_malloc"](45);
- Module["_key_to_base64"](privateBase64, privateKey);
- Module["_key_to_base64"](publicBase64, publicKey);
- Module["_free"](privateKey);
- Module["_free"](publicKey);
- var keypair = {
- publicKey: Module["Pointer_stringify"](publicBase64),
- privateKey: Module["Pointer_stringify"](privateBase64)
- };
- Module["_free"](privateBase64);
- Module["_free"](publicBase64);
- return keypair;
- }
-};