libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / libsodium / test / default / auth.c
blob88c8207f5af426ae9be2a39d19a35d41efb86419
1 #include <stdio.h>
3 #define TEST_NAME "auth"
4 #include "cmptest.h"
6 /* "Test Case 2" from RFC 4231 */
7 unsigned char key[32] = "Jefe";
8 unsigned char c[] = "what do ya want for nothing?";
10 unsigned char a[32];
12 int main(void)
14 int i;
15 crypto_auth_hmacsha512256(a,c,sizeof c - 1U,key);
16 for (i = 0;i < 32;++i) {
17 printf(",0x%02x",(unsigned int) a[i]);
18 if (i % 8 == 7) printf("\n");
20 return 0;