Gimli in JavaScript
"Gimli is a 384-bit permutation designed to achieve high security with high performance across a broad range of platforms."
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 = gimli;var state = 48;// state is 000000....0000;// state is c4d867....302e
Hash (eXtended Output Function)
var hash = hash; // 32-byte digest of [1,2,3,4,5,6] calculated in two steps.var digest = ; // 111-byte digest of [1,2,3]var longDigest = 111;var data = 123;; // XORing with output of XOFvar key = 123;var text = 456;;// outputs Uint8Array [ 81, 10, 158 ]