MeterLogger
|
#include <esp8266.h>
#include <string.h>
#include "crypto/crypto.h"
#include "crypto/aes.h"
#include "crypto/sha256.h"
#include "crypto/hmac-sha256.h"
#include "user_config.h"
Go to the source code of this file.
Functions | |
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) |
Variables | |
uint8_t | sha256_hash [SHA256_DIGEST_LENGTH] |
uint8_t | aes_key [16] |
uint8_t | hmac_sha256_key [16] |
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().
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().
uint8_t aes_key[16] |
Definition at line 19 of file crypto.c.
Referenced by decrypt_aes_hmac_combined(), encrypt_aes_hmac_combined(), and init_aes_hmac_combined().
uint8_t hmac_sha256_key[16] |
Definition at line 20 of file crypto.c.
Referenced by decrypt_aes_hmac_combined(), encrypt_aes_hmac_combined(), and init_aes_hmac_combined().
uint8_t sha256_hash[SHA256_DIGEST_LENGTH] |
Definition at line 18 of file crypto.c.
Referenced by init_aes_hmac_combined().