avr-crypto-lib icon indicating copy to clipboard operation
avr-crypto-lib copied to clipboard

first '0' gets omitted from hash value

Open Hasi123 opened this issue 4 years ago • 0 comments

I am trying to use the hmac sha256 in an Arduino project, but I have an issue, where if there are zeros in the hash value, the first zero gets omitted, resulting in a hash length of only 63 bytes. Otherwise the values correspond with online calculators. Has anyone encountered this issue? Any solutions?

Not sure if this makes a difference, but I am including the header with extern "C"{ #include "hmac-sha256.h" }; because I am compiling with the Arduino IDE (C++).

edit. so for example if I try to hash "hello" with the key "key" I get 937B3B915EFB5171FF14D8CB55FBCC798C6C0EF1456D66DED1A6AA723A58B7B instead of 9307b3b915efb5171ff14d8cb55fbcc798c6c0ef1456d66ded1a6aa723a58b7b

Hasi123 avatar May 23 '20 19:05 Hasi123