XzenTorXz / chacha8-native

node bindings for chacha8 in c

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chacha8 native

Build Status

Node bindings for Chacha8 (used for the pow algorithm for cryptonight), based on https://github.com/calvinmetcalf/chacha-native, based on Chacha20 this implementation.

install

npm install chacha8-native

usage

const ChaCha8 = require('chacha8-native');

var key = new Buffer([0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
var iv = new Buffer([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
var data = new Buffer([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);

var hexCipher = new ChaCha8(key, iv).update(data).toString('hex');

console.log(hexCipher);

About

node bindings for chacha8 in c


Languages

Language:JavaScript 44.3%Language:C++ 42.0%Language:C 11.6%Language:Python 2.1%