On 21-11-14 21:28, Anton Lundin wrote:
This imports Tiny AES128 from https://github.com/kokke/tiny-AES128-C for use in the decoding of OSTC3 firmwares.
There are two problems with this aes implementation.
The first one is the stdint.h header, which is not available when compiling with msvc. This can be fixed easily by replacing uint8_t and uint32_t with unsigned char and unsigned int. (This is also the main reason why libdivecomputer doesn't use those C99 integer types anywhere.)
The second one are the global variables. This is not thread-safe, so this will need to be refactored to move those global variables into some aes_ctx_t structure, and pass that to the helper functions instead. The alternative is to link against some crypto library (e.g. openssl). But that might be overkill for what we need.
Jef