I'm trying to implement HMAC SHA256 (I've implemented SHA256 successfully).

I am trying to find examples where they show the results after each HMAC stage (XOR, append, H etc).

Does anyone know of any resources which contain examples with the results from each step?

  • $\begingroup$ "Date" is just the singular form of "data" here, derived from the Latin "datum": a given, or that which we take for granted and use as the basis of our calculations. It's not a date in the temporal sense. $\endgroup$
    – Maarten Bodewes
    Jul 18, 2023 at 3:11
  • 1
    $\begingroup$ I've found the basic wiki page to be sufficient as it has the workflow. And you can verify against the test inputs. It's really not that hard if you use a proven version of the hash rather than writing that bit yourself. $\endgroup$
    – Paul Uszak
    Jul 18, 2023 at 3:50
  • 1
    $\begingroup$ @MaartenBodewes-onstrike I'm pretty sure it's a typo, and "Input data" is what's intended. (Datum is the singular form of data btw.) $\endgroup$
    – DannyNiu
    Jul 18, 2023 at 9:04
  • $\begingroup$ You can get test data from the Nist, see here for HMAC-SHA256. $\endgroup$
    – garfunkel
    Jul 19, 2023 at 11:33

1 Answer 1


When I have been in this situation, I have found it helpful to find someone else's implementation, and instrument it with print statements. It's not clear what langauge you are using, but it never hurts to get exposed to a new one anyway :). Take this example in C perhaps? https://github.com/h5p9sl/hmac_sha256/blob/master/hmac_sha256.c


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.