Merge 309e0932dbc55ee00938f275a24aec194643430a into 002ed911b1a39f303b70246ac0ebf455a91c6d0f

This commit is contained in:
Петушков А. 2026-07-06 22:09:13 +00:00 committed by GitHub
commit 989fb21aad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 20 additions and 2 deletions

View File

@ -70,7 +70,7 @@ class BLAKE2b extends Operation {
case "Raw":
return Utils.arrayBufferToStr(blakejs.blake2b(input, key, outSize / 8).buffer);
default:
return new OperationError("Unsupported Output Type");
throw new OperationError("Unsupported Output Type");
}
}

View File

@ -71,7 +71,7 @@ class BLAKE2s extends Operation {
case "Raw":
return Utils.arrayBufferToStr(blakejs.blake2s(input, key, outSize / 8).buffer);
default:
return new OperationError("Unsupported Output Type");
throw new OperationError("Unsupported Output Type");
}
}

View File

@ -52,5 +52,14 @@ TestRegister.addTests([
{ "op": "BLAKE2b",
"args": ["128", "Hex", {string: "pseudorandom key", option: "UTF8"}] }
]
},
{
name: "BLAKE2b: missing output encoding",
input: "hello",
expectedOutput: "Unsupported Output Type",
recipeConfig: [
{ "op": "BLAKE2b",
"args": ["512", "", {string: "", option: "UTF8"}] }
]
}
]);

View File

@ -43,5 +43,14 @@ TestRegister.addTests([
{ "op": "BLAKE2s",
"args": ["128", "Hex", {string: "", option: "UTF8"}] }
]
},
{
name: "BLAKE2s: missing output encoding",
input: "hello",
expectedOutput: "Unsupported Output Type",
recipeConfig: [
{ "op": "BLAKE2s",
"args": ["256", "", {string: "", option: "UTF8"}] }
]
}
]);