auth.c 393 B

12345678910111213141516171819
  1. #include <stdio.h>
  2. #include "crypto_auth_hmacsha512256.h"
  3. /* "Test Case 2" from RFC 4231 */
  4. unsigned char key[32] = "Jefe";
  5. unsigned char c[28] = "what do ya want for nothing?";
  6. unsigned char a[32];
  7. int main()
  8. {
  9. int i;
  10. crypto_auth_hmacsha512256(a,c,sizeof c,key);
  11. for (i = 0;i < 32;++i) {
  12. printf(",0x%02x",(unsigned int) a[i]);
  13. if (i % 8 == 7) printf("\n");
  14. }
  15. return 0;
  16. }