|
Electroneum
|
#include <stddef.h>#include <time.h>#include <string.h>#include <stdlib.h>#include <stdio.h>#include <malloc.h>#include <sys/timeb.h>#include <sys/types.h>#include <unistd.h>#include "oaes_config.h"#include "oaes_lib.h"
Macros | |
| #define | GETPID() getpid() |
| #define | OAES_RKEY_LEN 4 |
| #define | OAES_COL_LEN 4 |
| #define | OAES_ROUND_BASE 7 |
| #define | OAES_FLAG_PAD 0x01 |
| #define | min(a, b) (((a)<(b)) ? (a) : (b)) |
Functions | |
| static OAES_RET | oaes_sub_byte (uint8_t *byte) |
| static OAES_RET | oaes_inv_sub_byte (uint8_t *byte) |
| static OAES_RET | oaes_word_rot_left (uint8_t word[OAES_COL_LEN]) |
| static OAES_RET | oaes_shift_rows (uint8_t block[OAES_BLOCK_SIZE]) |
| static OAES_RET | oaes_inv_shift_rows (uint8_t block[OAES_BLOCK_SIZE]) |
| static uint8_t | oaes_gf_mul (uint8_t left, uint8_t right) |
| static OAES_RET | oaes_mix_cols (uint8_t word[OAES_COL_LEN]) |
| static OAES_RET | oaes_inv_mix_cols (uint8_t word[OAES_COL_LEN]) |
| OAES_RET | oaes_sprintf (char *buf, size_t *buf_len, const uint8_t *data, size_t data_len) |
| static uint32_t | oaes_get_seed (void) |
| static OAES_RET | oaes_key_destroy (oaes_key **key) |
| static OAES_RET | oaes_key_expand (OAES_CTX *ctx) |
| static OAES_RET | oaes_key_gen (OAES_CTX *ctx, size_t key_size) |
| OAES_RET | oaes_key_gen_128 (OAES_CTX *ctx) |
| OAES_RET | oaes_key_gen_192 (OAES_CTX *ctx) |
| OAES_RET | oaes_key_gen_256 (OAES_CTX *ctx) |
| OAES_RET | oaes_key_export (OAES_CTX *ctx, uint8_t *data, size_t *data_len) |
| OAES_RET | oaes_key_export_data (OAES_CTX *ctx, uint8_t *data, size_t *data_len) |
| OAES_RET | oaes_key_import (OAES_CTX *ctx, const uint8_t *data, size_t data_len) |
| OAES_RET | oaes_key_import_data (OAES_CTX *ctx, const uint8_t *data, size_t data_len) |
| OAES_CTX * | oaes_alloc (void) |
| OAES_RET | oaes_free (OAES_CTX **ctx) |
| OAES_RET | oaes_set_option (OAES_CTX *ctx, OAES_OPTION option, const void *value) |
| static OAES_RET | oaes_encrypt_block (OAES_CTX *ctx, uint8_t *c, size_t c_len) |
| static OAES_RET | oaes_decrypt_block (OAES_CTX *ctx, uint8_t *c, size_t c_len) |
| OAES_RET | oaes_encrypt (OAES_CTX *ctx, const uint8_t *m, size_t m_len, uint8_t *c, size_t *c_len) |
| OAES_RET | oaes_decrypt (OAES_CTX *ctx, const uint8_t *c, size_t c_len, uint8_t *m, size_t *m_len) |
| OAES_API OAES_RET | oaes_encryption_round (const uint8_t *key, uint8_t *c) |
| OAES_API OAES_RET | oaes_pseudo_encrypt_ecb (OAES_CTX *ctx, uint8_t *c) |
Variables | |
| static uint8_t | oaes_header [OAES_BLOCK_SIZE] |
| static uint8_t | oaes_gf_8 [] |
| static uint8_t | oaes_sub_byte_value [16][16] |
| static uint8_t | oaes_inv_sub_byte_value [16][16] |
| static uint8_t | oaes_gf_mul_2 [16][16] |
| static uint8_t | oaes_gf_mul_3 [16][16] |
| static uint8_t | oaes_gf_mul_9 [16][16] |
| static uint8_t | oaes_gf_mul_b [16][16] |
| static uint8_t | oaes_gf_mul_d [16][16] |
| static uint8_t | oaes_gf_mul_e [16][16] |
| #define GETPID | ( | ) | getpid() |
| #define min | ( | a, | |
| b | |||
| ) | (((a)<(b)) ? (a) : (b)) |
| #define OAES_COL_LEN 4 |
| #define OAES_FLAG_PAD 0x01 |
| #define OAES_RKEY_LEN 4 |
| #define OAES_ROUND_BASE 7 |
| OAES_CTX* oaes_alloc | ( | void | ) |
| OAES_RET oaes_decrypt | ( | OAES_CTX * | ctx, |
| const uint8_t * | c, | ||
| size_t | c_len, | ||
| uint8_t * | m, | ||
| size_t * | m_len | ||
| ) |
| OAES_RET oaes_encrypt | ( | OAES_CTX * | ctx, |
| const uint8_t * | m, | ||
| size_t | m_len, | ||
| uint8_t * | c, | ||
| size_t * | c_len | ||
| ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| OAES_RET oaes_set_option | ( | OAES_CTX * | ctx, |
| OAES_OPTION | option, | ||
| const void * | value | ||
| ) |
|
static |
| OAES_RET oaes_sprintf | ( | char * | buf, |
| size_t * | buf_len, | ||
| const uint8_t * | data, | ||
| size_t | data_len | ||
| ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |