Skip to content

cpuchain/yescrypt-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js / WASM bindings for Yescrypt

NPM Version NPM Version

For node.js bindings refer to ./node directory,

For WebAssembly bindings refer to ./wasm directory

Reproduction examples

./yescrypt-c/example.c, ./node/example.js, and ./wasm/example.js each hash a 19-byte and a 20-byte all-"a" password with fixed salts and check the encoded $y$... output against known-good values (a regression check for the 20-byte password bug). They print their results and exit non-zero on any mismatch.

Run them individually:

cc -O2 -DSKIP_MEMZERO -o yescrypt-c/example yescrypt-c/example.c \
    yescrypt-c/yescrypt-opt.c yescrypt-c/yescrypt-common.c yescrypt-c/yescrypt.c \
    yescrypt-c/sha256.c yescrypt-c/insecure_memzero.c && ./yescrypt-c/example

(cd node && yarn && node example.js)            # builds the native addon
(cd wasm && yarn && yarn build && node example.js)  # builds the JS bundle

Or run all three via the helper script:

./run-examples.sh            # all targets
./run-examples.sh node wasm  # a subset

References