00001
00002
00003
00004
00005 #include <string.h>
00006 #include "tests/arc4.h"
00007 #include "tests/lib.h"
00008 #include "tests/main.h"
00009
00010 const char *test_name = "child-linear";
00011
00012 #define SIZE (1024 * 1024)
00013 static char buf[SIZE];
00014
00015 int
00016 main (int argc, char *argv[])
00017 {
00018 const char *key = argv[argc - 1];
00019 struct arc4 arc4;
00020 size_t i;
00021
00022
00023 arc4_init (&arc4, key, strlen (key));
00024 arc4_crypt (&arc4, buf, SIZE);
00025
00026
00027 arc4_init (&arc4, key, strlen (key));
00028 arc4_crypt (&arc4, buf, SIZE);
00029
00030
00031 for (i = 0; i < SIZE; i++)
00032 if (buf[i] != '\0')
00033 fail ("byte %zu != 0", i);
00034
00035 return 0x42;
00036 }