/** * @file include/di/encryption.h * @brief DI-net encryption implementation * @date 9 January 2015 * @author ing. R.W.A. van der Heijden * @copyright 2015 Dual Inventive B.V. * * Implementation of the DI-Net encryption, gives the full HMAC-MD5-AES-128-CBC-IVSI encryption and decryption */ #ifndef __DINET_ENCRYPTION_H__ #define __DINET_ENCRYPTION_H__ #ifdef __cplusplus extern "C" { #endif #define DI_ENCRYPTION_BLOCKSIZE 16 struct di_crypt_ctx { uint8_t aeskey[DI_ENCRYPTION_BLOCKSIZE]; uint8_t hmackey[DI_ENCRYPTION_BLOCKSIZE]; }; int8_t di_crypt_encrypt(const struct di_crypt_ctx *ctx, uint8_t *output, uint16_t *out_len, const uint8_t *input, uint16_t len); int8_t di_crypt_decrypt(const struct di_crypt_ctx *ctx, uint8_t *output, uint16_t *out_len, const uint8_t *input, uint16_t len); #ifdef __cplusplus } #endif #endif /* __DINET_ENCRYPTION_H__ */