summaryrefslogtreecommitdiff
path: root/nacl/tests/auth.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-07-02 09:53:34 -0400
committerirungentoo <irungentoo@gmail.com>2013-07-02 09:53:34 -0400
commite2967396ac73cb7410787886cdaf072a184ffc49 (patch)
tree527a74d25a4a0705fc641994fd35bfab22662034 /nacl/tests/auth.c
parent8928c817df345f29aa0b194743595aa11bd6a8ba (diff)
Added NaCl crypto library.
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}