See https://csidh.isogeny.org/ for details
WebAssembly port via Emscripten, for using the key exchange mechanism the key exchange mechanism
The c source is present in src, dated from 2021/06/27.
Supports 512 bits parameter set
Uses C arithmetic instead of assembly.
Experimental, use it accordingly.
Opinions are most welcomed.
import CSIDH from "csidh-wasm"; // or from "./dist/node/index.js";
const lib = await CSIDH(); // wait for the wasm runtime to initialize
const alice_sk = lib.secretKey();
const alice_pk = lib.publicKey(alice_sk);
const bob_sk = lib.secretKey();
const bob_pk = lib.publicKey(bob_sk);
const alice_ss = lib.sharedKey(bob_pk, alice_sk);
const bob_ss = lib.sharedKey(alice_pk, bob_sk);
const string_key = lib.encodeBase64(any_key);
const buffered_key = lib.decodeBase64(string_key);
const is_valid_pk = lib.checkPublicKey(string_pk) // true
const is_valid_also = lib.checkPublicKey(buffered_pk) // true
console.log(alice_sk.constructor.name); // Int8Array
console.log(alice_pk.constructor.name); // BigUint64Array
console.log(alice_ss.constructor.name); // BigUint64Array
Additionally, you can check the tests file for examples
Free as in liberty. See file
To build ensure you have Emscripten installed.
Run emmake make to build for node or emmake make browser
Run tests with npm run test or npm run test:browser using webpack
- 1024 bits parameter set implementation
- made to be used in node, it has browser supported but not tested
- typescript support
- using assembly arithmetic code instead of C
- uses a hardcopy copy of the codebase to build, might be updated,
- no provided proof like a checksome to prove the authenticity of the source files, if you wanna be sure you can download and replace the target build files, available at the author`s site at https://csidh.isogeny.org/