if (prevhmac && prevhmac instanceof Uint8Array) {
this.prevhmac = prevhmac;
} else {
- throw new Error("prevhmac input not valid");
+ this.prevhmac = new Uint8Array(this.HMAC_SIZE);
}
if (hmac && hmac instanceof Uint8Array) {
this.hmac = hmac;
} else {
- throw new Error("Hmac input not valid");
+ this.hmac = null;
}
this.entries = [];
this.freespace = this.SLOT_SIZE - getBaseSize(); //???????