var mac = new ChaskeyCipher.Mac(); // instantiate a cipher in MAC mode
mac.set([1,2,3,4]); // set the key
console.log(mac.sign(new Uint8Array(0)));
console.log(mac.sign(new Uint8Array(0)));
console.log(mac.sign(new Uint8Array(17)));
console.log(mac.sign(new Uint8Array(0)));
prints the following:
I expect the last line to be
The reason is that the formatter object's byte buffer is not reset completely upon reset. It is filled with zeros instead of truncated to zero length.