2019-02-04 16:30:52 -05:00
|
|
|
#ifndef CRYPTO_H
|
|
|
|
#define CRYPTO_H
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdio.h>
|
2019-02-07 07:16:42 -05:00
|
|
|
#include "hardware/crypto/aes.h"
|
|
|
|
#include "hardware/LED.h"
|
|
|
|
#include "hardware/SD.h"
|
|
|
|
|
|
|
|
#define PATH_ENTROPY_INDEX "OpenModem/entropy.index"
|
|
|
|
#define PATH_ENTROPY_SOURCE "OpenModem/entropy.source"
|
|
|
|
#define PATH_AES_128_KEY "OpenModem/aes128.key"
|
|
|
|
|
|
|
|
#define CRYPTO_KEY_SIZE_BITS 128
|
|
|
|
#define CRYPTO_KEY_SIZE (CRYPTO_KEY_SIZE_BITS/8)
|
|
|
|
#define MAX_IVS_PER_ENTROPY_BLOCK 128
|
2019-02-04 16:30:52 -05:00
|
|
|
|
|
|
|
void crypto_init(void);
|
|
|
|
void crypto_test(void);
|
|
|
|
|
2019-02-07 07:16:42 -05:00
|
|
|
bool load_key(void);
|
|
|
|
bool load_entropy(void);
|
|
|
|
bool load_entropy_index(void);
|
|
|
|
|
2019-02-04 16:30:52 -05:00
|
|
|
#endif
|
|
|
|
|