Electroneum
oaes_lib.h File Reference
#include <stdint.h>
#include <stdlib.h>
Include dependency graph for oaes_lib.h:

Go to the source code of this file.

Classes

struct  _oaes_key
 
struct  _oaes_ctx
 

Macros

#define OAES_API
 
#define OAES_VERSION   "0.8.1"
 
#define OAES_BLOCK_SIZE   16
 
#define OAES_OPTION_NONE   0
 
#define OAES_OPTION_ECB   1
 
#define OAES_OPTION_CBC   2
 

Typedefs

typedef void OAES_CTX
 
typedef uint16_t OAES_OPTION
 
typedef struct _oaes_key oaes_key
 
typedef struct _oaes_ctx oaes_ctx
 

Enumerations

enum  OAES_RET {
  OAES_RET_FIRST = 0, OAES_RET_SUCCESS = 0, OAES_RET_UNKNOWN, OAES_RET_ARG1,
  OAES_RET_ARG2, OAES_RET_ARG3, OAES_RET_ARG4, OAES_RET_ARG5,
  OAES_RET_NOKEY, OAES_RET_MEM, OAES_RET_BUF, OAES_RET_HEADER,
  OAES_RET_COUNT
}
 

Functions

OAES_API OAES_CTXoaes_alloc (void)
 
OAES_API OAES_RET oaes_free (OAES_CTX **ctx)
 
OAES_API OAES_RET oaes_set_option (OAES_CTX *ctx, OAES_OPTION option, const void *value)
 
OAES_API OAES_RET oaes_key_gen_128 (OAES_CTX *ctx)
 
OAES_API OAES_RET oaes_key_gen_192 (OAES_CTX *ctx)
 
OAES_API OAES_RET oaes_key_gen_256 (OAES_CTX *ctx)
 
OAES_API OAES_RET oaes_key_export (OAES_CTX *ctx, uint8_t *data, size_t *data_len)
 
OAES_API OAES_RET oaes_key_export_data (OAES_CTX *ctx, uint8_t *data, size_t *data_len)
 
OAES_API OAES_RET oaes_key_import (OAES_CTX *ctx, const uint8_t *data, size_t data_len)
 
OAES_API OAES_RET oaes_key_import_data (OAES_CTX *ctx, const uint8_t *data, size_t data_len)
 
OAES_API OAES_RET oaes_encrypt (OAES_CTX *ctx, const uint8_t *m, size_t m_len, uint8_t *c, size_t *c_len)
 
OAES_API 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_sprintf (char *buf, size_t *buf_len, const uint8_t *data, size_t data_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)
 

Macro Definition Documentation

◆ OAES_API

#define OAES_API

Definition at line 52 of file oaes_lib.h.

◆ OAES_BLOCK_SIZE

#define OAES_BLOCK_SIZE   16

Definition at line 56 of file oaes_lib.h.

◆ OAES_OPTION_CBC

#define OAES_OPTION_CBC   2

Definition at line 88 of file oaes_lib.h.

◆ OAES_OPTION_ECB

#define OAES_OPTION_ECB   1

Definition at line 84 of file oaes_lib.h.

◆ OAES_OPTION_NONE

#define OAES_OPTION_NONE   0

Definition at line 82 of file oaes_lib.h.

◆ OAES_VERSION

#define OAES_VERSION   "0.8.1"

Definition at line 55 of file oaes_lib.h.

Typedef Documentation

◆ OAES_CTX

typedef void OAES_CTX

Definition at line 58 of file oaes_lib.h.

◆ oaes_ctx

typedef struct _oaes_ctx oaes_ctx

◆ oaes_key

typedef struct _oaes_key oaes_key

◆ OAES_OPTION

Definition at line 103 of file oaes_lib.h.

Enumeration Type Documentation

◆ OAES_RET

enum OAES_RET
Enumerator
OAES_RET_FIRST 
OAES_RET_SUCCESS 
OAES_RET_UNKNOWN 
OAES_RET_ARG1 
OAES_RET_ARG2 
OAES_RET_ARG3 
OAES_RET_ARG4 
OAES_RET_ARG5 
OAES_RET_NOKEY 
OAES_RET_MEM 
OAES_RET_BUF 
OAES_RET_HEADER 
OAES_RET_COUNT 

Definition at line 60 of file oaes_lib.h.

Function Documentation

◆ oaes_alloc()

OAES_API OAES_CTX* oaes_alloc ( void  )

◆ oaes_decrypt()

OAES_API OAES_RET oaes_decrypt ( OAES_CTX ctx,
const uint8_t c,
size_t  c_len,
uint8_t m,
size_t *  m_len 
)

◆ oaes_encrypt()

OAES_API OAES_RET oaes_encrypt ( OAES_CTX ctx,
const uint8_t m,
size_t  m_len,
uint8_t c,
size_t *  c_len 
)

◆ oaes_encryption_round()

OAES_API OAES_RET oaes_encryption_round ( const uint8_t key,
uint8_t c 
)

◆ oaes_free()

OAES_API OAES_RET oaes_free ( OAES_CTX **  ctx)

◆ oaes_key_export()

OAES_API OAES_RET oaes_key_export ( OAES_CTX ctx,
uint8_t data,
size_t *  data_len 
)

◆ oaes_key_export_data()

OAES_API OAES_RET oaes_key_export_data ( OAES_CTX ctx,
uint8_t data,
size_t *  data_len 
)

◆ oaes_key_gen_128()

OAES_API OAES_RET oaes_key_gen_128 ( OAES_CTX ctx)

◆ oaes_key_gen_192()

OAES_API OAES_RET oaes_key_gen_192 ( OAES_CTX ctx)

◆ oaes_key_gen_256()

OAES_API OAES_RET oaes_key_gen_256 ( OAES_CTX ctx)

◆ oaes_key_import()

OAES_API OAES_RET oaes_key_import ( OAES_CTX ctx,
const uint8_t data,
size_t  data_len 
)

◆ oaes_key_import_data()

OAES_API OAES_RET oaes_key_import_data ( OAES_CTX ctx,
const uint8_t data,
size_t  data_len 
)

◆ oaes_pseudo_encrypt_ecb()

OAES_API OAES_RET oaes_pseudo_encrypt_ecb ( OAES_CTX ctx,
uint8_t c 
)

◆ oaes_set_option()

OAES_API OAES_RET oaes_set_option ( OAES_CTX ctx,
OAES_OPTION  option,
const void *  value 
)

◆ oaes_sprintf()

OAES_API OAES_RET oaes_sprintf ( char *  buf,
size_t *  buf_len,
const uint8_t data,
size_t  data_len 
)