summaryrefslogtreecommitdiff
path: root/nacl/tests/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'nacl/tests/auth.c')
-rw-r--r--nacl/tests/auth.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/nacl/tests/auth.c b/nacl/tests/auth.c
new file mode 100644
index 00000000..5086624e
--- /dev/null
+++ b/nacl/tests/auth.c
@@ -0,0 +1,19 @@
1#include <stdio.h>
2#include "crypto_auth_hmacsha512256.h"
3
4/* "Test Case 2" from RFC 4231 */
5unsigned char key[32] = "Jefe";
6unsigned char c[28] = "what do ya want for nothing?";
7
8unsigned char a[32];
9
10main()
11{
12 int i;
13 crypto_auth_hmacsha512256(a,c,sizeof c,key);
14 for (i = 0;i < 32;++i) {
15 printf(",0x%02x",(unsigned int) a[i]);
16 if (i % 8 == 7) printf("\n");
17 }
18 return 0;
19}