Added Bcrypt, Scrypt, BSON and string operations along with many new tests.

This commit is contained in:
n1474335 2018-03-26 22:25:36 +01:00
parent 2f5b0533d8
commit 715ca1c292
28 changed files with 1290 additions and 84 deletions

79
test/tests/operations/Hash.js Normal file → Executable file
View file

@ -675,4 +675,83 @@ TestRegister.addTests([
}
]
},
{
name: "Bcrypt compare: dolphin",
input: "dolphin",
expectedOutput: "Match: dolphin",
recipeConfig: [
{
op: "Bcrypt compare",
args: ["$2a$10$qyon0LQCmMxpFFjwWH6Qh.dDdhqntQh./IN0RXCc3XIMILuOYZKgK"]
}
]
},
{
name: "Scrypt: RFC test vector 1",
input: "",
expectedOutput: "77d6576238657b203b19ca42c18a0497f16b4844e3074ae8dfdffa3fede21442fcd0069ded0948f8326a753a0fc81f17e8d3e0fb2e0d3628cf35e20c38d18906",
recipeConfig: [
{
op: "Scrypt",
args: [
{
"option": "Latin1",
"string": ""
},
16, 1, 1, 64
]
}
]
},
{
name: "Scrypt: RFC test vector 2",
input: "password",
expectedOutput: "fdbabe1c9d3472007856e7190d01e9fe7c6ad7cbc8237830e77376634b3731622eaf30d92e22a3886ff109279d9830dac727afb94a83ee6d8360cbdfa2cc0640",
recipeConfig: [
{
op: "Scrypt",
args: [
{
"option": "Latin1",
"string": "NaCl"
},
1024, 8, 16, 64
]
}
]
},
{
name: "Scrypt: RFC test vector 3",
input: "pleaseletmein",
expectedOutput: "7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2d5432955613f0fcf62d49705242a9af9e61e85dc0d651e40dfcf017b45575887",
recipeConfig: [
{
op: "Scrypt",
args: [
{
"option": "Latin1",
"string": "SodiumChloride"
},
16384, 8, 1, 64
]
}
]
},
/*{ // This takes a LONG time to run (over a minute usually).
name: "Scrypt: RFC test vector 4",
input: "pleaseletmein",
expectedOutput: "2101cb9b6a511aaeaddbbe09cf70f881ec568d574a2ffd4dabe5ee9820adaa478e56fd8f4ba5d09ffa1c6d927c40f4c337304049e8a952fbcbf45c6fa77a41a4",
recipeConfig: [
{
op: "Scrypt",
args: [
{
"option": "Latin1",
"string": "SodiumChloride"
},
1048576, 8, 1, 64
]
}
]
},*/
]);