I've discovered a small copy/paste bug in the
rstr_hmac_sha256 function in
sha256.js from the passwordmaker.zip downloadable version.
At the end of the function, where the opad is mixed with the ipad hash, the code reads:
return PasswordMaker_HashUtils.binb2rstr(this.binb_sha256(opad.concat(hash), 512 + 160));
However, since SHA-256 is 256 bits, the line should read:
return PasswordMaker_HashUtils.binb2rstr(this.binb_sha256(opad.concat(hash), 512 + 256));
I've confirmed this by comparing
Paul Johnston's HMAC-MD5 and HMAC-SHA-1 versions.
-- Asgeir