Software / code / prosody
Comparison
spec/util_hashes_spec.lua @ 9970:4a43feb9ab15
Backed out changeset 61bc5c52c941
luaL_buffinitsize is only available in Lua 5.2+
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 21 Apr 2019 00:59:36 +0200 |
| parent | 9969:61bc5c52c941 |
| child | 10747:63a89b876407 |
comparison
equal
deleted
inserted
replaced
| 9969:61bc5c52c941 | 9970:4a43feb9ab15 |
|---|---|
| 31 local S = "salt" | 31 local S = "salt" |
| 32 local c = 16777216 | 32 local c = 16777216 |
| 33 local DK = "eefe3d61cd4da4e4e9945b3d6ba2158c2634e984"; | 33 local DK = "eefe3d61cd4da4e4e9945b3d6ba2158c2634e984"; |
| 34 assert.equal(DK, hex.to(hashes.scram_Hi_sha1(P, S, c))); | 34 assert.equal(DK, hex.to(hashes.scram_Hi_sha1(P, S, c))); |
| 35 end); | 35 end); |
| 36 it("test vector 5", function () | |
| 37 local P = "passwordPASSWORDpassword" | |
| 38 local S = "saltSALTsaltSALTsaltSALTsaltSALTsalt" | |
| 39 local c = 4096 | |
| 40 local dkLen = 25 | |
| 41 local DK = "3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038" | |
| 42 assert.equal(DK, hex.to(hashes.scram_Hi_sha1(P, S, c, dkLen))); | |
| 43 end); | |
| 44 it("works", function () | |
| 45 local P = "pass\0word" | |
| 46 local S = "sa\0lt" | |
| 47 local c = 4096 | |
| 48 local dkLen = 16 | |
| 49 local DK = "56fa6aa75548099dcc37d7f03425e0c3" | |
| 50 assert.equal(DK, hex.to(hashes.scram_Hi_sha1(P, S, c, dkLen))); | |
| 51 end); | |
| 52 end); | 36 end); |
| 53 | 37 |