Skip to content

commerceblock/rs-wasm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ecies-wasm

License NPM Package CI

A WASM binding for eciesrs.

Install

npm install ecies-wasm

Usage

import * as ecies from "ecies-wasm";

const [sk, pk] = ecies.generate_keypair();
const data = Uint8Array.from([1, 2, 3, 4]);

const encrypted = ecies.encrypt(pk, data);
const decrypted = ecies.decrypt(sk, encrypted);
alert("decrypted: " + decrypted);

Check this example for how to use it in browsers.

API

function encrypt(receiver_pub: Uint8Array, msg: Uint8Array): Uint8Array | undefined;
function decrypt(receiver_sec: Uint8Array, msg: Uint8Array): Uint8Array | undefined;

Build and test

wasm-pack build
wasm-pack test --node

About

A WASM binding for eciesrs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%