Fix ChaCha operation Raw output

Previously, an array type error prevented any output when selecting
the 'Raw' output option for the ChaCha operation. This did not
show up in tests, as they all compared to hex values.

This also adds a test (relying on the 'To Hex' operation) that
catches this.
This commit is contained in:
Joost Rijneveld 2023-07-30 17:02:36 +02:00
parent 6ed9d4554a
commit cb98672549
2 changed files with 20 additions and 1 deletions

View file

@ -191,7 +191,7 @@ ChaCha uses a nonce of 8 or 12 bytes (64 or 96 bits).`);
if (outputType === "Hex") {
return toHex(output);
} else {
return Utils.arrayBufferToStr(output);
return Utils.arrayBufferToStr(Uint8Array.from(output).buffer);
}
}