util/sasl/scram.lua

changeset 3405
b1efe62c3c37
parent 3374
ce52f1d5cb74
child 3540
bc139431830b
equal deleted inserted replaced
3404:33c81ee280e3 3405:b1efe62c3c37
63 end 63 end
64 return t_concat(result); 64 return t_concat(result);
65 end 65 end
66 66
67 -- hash algorithm independent Hi(PBKDF2) implementation 67 -- hash algorithm independent Hi(PBKDF2) implementation
68 local function Hi(hmac, str, salt, i) 68 function Hi(hmac, str, salt, i)
69 local Ust = hmac(str, salt.."\0\0\0\1"); 69 local Ust = hmac(str, salt.."\0\0\0\1");
70 local res = Ust; 70 local res = Ust;
71 for n=1,i-1 do 71 for n=1,i-1 do
72 local Und = hmac(str, Ust) 72 local Und = hmac(str, Ust)
73 res = binaryXOR(res, Und) 73 res = binaryXOR(res, Und)

mercurial