Classes | Macros | Typedefs | Functions | Variables
aes_nohw.c File Reference
#include <openssl/aes.h>
#include <assert.h>
#include <string.h>
#include "../../internal.h"
Include dependency graph for aes_nohw.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  AES_NOHW_BATCH
 
struct  AES_NOHW_SCHEDULE
 

Macros

#define AES_NOHW_BATCH_SIZE   2
 
#define AES_NOHW_BLOCK_WORDS   (16 / sizeof(aes_word_t))
 
#define AES_NOHW_COL01_MASK   0x0000ffff
 
#define AES_NOHW_COL2_MASK   0x00ff0000
 
#define AES_NOHW_COL3_MASK   0xff000000
 
#define aes_nohw_rotate_cols_right(v, n)
 
#define AES_NOHW_ROW0_MASK   0x03030303
 
#define AES_NOHW_ROW1_MASK   0x0c0c0c0c
 
#define AES_NOHW_ROW2_MASK   0x30303030
 
#define AES_NOHW_ROW3_MASK   0xc0c0c0c0
 
#define AES_NOHW_WORD_SIZE   4
 

Typedefs

typedef uint32_t aes_word_t
 

Functions

static void aes_nohw_add_round_key (AES_NOHW_BATCH *batch, const AES_NOHW_BATCH *key)
 
static aes_word_t aes_nohw_and (aes_word_t a, aes_word_t b)
 
static void aes_nohw_batch_get (const AES_NOHW_BATCH *batch, aes_word_t out[AES_NOHW_BLOCK_WORDS], size_t i)
 
static void aes_nohw_batch_set (AES_NOHW_BATCH *batch, const aes_word_t in[AES_NOHW_BLOCK_WORDS], size_t i)
 
void aes_nohw_cbc_encrypt (const uint8_t *in, uint8_t *out, size_t len, const AES_KEY *key, uint8_t *ivec, const int enc)
 
static void aes_nohw_compact_block (aes_word_t out[AES_NOHW_BLOCK_WORDS], const uint8_t in[16])
 
static uint32_t aes_nohw_compact_word (uint32_t a)
 
void aes_nohw_ctr32_encrypt_blocks (const uint8_t *in, uint8_t *out, size_t blocks, const AES_KEY *key, const uint8_t ivec[16])
 
void aes_nohw_decrypt (const uint8_t *in, uint8_t *out, const AES_KEY *key)
 
static void aes_nohw_decrypt_batch (const AES_NOHW_SCHEDULE *key, size_t num_rounds, AES_NOHW_BATCH *batch)
 
static aes_word_t aes_nohw_delta_swap (aes_word_t a, aes_word_t mask, aes_word_t shift)
 
void aes_nohw_encrypt (const uint8_t *in, uint8_t *out, const AES_KEY *key)
 
static void aes_nohw_encrypt_batch (const AES_NOHW_SCHEDULE *key, size_t num_rounds, AES_NOHW_BATCH *batch)
 
static void aes_nohw_expand_round_keys (AES_NOHW_SCHEDULE *out, const AES_KEY *key)
 
static void aes_nohw_from_batch (uint8_t *out, size_t num_blocks, const AES_NOHW_BATCH *batch)
 
static void aes_nohw_inv_mix_columns (AES_NOHW_BATCH *batch)
 
static void aes_nohw_inv_shift_rows (AES_NOHW_BATCH *batch)
 
static void aes_nohw_inv_sub_bytes (AES_NOHW_BATCH *batch)
 
static void aes_nohw_mix_columns (AES_NOHW_BATCH *batch)
 
static aes_word_t aes_nohw_not (aes_word_t a)
 
static aes_word_t aes_nohw_or (aes_word_t a, aes_word_t b)
 
static aes_word_t aes_nohw_rcon_slice (uint8_t rcon, size_t i)
 
static aes_word_t aes_nohw_rotate_rows_down (aes_word_t v)
 
static aes_word_t aes_nohw_rotate_rows_twice (aes_word_t v)
 
int aes_nohw_set_decrypt_key (const uint8_t *key, unsigned bits, AES_KEY *aeskey)
 
int aes_nohw_set_encrypt_key (const uint8_t *key, unsigned bits, AES_KEY *aeskey)
 
static void aes_nohw_setup_key_128 (AES_KEY *key, const uint8_t in[16])
 
static void aes_nohw_setup_key_192 (AES_KEY *key, const uint8_t in[24])
 
static void aes_nohw_setup_key_256 (AES_KEY *key, const uint8_t in[32])
 
static aes_word_t aes_nohw_shift_left (aes_word_t a, aes_word_t i)
 
static aes_word_t aes_nohw_shift_right (aes_word_t a, aes_word_t i)
 
static void aes_nohw_shift_rows (AES_NOHW_BATCH *batch)
 
static void aes_nohw_sub_block (aes_word_t out[AES_NOHW_BLOCK_WORDS], const aes_word_t in[AES_NOHW_BLOCK_WORDS])
 
static void aes_nohw_sub_bytes (AES_NOHW_BATCH *batch)
 
static void aes_nohw_sub_bytes_inv_affine (AES_NOHW_BATCH *batch)
 
static void aes_nohw_swap_bits (aes_word_t *a, aes_word_t *b, uint32_t mask, aes_word_t shift)
 
static void aes_nohw_to_batch (AES_NOHW_BATCH *out, const uint8_t *in, size_t num_blocks)
 
static void aes_nohw_transpose (AES_NOHW_BATCH *batch)
 
static void aes_nohw_uncompact_block (uint8_t out[16], const aes_word_t in[AES_NOHW_BLOCK_WORDS])
 
static uint32_t aes_nohw_uncompact_word (uint32_t a)
 
static uint32_t aes_nohw_word_from_bytes (uint8_t a0, uint8_t a1, uint8_t a2, uint8_t a3)
 
static aes_word_t aes_nohw_xor (aes_word_t a, aes_word_t b)
 
static void aes_nohw_xor_block (uint8_t out[16], const uint8_t a[16], const uint8_t b[16])
 
 OPENSSL_STATIC_ASSERT (AES_NOHW_BATCH_SIZE *128==8 *8 *sizeof(aes_word_t), "batch size does not match word size")
 
 OPENSSL_STATIC_ASSERT (AES_NOHW_WORD_SIZE==sizeof(aes_word_t), "AES_NOHW_WORD_SIZE is incorrect")
 

Variables

static const uint8_t aes_nohw_rcon [10]
 

Macro Definition Documentation

◆ AES_NOHW_BATCH_SIZE

#define AES_NOHW_BATCH_SIZE   2

Definition at line 121 of file aes_nohw.c.

◆ AES_NOHW_BLOCK_WORDS

#define AES_NOHW_BLOCK_WORDS   (16 / sizeof(aes_word_t))

Definition at line 210 of file aes_nohw.c.

◆ AES_NOHW_COL01_MASK

#define AES_NOHW_COL01_MASK   0x0000ffff

Definition at line 126 of file aes_nohw.c.

◆ AES_NOHW_COL2_MASK

#define AES_NOHW_COL2_MASK   0x00ff0000

Definition at line 127 of file aes_nohw.c.

◆ AES_NOHW_COL3_MASK

#define AES_NOHW_COL3_MASK   0xff000000

Definition at line 128 of file aes_nohw.c.

◆ aes_nohw_rotate_cols_right

#define aes_nohw_rotate_cols_right (   v,
  n 
)
Value:

Definition at line 706 of file aes_nohw.c.

◆ AES_NOHW_ROW0_MASK

#define AES_NOHW_ROW0_MASK   0x03030303

Definition at line 122 of file aes_nohw.c.

◆ AES_NOHW_ROW1_MASK

#define AES_NOHW_ROW1_MASK   0x0c0c0c0c

Definition at line 123 of file aes_nohw.c.

◆ AES_NOHW_ROW2_MASK

#define AES_NOHW_ROW2_MASK   0x30303030

Definition at line 124 of file aes_nohw.c.

◆ AES_NOHW_ROW3_MASK

#define AES_NOHW_ROW3_MASK   0xc0c0c0c0

Definition at line 125 of file aes_nohw.c.

◆ AES_NOHW_WORD_SIZE

#define AES_NOHW_WORD_SIZE   4

Definition at line 120 of file aes_nohw.c.

Typedef Documentation

◆ aes_word_t

Definition at line 119 of file aes_nohw.c.

Function Documentation

◆ aes_nohw_add_round_key()

static void aes_nohw_add_round_key ( AES_NOHW_BATCH batch,
const AES_NOHW_BATCH key 
)
static

Definition at line 505 of file aes_nohw.c.

◆ aes_nohw_and()

static aes_word_t aes_nohw_and ( aes_word_t  a,
aes_word_t  b 
)
inlinestatic

Definition at line 131 of file aes_nohw.c.

◆ aes_nohw_batch_get()

static void aes_nohw_batch_get ( const AES_NOHW_BATCH batch,
aes_word_t  out[AES_NOHW_BLOCK_WORDS],
size_t  i 
)
inlinestatic

Definition at line 254 of file aes_nohw.c.

◆ aes_nohw_batch_set()

static void aes_nohw_batch_set ( AES_NOHW_BATCH batch,
const aes_word_t  in[AES_NOHW_BLOCK_WORDS],
size_t  i 
)
inlinestatic

Definition at line 229 of file aes_nohw.c.

◆ aes_nohw_cbc_encrypt()

void aes_nohw_cbc_encrypt ( const uint8_t in,
uint8_t out,
size_t  len,
const AES_KEY key,
uint8_t ivec,
const int  enc 
)

Definition at line 1220 of file aes_nohw.c.

◆ aes_nohw_compact_block()

static void aes_nohw_compact_block ( aes_word_t  out[AES_NOHW_BLOCK_WORDS],
const uint8_t  in[16] 
)
inlinestatic

Definition at line 345 of file aes_nohw.c.

◆ aes_nohw_compact_word()

static uint32_t aes_nohw_compact_word ( uint32_t  a)
inlinestatic

Definition at line 315 of file aes_nohw.c.

◆ aes_nohw_ctr32_encrypt_blocks()

void aes_nohw_ctr32_encrypt_blocks ( const uint8_t in,
uint8_t out,
size_t  blocks,
const AES_KEY key,
const uint8_t  ivec[16] 
)

Definition at line 1173 of file aes_nohw.c.

◆ aes_nohw_decrypt()

void aes_nohw_decrypt ( const uint8_t in,
uint8_t out,
const AES_KEY key 
)

Definition at line 1153 of file aes_nohw.c.

◆ aes_nohw_decrypt_batch()

static void aes_nohw_decrypt_batch ( const AES_NOHW_SCHEDULE key,
size_t  num_rounds,
AES_NOHW_BATCH batch 
)
static

Definition at line 884 of file aes_nohw.c.

◆ aes_nohw_delta_swap()

static aes_word_t aes_nohw_delta_swap ( aes_word_t  a,
aes_word_t  mask,
aes_word_t  shift 
)
inlinestatic

Definition at line 274 of file aes_nohw.c.

◆ aes_nohw_encrypt()

void aes_nohw_encrypt ( const uint8_t in,
uint8_t out,
const AES_KEY key 
)

Definition at line 1144 of file aes_nohw.c.

◆ aes_nohw_encrypt_batch()

static void aes_nohw_encrypt_batch ( const AES_NOHW_SCHEDULE key,
size_t  num_rounds,
AES_NOHW_BATCH batch 
)
static

Definition at line 870 of file aes_nohw.c.

◆ aes_nohw_expand_round_keys()

static void aes_nohw_expand_round_keys ( AES_NOHW_SCHEDULE out,
const AES_KEY key 
)
static

Definition at line 901 of file aes_nohw.c.

◆ aes_nohw_from_batch()

static void aes_nohw_from_batch ( uint8_t out,
size_t  num_blocks,
const AES_NOHW_BATCH batch 
)
static

Definition at line 489 of file aes_nohw.c.

◆ aes_nohw_inv_mix_columns()

static void aes_nohw_inv_mix_columns ( AES_NOHW_BATCH batch)
static

Definition at line 811 of file aes_nohw.c.

◆ aes_nohw_inv_shift_rows()

static void aes_nohw_inv_shift_rows ( AES_NOHW_BATCH batch)
static

Definition at line 723 of file aes_nohw.c.

◆ aes_nohw_inv_sub_bytes()

static void aes_nohw_inv_sub_bytes ( AES_NOHW_BATCH batch)
static

Definition at line 689 of file aes_nohw.c.

◆ aes_nohw_mix_columns()

static void aes_nohw_mix_columns ( AES_NOHW_BATCH batch)
static

Definition at line 762 of file aes_nohw.c.

◆ aes_nohw_not()

static aes_word_t aes_nohw_not ( aes_word_t  a)
inlinestatic

Definition at line 143 of file aes_nohw.c.

◆ aes_nohw_or()

static aes_word_t aes_nohw_or ( aes_word_t  a,
aes_word_t  b 
)
inlinestatic

Definition at line 135 of file aes_nohw.c.

◆ aes_nohw_rcon_slice()

static aes_word_t aes_nohw_rcon_slice ( uint8_t  rcon,
size_t  i 
)
inlinestatic

Definition at line 919 of file aes_nohw.c.

◆ aes_nohw_rotate_rows_down()

static aes_word_t aes_nohw_rotate_rows_down ( aes_word_t  v)
inlinestatic

Definition at line 738 of file aes_nohw.c.

◆ aes_nohw_rotate_rows_twice()

static aes_word_t aes_nohw_rotate_rows_twice ( aes_word_t  v)
inlinestatic

Definition at line 751 of file aes_nohw.c.

◆ aes_nohw_set_decrypt_key()

int aes_nohw_set_decrypt_key ( const uint8_t key,
unsigned  bits,
AES_KEY aeskey 
)

Definition at line 1139 of file aes_nohw.c.

◆ aes_nohw_set_encrypt_key()

int aes_nohw_set_encrypt_key ( const uint8_t key,
unsigned  bits,
AES_KEY aeskey 
)

Definition at line 1123 of file aes_nohw.c.

◆ aes_nohw_setup_key_128()

static void aes_nohw_setup_key_128 ( AES_KEY key,
const uint8_t  in[16] 
)
static

Definition at line 939 of file aes_nohw.c.

◆ aes_nohw_setup_key_192()

static void aes_nohw_setup_key_192 ( AES_KEY key,
const uint8_t  in[24] 
)
static

Definition at line 967 of file aes_nohw.c.

◆ aes_nohw_setup_key_256()

static void aes_nohw_setup_key_256 ( AES_KEY key,
const uint8_t  in[32] 
)
static

Definition at line 1073 of file aes_nohw.c.

◆ aes_nohw_shift_left()

static aes_word_t aes_nohw_shift_left ( aes_word_t  a,
aes_word_t  i 
)
inlinestatic

Definition at line 145 of file aes_nohw.c.

◆ aes_nohw_shift_right()

static aes_word_t aes_nohw_shift_right ( aes_word_t  a,
aes_word_t  i 
)
inlinestatic

Definition at line 149 of file aes_nohw.c.

◆ aes_nohw_shift_rows()

static void aes_nohw_shift_rows ( AES_NOHW_BATCH batch)
static

Definition at line 710 of file aes_nohw.c.

◆ aes_nohw_sub_block()

static void aes_nohw_sub_block ( aes_word_t  out[AES_NOHW_BLOCK_WORDS],
const aes_word_t  in[AES_NOHW_BLOCK_WORDS] 
)
static

Definition at line 928 of file aes_nohw.c.

◆ aes_nohw_sub_bytes()

static void aes_nohw_sub_bytes ( AES_NOHW_BATCH batch)
static

Definition at line 512 of file aes_nohw.c.

◆ aes_nohw_sub_bytes_inv_affine()

static void aes_nohw_sub_bytes_inv_affine ( AES_NOHW_BATCH batch)
static

Definition at line 656 of file aes_nohw.c.

◆ aes_nohw_swap_bits()

static void aes_nohw_swap_bits ( aes_word_t a,
aes_word_t b,
uint32_t  mask,
aes_word_t  shift 
)
inlinestatic

Definition at line 430 of file aes_nohw.c.

◆ aes_nohw_to_batch()

static void aes_nohw_to_batch ( AES_NOHW_BATCH out,
const uint8_t in,
size_t  num_blocks 
)
static

Definition at line 473 of file aes_nohw.c.

◆ aes_nohw_transpose()

static void aes_nohw_transpose ( AES_NOHW_BATCH batch)
static

Definition at line 447 of file aes_nohw.c.

◆ aes_nohw_uncompact_block()

static void aes_nohw_uncompact_block ( uint8_t  out[16],
const aes_word_t  in[AES_NOHW_BLOCK_WORDS] 
)
inlinestatic

Definition at line 372 of file aes_nohw.c.

◆ aes_nohw_uncompact_word()

static uint32_t aes_nohw_uncompact_word ( uint32_t  a)
inlinestatic

Definition at line 330 of file aes_nohw.c.

◆ aes_nohw_word_from_bytes()

static uint32_t aes_nohw_word_from_bytes ( uint8_t  a0,
uint8_t  a1,
uint8_t  a2,
uint8_t  a3 
)
inlinestatic

Definition at line 337 of file aes_nohw.c.

◆ aes_nohw_xor()

static aes_word_t aes_nohw_xor ( aes_word_t  a,
aes_word_t  b 
)
inlinestatic

Definition at line 139 of file aes_nohw.c.

◆ aes_nohw_xor_block()

static void aes_nohw_xor_block ( uint8_t  out[16],
const uint8_t  a[16],
const uint8_t  b[16] 
)
inlinestatic

Definition at line 1162 of file aes_nohw.c.

◆ OPENSSL_STATIC_ASSERT() [1/2]

OPENSSL_STATIC_ASSERT ( AES_NOHW_BATCH_SIZE 128 = =8 *8 *sizeof(aes_word_t),
"batch size does not match word size  
)

◆ OPENSSL_STATIC_ASSERT() [2/2]

OPENSSL_STATIC_ASSERT ( AES_NOHW_WORD_SIZE  = =sizeof(aes_word_t),
"AES_NOHW_WORD_SIZE is incorrect"   
)

Variable Documentation

◆ aes_nohw_rcon

const uint8_t aes_nohw_rcon[10]
static
Initial value:
= {0x01, 0x02, 0x04, 0x08, 0x10,
0x20, 0x40, 0x80, 0x1b, 0x36}

Definition at line 914 of file aes_nohw.c.

aes_nohw_shift_left
static aes_word_t aes_nohw_shift_left(aes_word_t a, aes_word_t i)
Definition: aes_nohw.c:145
aes_nohw_shift_right
static aes_word_t aes_nohw_shift_right(aes_word_t a, aes_word_t i)
Definition: aes_nohw.c:149
aes_nohw_or
static aes_word_t aes_nohw_or(aes_word_t a, aes_word_t b)
Definition: aes_nohw.c:135
setup.v
v
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:02