MeterLogger
|
Go to the source code of this file.
Macros | |
#define | _align_32_bit __attribute__((aligned(4))) |
#define | is_aligned(POINTER, BYTE_COUNT) (((uintptr_t)(const void *)(POINTER)) % (BYTE_COUNT) == 0) |
Functions | |
ICACHE_FLASH_ATTR void | init_aes_hmac_combined (uint8_t *key) |
ICACHE_FLASH_ATTR size_t | encrypt_aes_hmac_combined (uint8_t *dst, uint8_t *topic, size_t topic_l, uint8_t *message, size_t message_l) |
ICACHE_FLASH_ATTR size_t | decrypt_aes_hmac_combined (uint8_t *dst, uint8_t *topic, size_t topic_l, uint8_t *message, size_t message_l) |
#define _align_32_bit __attribute__((aligned(4))) |
Definition at line 15 of file crypto.h.
Referenced by init_aes_hmac_combined().
#define is_aligned | ( | POINTER, | |
BYTE_COUNT | |||
) | (((uintptr_t)(const void *)(POINTER)) % (BYTE_COUNT) == 0) |
ICACHE_FLASH_ATTR size_t decrypt_aes_hmac_combined | ( | uint8_t * | dst, |
uint8_t * | topic, | ||
size_t | topic_l, | ||
uint8_t * | message, | ||
size_t | message_l | ||
) |
Definition at line 99 of file crypto.c.
References AES128_CBC_decrypt_buffer(), aes_key, hmac_sha256_final(), hmac_sha256_init(), hmac_sha256_key, hmac_sha256_update(), memcmp, SHA256_DIGEST_LENGTH, and strlen.
ICACHE_FLASH_ATTR size_t encrypt_aes_hmac_combined | ( | uint8_t * | dst, |
uint8_t * | topic, | ||
size_t | topic_l, | ||
uint8_t * | message, | ||
size_t | message_l | ||
) |
Definition at line 68 of file crypto.c.
References AES128_CBC_encrypt_buffer(), aes_key, hmac_sha256_final(), hmac_sha256_init(), hmac_sha256_key, hmac_sha256_update(), ICACHE_FLASH_ATTR, memset, os_get_random(), and SHA256_DIGEST_LENGTH.
Referenced by en61107_received_task(), en61107_request_send(), kmp_received_task(), and kmp_request_send().
ICACHE_FLASH_ATTR void init_aes_hmac_combined | ( | uint8_t * | key | ) |
Definition at line 22 of file crypto.c.
References _align_32_bit, aes_key, hmac_sha256_key, ICACHE_FLASH_ATTR, memcpy, memset, printf, sha256_hash, sha256_raw(), system_soft_wdt_restart(), and system_soft_wdt_stop().