1 -- Test vectors from RFC 6070
2 local hashes
= require
"util.hashes";
3 local hex
= require
"util.hex";
5 -- Also see spec for util.hmac where HMAC test cases reside
7 describe("PBKDF2-SHA1", function ()
8 it("test vector 1", function ()
12 local DK
= "0c60c80f961f0e71f3a9b524af6012062fe037a6";
13 assert.equal(DK
, hex
.to(hashes
.scram_Hi_sha1(P
, S
, c
)));
15 it("test vector 2", function ()
19 local DK
= "ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957";
20 assert.equal(DK
, hex
.to(hashes
.scram_Hi_sha1(P
, S
, c
)));
22 it("test vector 3", function ()
26 local DK
= "4b007901b765489abead49d926f721d065a429c1";
27 assert.equal(DK
, hex
.to(hashes
.scram_Hi_sha1(P
, S
, c
)));
29 it("test vector 4 #SLOW", function ()
33 local DK
= "eefe3d61cd4da4e4e9945b3d6ba2158c2634e984";
34 assert.equal(DK
, hex
.to(hashes
.scram_Hi_sha1(P
, S
, c
)));