Option structures added for hashing algorithms

This commit is contained in:
n1073645 2020-04-24 14:04:13 +01:00
parent 4c3324aea1
commit 57c1a03c4f
7 changed files with 100 additions and 14 deletions

View file

@ -20,11 +20,17 @@ class SHA0 extends Operation {
this.name = "SHA0";
this.module = "Crypto";
this.description = "SHA-0 is a retronym applied to the original version of the 160-bit hash function published in 1993 under the name 'SHA'. It was withdrawn shortly after publication due to an undisclosed 'significant flaw' and replaced by the slightly revised version SHA-1.";
this.description = "SHA-0 is a retronym applied to the original version of the 160-bit hash function published in 1993 under the name 'SHA'. It was withdrawn shortly after publication due to an undisclosed 'significant flaw' and replaced by the slightly revised version SHA-1. The message digest algorithm consists, by default, of 80 rounds.";
this.infoURL = "https://wikipedia.org/wiki/SHA-1#SHA-0";
this.inputType = "ArrayBuffer";
this.outputType = "string";
this.args = [];
this.args = [
{
name: "Rounds",
type: "number",
value: 80
}
];
}
/**
@ -33,7 +39,7 @@ class SHA0 extends Operation {
* @returns {string}
*/
run(input, args) {
return runHash("sha0", input);
return runHash("sha0", input, {rounds: args[0]});
}
}