* Fix memory leaks with named_parameters.
They were not being freed in the Frodo and NewHope implementions. The bcns15 implementation never allocates them.
* Fix memory leaks in speed tests.
Many of the tests were running through many iterations of the same command, but were not cleaning up the memory used after each iteration.
As a result, running the tests would leak tons of memory onto the heap.
To help, created the TIME_OPERATION_SECONDS_CLEANUP function, that allows timing of a function with a cleanup function run after each iteration.
Verified no memory was leaked by running valgrind through each of the test cases:
valgrind --leak-check=full ./test_kex
valgrind --leak-check=full ./test_aes
valgrind --leak-check=full ./test_rand
Each case verified that heap use was cleaned up after running the tests:
All heap blocks were freed -- no leaks are possible
* Fix inlen passed into oqs_kex_lwe_frodo_pack function.
Was passing the number of bits allocated for the array, rather than the length of the array. This caused an invalid read of size 2 when running the test cases.
Verified with valgrind there is no more invalid read.
* Run 'make prettyprint' to fix up the formatting. Should pass the Travis CI build now.
* Change TIME_OPERATION_SECONDS macro so it can handle multiple operations.
* Pretty-print.
* Fixes memory leak and moves allocation into stuct.
Memory leak was caused by a possible partial allocation of the arrays in
oqs_kex_rlwe_bcns15_fft_ctx.
Allocate fixed size arrays in the oqs_kex_rlwe_bcns15_fft_ctx struct
rather then calling an initialization function afterwords. Also specify
fixed array sizes in functions where possible.
* Simplify Makefile and allow for better incremental builds.
Also add -std=gnu11 option since some older compilers default
to c99 which causes compilation to fail.
* Enable more warnings and fix some minor issues.
* Fixes a memory leak
Caused by method_name not being freed if
OQS_RAND_urandom_chacha20_ctx_new() fails. Also accounts for the fact
that strdup can fail and return NULL.