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) |