Gimli in JavaScript
"Gimli is a 384-bit permutation designed to achieve high security with high
performance across a broad range of platforms."
https://gimli.cr.yp.to/
This is a JavaScript implementation of the permutation
and a sponge-based hash function (XOF).
Installation
npm install gimli-crypto
But it's really small, maybe just copy and paste?
Usage
Permutation
var gimli = require('gimli-crypto').gimli;
var state = new Uint8Array(48);
gimli(state);
Hash (eXtended Output Function)
var hash = require('gimli-crypto').hash;
var digest = hash()
.write(new Uint8Array([1,2,3]))
.write(new Uint8Array([4,5,6]))
.read();
var longDigest = new Uint8Array(111);
var data = new Uint8Array([1,2,3]);
hash().write(data).read(longDigest);
var key = new Uint8Array([1,2,3]);
var text = new Uint8Array([4,5,6]);
hash().write(key).read(text, true);