libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / libsodium / test / default / core1.c
blob4c9453fab27d0987422a9af1501e7d8bc497ed1c
1 #include <stdio.h>
3 #define TEST_NAME "core1"
4 #include "cmptest.h"
6 unsigned char shared[32] = {
7 0x4a,0x5d,0x9d,0x5b,0xa4,0xce,0x2d,0xe1
8 ,0x72,0x8e,0x3b,0xf4,0x80,0x35,0x0f,0x25
9 ,0xe0,0x7e,0x21,0xc9,0x47,0xd1,0x9e,0x33
10 ,0x76,0xf0,0x9b,0x3c,0x1e,0x16,0x17,0x42
11 } ;
13 unsigned char zero[32] = { 0 };
15 unsigned char c[16] = {
16 0x65,0x78,0x70,0x61,0x6e,0x64,0x20,0x33
17 ,0x32,0x2d,0x62,0x79,0x74,0x65,0x20,0x6b
18 } ;
20 unsigned char firstkey[32];
22 int main(void)
24 int i;
25 crypto_core_hsalsa20(firstkey,zero,shared,c);
26 for (i = 0;i < 32;++i) {
27 if (i > 0) printf(","); else printf(" ");
28 printf("0x%02x",(unsigned int) firstkey[i]);
29 if (i % 8 == 7) printf("\n");
31 return 0;