mistakia / ed25519-blake2b

Node.js bindings for C++/C implementations of ed25519 using BLAKE2b

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ed25519-blake2b

Node.js bindings for C++/C implementations of ed25519 using BLAKE2b instead of SHA512 as the hash algorithm. The ed25519-donna and blake2 implementations are used with a change made to signing by plasmapower to protect the generation of the random scalar from side channel power attacks.

Installation

yarn add @trashman/ed25519-blake2b
npm install @trashman/ed25519-blake2b

Usage

const ed25519 = require('@trashman/ed25519-blake2b')

const privateKey = crypto.randomBytes(32)
const publicKey = ed25519.publicKey(privateKey)

const msg = ed25519.hash('kitties')
const signature = ed25519.sign(msg, privateKey, publicKey)
const isValid = ed25519.verify(signature, msg, publicKey)

About

Node.js bindings for C++/C implementations of ed25519 using BLAKE2b

License:MIT License


Languages

Language:C 99.3%Language:Makefile 0.3%Language:JavaScript 0.3%Language:C++ 0.1%Language:CMake 0.0%Language:Python 0.0%