Headers which are included with '< >' can only be found if the folder where
the files are located is given as include path.
To be able to install the files to a separate folder, include them instead
with '" "'.
- Drop unused 'num' field from struct des_test_case.
- Fix the order of arguments passed to compare_testvector() (actual
and expected buffers were swapped, leading to misleading error
messages for failing tests).
- Enable all DES test vectors by default and use them for both
encrypt and decrypt. That allows the struct des_test_case 'mode'
field (which was previously incorrect for the LTC_TEST_EXT tests)
to be dropped.
- Run the "encrypt / decrypt all zero's" tests once, instead of
running repeatedly from within the test vectors loop.
- Add minimal set of 128bit key 3DES test vectors.
- Try to more closely align the des_test() and des3_test() functions
(common flow, common variable names, etc).
- Minor indent fixes.
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Now `make LTC_DEBUG=1` builds a full-speed library but with debug infos.
One has to do `make LTC_DEBUG=1 IGNORE_SPEED=1` now to have the same
results as before.
This was done since
1. it makes sense to enable optimization also when adding debug infos
2. clang+valgrind creates errors if there's no optimization enabled
(c.f. #497)
There is no check that the 'skey' structure has been properly
initialized. For example, the skey->rijndael.Nr is assumed to contain a
positive number corresponding to the number of AES rounds to perform. In
_rijndael_ecb_encrypt the skey->rijndael.Nr is subtracted by two, which
can result in an integer underflow if the structure hasn't been
initialized correctly.
By clamping the value for skey->rijndael.Nr into the valid rounds for
AES we can return an error instead of ending up reading outside the
boundaries (of skey->rijndael.eK).
Signed-off-by: Joakim Bech <joakim.bech@linaro.org>
Reported-by: Martijn Bogaard <bogaard@riscure.com>