diff options
Diffstat (limited to 'nacl/tests/core4.c')
-rw-r--r-- | nacl/tests/core4.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/nacl/tests/core4.c b/nacl/tests/core4.c new file mode 100644 index 00000000..1f238c5e --- /dev/null +++ b/nacl/tests/core4.c | |||
@@ -0,0 +1,33 @@ | |||
1 | #include <stdio.h> | ||
2 | #include "crypto_core_salsa20.h" | ||
3 | |||
4 | unsigned char k[32] = { | ||
5 | 1, 2, 3, 4, 5, 6, 7, 8 | ||
6 | , 9, 10, 11, 12, 13, 14, 15, 16 | ||
7 | ,201,202,203,204,205,206,207,208 | ||
8 | ,209,210,211,212,213,214,215,216 | ||
9 | } ; | ||
10 | |||
11 | unsigned char in[16] = { | ||
12 | 101,102,103,104,105,106,107,108 | ||
13 | ,109,110,111,112,113,114,115,116 | ||
14 | } ; | ||
15 | |||
16 | unsigned char c[16] = { | ||
17 | 101,120,112, 97,110,100, 32, 51 | ||
18 | , 50, 45, 98,121,116,101, 32,107 | ||
19 | } ; | ||
20 | |||
21 | unsigned char out[64]; | ||
22 | |||
23 | main() | ||
24 | { | ||
25 | int i; | ||
26 | crypto_core_salsa20(out,in,k,c); | ||
27 | for (i = 0;i < 64;++i) { | ||
28 | if (i > 0) printf(","); else printf(" "); | ||
29 | printf("%3d",(unsigned int) out[i]); | ||
30 | if (i % 8 == 7) printf("\n"); | ||
31 | } | ||
32 | return 0; | ||
33 | } | ||