Pike v8.0 release 509 running Hilfe v3.5 (Incremental Pike Frontend)
Crypto.SHA256.HMAC("a")("b");
(1) Result: "\b\336""2\231""1\342\225h7v\252\232CR\233\320\262u(m\363\26\3\0\304\233\244\350A\203""0\23"
Crypto.SHA256.HMAC("a",32)("b");
(2) Result: "\av\242\236\370\215K@N\230/h\351\236\236\254v\320\370\270""2\17\231[\202xb+i\222\3 "
Pike v8.1 release 11 running Hilfe v3.5 (Incremental Pike Frontend)
Crypto.SHA256.HMAC("a")("b");
(1) Result: "\b\336""2\231""1\342\225h7v\252\232CR\233\320\262u(m\363\26\3\0\304\233\244\350A\203""0\23"
Crypto.SHA256.HMAC("a",32)("b");
(2) Result: "\b\336""2\231""1\342\225h7v\252\232CR\233\320\262u(m\363\26\3\0\304\233\244\350A\203""0\23"
Hmm... The C implementation of HMAC seems to ignore the block size argument. In Pike 8.0 there's only the Pike implementation.
They can't both be right. Any ideas? I tried to debug it, but got lost in the multitude of Nettle inheritance-spaghetti levels.
The C implementation is in src/post_modules/Nettle/hash.{cmod,H}. The base Pike implementation is in lib/modules/__builtin.pmod/Nettle.pmod/Hash.pike.
Fixed, thanks for the report.
/grubba