![]() |
SX126x-Arduino
2.0.1
|
Macros | |
#define | USE_TABLES |
#define | VERSION_1 |
#define | WPOLY 0x011b |
#define | BPOLY 0x1b |
#define | DPOLY 0x008d |
#define | f1(x) (x) |
#define | f2(x) ((x << 1) ^ (((x >> 7) & 1) * WPOLY)) |
#define | f4(x) ((x << 2) ^ (((x >> 6) & 1) * WPOLY) ^ (((x >> 6) & 2) * WPOLY)) |
#define | f8(x) ((x << 3) ^ (((x >> 5) & 1) * WPOLY) ^ (((x >> 5) & 2) * WPOLY) ^ (((x >> 5) & 4) * WPOLY)) |
#define | d2(x) (((x) >> 1) ^ ((x)&1 ? DPOLY : 0)) |
#define | f3(x) (f2(x) ^ x) |
#define | f9(x) (f8(x) ^ x) |
#define | fb(x) (f8(x) ^ f2(x) ^ x) |
#define | fd(x) (f8(x) ^ f4(x) ^ x) |
#define | fe(x) (f8(x) ^ f4(x) ^ f2(x)) |
#define | sb_data(w) |
#define | isb_data(w) |
#define | mm_data(w) |
#define | s_box(x) sbox[(x)] |
#define | gfm2_sb(x) gfm2_sbox[(x)] |
#define | gfm3_sb(x) gfm3_sbox[(x)] |
#define | block_copy_nn(d, s, l) copy_block_nn(d, s, l) |
#define | block_copy(d, s) copy_block(d, s) |
Functions | |
static void | copy_block (void *d, const void *s) |
static void | copy_block_nn (uint8_t *d, const uint8_t *s, uint8_t nn) |
static void | xor_block (void *d, const void *s) |
static void | copy_and_key (void *d, const void *s, const void *k) |
static void | add_round_key (uint8_t d[N_BLOCK], const uint8_t k[N_BLOCK]) |
static void | shift_sub_rows (uint8_t st[N_BLOCK]) |
static void | mix_sub_columns (uint8_t dt[N_BLOCK]) |
return_type | lora_aes_set_key (const uint8_t key[], length_type keylen, lora_aes_context ctx[1]) |
return_type | lora_aes_encrypt (const uint8_t in[N_BLOCK], uint8_t out[N_BLOCK], const lora_aes_context ctx[1]) |
return_type | lora_aes_cbc_encrypt (const uint8_t *in, uint8_t *out, int32_t n_block, uint8_t iv[N_BLOCK], const lora_aes_context ctx[1]) |
Variables | |
static const uint8_t | sbox [256] = sb_data(f1) |
static const uint8_t | gfm2_sbox [256] = sb_data(f2) |
static const uint8_t | gfm3_sbox [256] = sb_data(f3) |
#define USE_TABLES |
#define VERSION_1 |
#define WPOLY 0x011b |
#define BPOLY 0x1b |
#define DPOLY 0x008d |
#define f1 | ( | x | ) | (x) |
#define f2 | ( | x | ) | ((x << 1) ^ (((x >> 7) & 1) * WPOLY)) |
#define f8 | ( | x | ) | ((x << 3) ^ (((x >> 5) & 1) * WPOLY) ^ (((x >> 5) & 2) * WPOLY) ^ (((x >> 5) & 4) * WPOLY)) |
#define d2 | ( | x | ) | (((x) >> 1) ^ ((x)&1 ? DPOLY : 0)) |
#define f3 | ( | x | ) | (f2(x) ^ x) |
#define f9 | ( | x | ) | (f8(x) ^ x) |
#define sb_data | ( | w | ) |
#define isb_data | ( | w | ) |
#define mm_data | ( | w | ) |
#define s_box | ( | x | ) | sbox[(x)] |
#define gfm2_sb | ( | x | ) | gfm2_sbox[(x)] |
#define gfm3_sb | ( | x | ) | gfm3_sbox[(x)] |
#define block_copy_nn | ( | d, | |
s, | |||
l | |||
) | copy_block_nn(d, s, l) |
#define block_copy | ( | d, | |
s | |||
) | copy_block(d, s) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
return_type lora_aes_set_key | ( | const uint8_t | key[], |
length_type | keylen, | ||
lora_aes_context | ctx[1] | ||
) |
return_type lora_aes_encrypt | ( | const uint8_t | in[N_BLOCK], |
uint8_t | out[N_BLOCK], | ||
const lora_aes_context | ctx[1] | ||
) |
return_type lora_aes_cbc_encrypt | ( | const uint8_t * | in, |
uint8_t * | out, | ||
int32_t | n_block, | ||
uint8_t | iv[N_BLOCK], | ||
const lora_aes_context | ctx[1] | ||
) |