hmactest.c 344 B

12345678910111213141516171819
  1. #include "os.h"
  2. #include <mp.h>
  3. #include <libsec.h>
  4. uchar key[] = "Jefe";
  5. uchar data[] = "what do ya want for nothing?";
  6. void
  7. main(void)
  8. {
  9. int i;
  10. uchar hash[MD5dlen];
  11. hmac_md5(data, strlen((char*)data), key, 4, hash, nil);
  12. for(i=0; i<MD5dlen; i++)
  13. print("%2.2x", hash[i]);
  14. print("\n");
  15. print("750c783e6ab0b503eaa86e310a5db738\n");
  16. }