#include #include #include #include "ntru_crypto.h" #include "ntru_crypto_drbg.h" #include "test_common.h" /* For each parameter set: * - Generate a key * - Encrypt a message at every length between * 0 and maxMsgLenBytes. * - Check that decryption succeeds. * - Check that decryption fails for bad ciphertexts */ int main(int argc, char **argv) { uint16_t i; uint8_t *public_key; uint8_t *private_key; uint8_t *message; uint8_t *ciphertext; uint8_t *plaintext; uint16_t max_msg_len; uint16_t mlen; uint16_t public_key_len; /* no. of octets in public key */ uint16_t private_key_len; /* no. of octets in private key */ uint16_t ciphertext_len; /* no. of octets in ciphertext */ uint16_t plaintext_len; /* no. of octets in plaintext */ DRBG_HANDLE drbg; /* handle for instantiated DRBG */ uint32_t rc; /* return code */ NTRU_ENCRYPT_PARAM_SET_ID param_set_id; uint32_t error[NUM_PARAM_SETS] = {0}; for(i=0; i