Merge 309e0932dbc55ee00938f275a24aec194643430a into 002ed911b1a39f303b70246ac0ebf455a91c6d0f
This commit is contained in:
commit
989fb21aad
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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"}] }
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
||||
@ -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"}] }
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user