1 /* Child process of page-parallel.
2 Encrypts 128 kB of zeros, then decrypts it, and ensures that
6 #include "tests/arc4.h"
8 #include "tests/main.h"
10 const char *test_name = "child-linear";
12 #define SIZE (128 * 1024)
13 static char buf[SIZE];
16 main (int argc, char *argv[])
18 const char *key = argv[argc - 1];
23 arc4_init (&arc4, key, strlen (key));
24 arc4_crypt (&arc4, buf, SIZE);
26 /* Decrypt back to zeros. */
27 arc4_init (&arc4, key, strlen (key));
28 arc4_crypt (&arc4, buf, SIZE);
30 /* Check that it's all zeros. */
31 for (i = 0; i < SIZE; i++)
33 fail ("byte %zu != 0", i);