You are not logged in.
Pages: 1
Hi,
I am not expert for Crypto, but imho in HMAC_SHA256 procedure is a small inaccuracy, that causes the problems for key longer than 64 chars.
I think, that it should be:
procedure HMAC_SHA256(key,msg: pointer; keylen,msglen: integer; out result: TSHA256Digest);
var i: integer;
sha: TSHA256;
k0,k0xorIpad,step7data: array[0..15] of cardinal;
begin
FillcharFast(k0,sizeof(k0),0);
if keylen>64 then
sha.Full(key,keylen,PSHA256Digest(@k0)^) else // < --- originally sha.Full(key,64,PSHA256Digest(@k0)^) else
MoveFast(key^,k0,keylen);
for i := 0 to 15 do
k0xorIpad[i] := k0[i] xor $36363636;
...
Offline
Indeed.
Should be fixed by http://synopse.info/fossil/info/b6201d3ab2
Online
Pages: 1