Repair mac() function to produce correct output width

This commit is contained in:
Tony Garnock-Jones 2024-03-21 21:58:32 +01:00
parent a25cafdabb
commit 3b7543845a
1 changed files with 2 additions and 1 deletions

View File

@ -19,5 +19,6 @@ export const newKey: () => Promise<Bytes> =
const HMAC_BLAKE2s = makeHMAC(BLAKE2s);
export function mac(secretKey: Bytes, data: Bytes): Bytes {
return Bytes.from(HMAC_BLAKE2s(underlying(secretKey), underlying(data)));
return Bytes.from(HMAC_BLAKE2s(underlying(secretKey), underlying(data))
.subarray(0, KEY_LENGTH));
}