#include #include #include #include #include "lilliput-ae.h" void parse_arguments( size_t argc, char const* const* argv, size_t* plaintext_len, size_t* auth_len, FILE** output ) { sscanf(argv[1], "%zu", plaintext_len); sscanf(argv[2], "%zu", auth_len); if (argc > 3) *output = fopen(argv[3], "w"); else *output = stdout; } void init_buffer(size_t len, uint8_t buf[len]) { for (size_t i=0; i\n"); fprintf(output, "#include \"test_vectors.h\"\n"); dump_buffer(output, "const uint8_t expectedPlaintext[MAXTEST_BYTES_M]", plaintext_len, plaintext); dump_buffer(output, "const uint8_t expectedAssociated[MAXTEST_BYTES_AD]", auth_len, auth); dump_buffer(output, "const uint8_t expectedKey[KEY_SIZE]", KEY_BYTES, key); dump_buffer(output, "const uint8_t expectedCiphertext[MAXTEST_BYTES_M+CRYPTO_ABYTES]", plaintext_len+TAG_BYTES, ciphertext); fclose(output); }