Skip to content

idshdx/csidh-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSIDH-wasm.js

A WebAssembly set of cryptographic primitives for CSIDH

See https://csidh.isogeny.org/ for details

About

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.

Missing

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

License

Free as in liberty. See file

Building

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

Missing

  • 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/

About

CSIDH-wasm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors