0.2.6 • Published 2 years ago
rust-falcon
Licence
MIT
Version
0.2.6
Deps
1
Size
173 kB
Vulns
0
Weekly
0
Falcon Signature WASM (Rust)
Don't use an equal random seed to generate keypair and signature
This library provides fully sync wasm version of Falcon signature functions. Thanks to this Github repo
Usage:
Generating random 48 bytes array:
const randomSeed = crypto.getRandomValues(new Uint8Array(48));
Generating keypair:
import { falconKeypair } from "rust-falcon";
const keypair = falconKeypair(randomSeed);
Signing message:
import { sign } from "rust-falcon";
const keypair = falconKeypair(randomSeed);
const message = new TextEncoder().encode("message");
const signature = sign(message, keypair.secret, anotherRandomSeed).sign;
Verifying message:
import { verify } from "rust-falcon";
const result = verify(signature, message, keypair.public); // True