summaryrefslogtreecommitdiff
path: root/test/default/core1.c
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2014-11-11 11:18:18 -0500
committerMicah Anderson <micah@riseup.net>2014-11-11 11:18:18 -0500
commitc73b6c9ba513fea3e18b696e659049df69931171 (patch)
treea001cd6acbecead76b9a55f324278e8d077fe3d5 /test/default/core1.c
parenteabdc6e3d62550679476899dd861c23b63937142 (diff)
update to 1.0.0-1 version of the package
Diffstat (limited to 'test/default/core1.c')
-rw-r--r--test/default/core1.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/test/default/core1.c b/test/default/core1.c
index 4c9453f..44f90c4 100644
--- a/test/default/core1.c
+++ b/test/default/core1.c
@@ -1,32 +1,39 @@
-#include <stdio.h>
#define TEST_NAME "core1"
#include "cmptest.h"
-unsigned char shared[32] = {
- 0x4a,0x5d,0x9d,0x5b,0xa4,0xce,0x2d,0xe1
-,0x72,0x8e,0x3b,0xf4,0x80,0x35,0x0f,0x25
-,0xe0,0x7e,0x21,0xc9,0x47,0xd1,0x9e,0x33
-,0x76,0xf0,0x9b,0x3c,0x1e,0x16,0x17,0x42
-} ;
+unsigned char shared[32]
+ = { 0x4a, 0x5d, 0x9d, 0x5b, 0xa4, 0xce, 0x2d, 0xe1, 0x72, 0x8e, 0x3b,
+ 0xf4, 0x80, 0x35, 0x0f, 0x25, 0xe0, 0x7e, 0x21, 0xc9, 0x47, 0xd1,
+ 0x9e, 0x33, 0x76, 0xf0, 0x9b, 0x3c, 0x1e, 0x16, 0x17, 0x42 };
unsigned char zero[32] = { 0 };
-unsigned char c[16] = {
- 0x65,0x78,0x70,0x61,0x6e,0x64,0x20,0x33
-,0x32,0x2d,0x62,0x79,0x74,0x65,0x20,0x6b
-} ;
+unsigned char c[16] = { 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x20, 0x33,
+ 0x32, 0x2d, 0x62, 0x79, 0x74, 0x65, 0x20, 0x6b };
unsigned char firstkey[32];
int main(void)
{
- int i;
- crypto_core_hsalsa20(firstkey,zero,shared,c);
- for (i = 0;i < 32;++i) {
- if (i > 0) printf(","); else printf(" ");
- printf("0x%02x",(unsigned int) firstkey[i]);
- if (i % 8 == 7) printf("\n");
- }
- return 0;
+ int i;
+
+ crypto_core_hsalsa20(firstkey, zero, shared, c);
+ for (i = 0; i < 32; ++i) {
+ if (i > 0) {
+ printf(",");
+ } else {
+ printf(" ");
+ }
+ printf("0x%02x", (unsigned int)firstkey[i]);
+ if (i % 8 == 7) {
+ printf("\n");
+ }
+ }
+ assert(crypto_core_hsalsa20_outputbytes() > 0U);
+ assert(crypto_core_hsalsa20_inputbytes() > 0U);
+ assert(crypto_core_hsalsa20_keybytes() > 0U);
+ assert(crypto_core_hsalsa20_constbytes() > 0U);
+
+ return 0;
}