diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-02-23 05:29:54 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-03-02 16:42:29 +0100 |
commit | 6e09a46be8cf93139cf3904e5411cf424d07c349 (patch) | |
tree | 1d05109c320bf67540351f197fc4d9a32fa56c25 /contrib/examples/keygen-html/src/glue.js | |
parent | compat: workaround netlink refcount bug (diff) | |
download | wireguard-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 'contrib/examples/keygen-html/src/glue.js')
-rw-r--r-- | contrib/examples/keygen-html/src/glue.js | 25 |
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; - } -}; |