25#ifndef BR_BEARSSL_BLOCK_H__
26#define BR_BEARSSL_BLOCK_H__
423 void (*
init)(
const br_block_cbcenc_class **ctx,
424 const void *key,
size_t key_len);
439 void (*
run)(
const br_block_cbcenc_class *
const *ctx,
440 void *iv,
void *data,
size_t len);
479 void (*
init)(
const br_block_cbcdec_class **ctx,
480 const void *key,
size_t key_len);
495 void (*
run)(
const br_block_cbcdec_class *
const *ctx,
496 void *iv,
void *data,
size_t len);
536 void (*
init)(
const br_block_ctr_class **ctx,
537 const void *key,
size_t key_len);
562 uint32_t (*
run)(
const br_block_ctr_class *
const *ctx,
563 const void *iv, uint32_t cc,
void *data,
size_t len);
603 void (*
init)(
const br_block_ctrcbc_class **ctx,
604 const void *key,
size_t key_len);
627 void (*
encrypt)(
const br_block_ctrcbc_class *
const *ctx,
628 void *
ctr,
void *cbcmac,
void *data,
size_t len);
651 void (*
decrypt)(
const br_block_ctrcbc_class *
const *ctx,
652 void *
ctr,
void *cbcmac,
void *data,
size_t len);
669 void (*
ctr)(
const br_block_ctrcbc_class *
const *ctx,
670 void *
ctr,
void *data,
size_t len);
688 void (*
mac)(
const br_block_ctrcbc_class *
const *ctx,
689 void *cbcmac,
const void *data,
size_t len);
701#define br_aes_big_BLOCK_SIZE 16
712#ifndef BR_DOXYGEN_IGNORE
727#ifndef BR_DOXYGEN_IGNORE
743#ifndef BR_DOXYGEN_IGNORE
759#ifndef BR_DOXYGEN_IGNORE
796 const void *key,
size_t len);
807 const void *key,
size_t len);
818 const void *key,
size_t len);
829 const void *key,
size_t len);
840 void *data,
size_t len);
851 void *data,
size_t len);
864 const void *iv, uint32_t cc,
void *data,
size_t len);
876 void *ctr,
void *cbcmac,
void *data,
size_t len);
888 void *ctr,
void *cbcmac,
void *data,
size_t len);
899 void *ctr,
void *data,
size_t len);
910 void *cbcmac,
const void *data,
size_t len);
921#define br_aes_small_BLOCK_SIZE 16
932#ifndef BR_DOXYGEN_IGNORE
947#ifndef BR_DOXYGEN_IGNORE
963#ifndef BR_DOXYGEN_IGNORE
979#ifndef BR_DOXYGEN_IGNORE
1016 const void *key,
size_t len);
1027 const void *key,
size_t len);
1038 const void *key,
size_t len);
1049 const void *key,
size_t len);
1060 void *data,
size_t len);
1071 void *data,
size_t len);
1084 const void *iv, uint32_t cc,
void *data,
size_t len);
1096 void *ctr,
void *cbcmac,
void *data,
size_t len);
1108 void *ctr,
void *cbcmac,
void *data,
size_t len);
1119 void *ctr,
void *data,
size_t len);
1130 void *cbcmac,
const void *data,
size_t len);
1140#define br_aes_ct_BLOCK_SIZE 16
1151#ifndef BR_DOXYGEN_IGNORE
1153 unsigned num_rounds;
1166#ifndef BR_DOXYGEN_IGNORE
1168 unsigned num_rounds;
1182#ifndef BR_DOXYGEN_IGNORE
1184 unsigned num_rounds;
1198#ifndef BR_DOXYGEN_IGNORE
1200 unsigned num_rounds;
1235 const void *key,
size_t len);
1246 const void *key,
size_t len);
1257 const void *key,
size_t len);
1268 const void *key,
size_t len);
1279 void *data,
size_t len);
1290 void *data,
size_t len);
1303 const void *iv, uint32_t cc,
void *data,
size_t len);
1315 void *ctr,
void *cbcmac,
void *data,
size_t len);
1327 void *ctr,
void *cbcmac,
void *data,
size_t len);
1338 void *ctr,
void *data,
size_t len);
1349 void *cbcmac,
const void *data,
size_t len);
1361#define br_aes_ct64_BLOCK_SIZE 16
1372#ifndef BR_DOXYGEN_IGNORE
1374 unsigned num_rounds;
1387#ifndef BR_DOXYGEN_IGNORE
1389 unsigned num_rounds;
1403#ifndef BR_DOXYGEN_IGNORE
1405 unsigned num_rounds;
1419#ifndef BR_DOXYGEN_IGNORE
1421 unsigned num_rounds;
1456 const void *key,
size_t len);
1467 const void *key,
size_t len);
1478 const void *key,
size_t len);
1489 const void *key,
size_t len);
1500 void *data,
size_t len);
1511 void *data,
size_t len);
1524 const void *iv, uint32_t cc,
void *data,
size_t len);
1536 void *ctr,
void *cbcmac,
void *data,
size_t len);
1548 void *ctr,
void *cbcmac,
void *data,
size_t len);
1559 void *ctr,
void *data,
size_t len);
1570 void *cbcmac,
const void *data,
size_t len);
1577#define br_aes_x86ni_BLOCK_SIZE 16
1588#ifndef BR_DOXYGEN_IGNORE
1590 unsigned char skni[16 * 15];
1592 unsigned num_rounds;
1605#ifndef BR_DOXYGEN_IGNORE
1607 unsigned char skni[16 * 15];
1609 unsigned num_rounds;
1623#ifndef BR_DOXYGEN_IGNORE
1625 unsigned char skni[16 * 15];
1627 unsigned num_rounds;
1641#ifndef BR_DOXYGEN_IGNORE
1643 unsigned char skni[16 * 15];
1645 unsigned num_rounds;
1696 const void *key,
size_t len);
1707 const void *key,
size_t len);
1718 const void *key,
size_t len);
1729 const void *key,
size_t len);
1740 void *data,
size_t len);
1751 void *data,
size_t len);
1764 const void *iv, uint32_t cc,
void *data,
size_t len);
1776 void *ctr,
void *cbcmac,
void *data,
size_t len);
1788 void *ctr,
void *cbcmac,
void *data,
size_t len);
1799 void *ctr,
void *data,
size_t len);
1810 void *cbcmac,
const void *data,
size_t len);
1868#define br_aes_pwr8_BLOCK_SIZE 16
1879#ifndef BR_DOXYGEN_IGNORE
1881 unsigned char skni[16 * 15];
1883 unsigned num_rounds;
1896#ifndef BR_DOXYGEN_IGNORE
1898 unsigned char skni[16 * 15];
1900 unsigned num_rounds;
1914#ifndef BR_DOXYGEN_IGNORE
1916 unsigned char skni[16 * 15];
1918 unsigned num_rounds;
1932#ifndef BR_DOXYGEN_IGNORE
1934 unsigned char skni[16 * 15];
1936 unsigned num_rounds;
1987 const void *key,
size_t len);
1998 const void *key,
size_t len);
2009 const void *key,
size_t len);
2020 const void *key,
size_t len);
2031 void *data,
size_t len);
2042 void *data,
size_t len);
2055 const void *iv, uint32_t cc,
void *data,
size_t len);
2067 void *ctr,
void *cbcmac,
void *data,
size_t len);
2079 void *ctr,
void *cbcmac,
void *data,
size_t len);
2090 void *ctr,
void *data,
size_t len);
2101 void *cbcmac,
const void *data,
size_t len);
2216#define br_des_tab_BLOCK_SIZE 8
2227#ifndef BR_DOXYGEN_IGNORE
2229 unsigned num_rounds;
2242#ifndef BR_DOXYGEN_IGNORE
2244 unsigned num_rounds;
2267 const void *key,
size_t len);
2278 const void *key,
size_t len);
2289 void *data,
size_t len);
2300 void *data,
size_t len);
2308#define br_des_ct_BLOCK_SIZE 8
2319#ifndef BR_DOXYGEN_IGNORE
2321 unsigned num_rounds;
2334#ifndef BR_DOXYGEN_IGNORE
2336 unsigned num_rounds;
2359 const void *key,
size_t len);
2370 const void *key,
size_t len);
2381 void *data,
size_t len);
2392 void *data,
size_t len);
2443 const void *iv, uint32_t cc,
void *data,
size_t len);
2457 const void *iv, uint32_t cc,
void *data,
size_t len);
2478 const void *iv, uint32_t cc,
void *data,
size_t len);
2514 void *data,
size_t len,
const void *aad,
size_t aad_len,
2533 void *data,
size_t len,
const void *aad,
size_t aad_len,
2552 void *data,
size_t len,
const void *aad,
size_t aad_len,
2577 void *data,
size_t len,
const void *aad,
size_t aad_len,
2601 void *data,
size_t len,
const void *aad,
size_t aad_len,
Context for AES subkeys (aes_big implementation, CBC decryption).
Definition bearssl_block.h:724
const br_block_cbcdec_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:726
Context for AES subkeys (aes_big implementation, CBC encryption).
Definition bearssl_block.h:709
const br_block_cbcenc_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:711
Context for AES subkeys (aes_big implementation, CTR encryption and decryption).
Definition bearssl_block.h:740
const br_block_ctr_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:742
Context for AES subkeys (aes_big implementation, CTR encryption and decryption + CBC-MAC).
Definition bearssl_block.h:756
const br_block_ctrcbc_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:758
Context for AES subkeys (aes_ct64 implementation, CBC decryption).
Definition bearssl_block.h:1384
const br_block_cbcdec_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1386
Context for AES subkeys (aes_ct64 implementation, CBC encryption).
Definition bearssl_block.h:1369
const br_block_cbcenc_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1371
Context for AES subkeys (aes_ct64 implementation, CTR encryption and decryption).
Definition bearssl_block.h:1400
const br_block_ctr_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1402
Context for AES subkeys (aes_ct64 implementation, CTR encryption and decryption + CBC-MAC).
Definition bearssl_block.h:1416
const br_block_ctrcbc_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1418
Context for AES subkeys (aes_ct implementation, CBC decryption).
Definition bearssl_block.h:1163
const br_block_cbcdec_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1165
Context for AES subkeys (aes_ct implementation, CBC encryption).
Definition bearssl_block.h:1148
const br_block_cbcenc_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1150
Context for AES subkeys (aes_ct implementation, CTR encryption and decryption).
Definition bearssl_block.h:1179
const br_block_ctr_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1181
Context for AES subkeys (aes_ct implementation, CTR encryption and decryption + CBC-MAC).
Definition bearssl_block.h:1195
const br_block_ctrcbc_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1197
Context for AES subkeys (aes_pwr8 implementation, CBC decryption).
Definition bearssl_block.h:1893
const br_block_cbcdec_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1895
Context for AES subkeys (aes_pwr8 implementation, CBC encryption).
Definition bearssl_block.h:1876
const br_block_cbcenc_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1878
Context for AES subkeys (aes_pwr8 implementation, CTR encryption and decryption).
Definition bearssl_block.h:1911
const br_block_ctr_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1913
Context for AES subkeys (aes_pwr8 implementation, CTR encryption and decryption + CBC-MAC).
Definition bearssl_block.h:1929
const br_block_ctrcbc_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1931
Context for AES subkeys (aes_small implementation, CBC decryption).
Definition bearssl_block.h:944
const br_block_cbcdec_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:946
Context for AES subkeys (aes_small implementation, CBC encryption).
Definition bearssl_block.h:929
const br_block_cbcenc_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:931
Context for AES subkeys (aes_small implementation, CTR encryption and decryption).
Definition bearssl_block.h:960
const br_block_ctr_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:962
Context for AES subkeys (aes_small implementation, CTR encryption and decryption + CBC-MAC).
Definition bearssl_block.h:976
const br_block_ctrcbc_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:978
Context for AES subkeys (aes_x86ni implementation, CBC decryption).
Definition bearssl_block.h:1602
const br_block_cbcdec_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1604
Context for AES subkeys (aes_x86ni implementation, CBC encryption).
Definition bearssl_block.h:1585
const br_block_cbcenc_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1587
Context for AES subkeys (aes_x86ni implementation, CTR encryption and decryption).
Definition bearssl_block.h:1620
const br_block_ctr_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1622
Context for AES subkeys (aes_x86ni implementation, CTR encryption and decryption + CBC-MAC).
Definition bearssl_block.h:1638
const br_block_ctrcbc_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:1640
Class type for CBC decryption implementations.
Definition bearssl_block.h:450
unsigned log_block_size
Base-2 logarithm of the size of individual blocks, expressed in bytes.
Definition bearssl_block.h:466
void(* run)(const br_block_cbcdec_class *const *ctx, void *iv, void *data, size_t len)
Run the CBC decryption.
Definition bearssl_block.h:495
size_t context_size
Size (in bytes) of the context structure appropriate for containing subkeys.
Definition bearssl_block.h:455
unsigned block_size
Size of individual blocks (in bytes).
Definition bearssl_block.h:460
void(* init)(const br_block_cbcdec_class **ctx, const void *key, size_t key_len)
Initialisation function.
Definition bearssl_block.h:479
Class type for CBC encryption implementations.
Definition bearssl_block.h:394
size_t context_size
Size (in bytes) of the context structure appropriate for containing subkeys.
Definition bearssl_block.h:399
unsigned log_block_size
Base-2 logarithm of the size of individual blocks, expressed in bytes.
Definition bearssl_block.h:410
void(* init)(const br_block_cbcenc_class **ctx, const void *key, size_t key_len)
Initialisation function.
Definition bearssl_block.h:423
void(* run)(const br_block_cbcenc_class *const *ctx, void *iv, void *data, size_t len)
Run the CBC encryption.
Definition bearssl_block.h:439
unsigned block_size
Size of individual blocks (in bytes).
Definition bearssl_block.h:404
Class type for CTR encryption/decryption implementations.
Definition bearssl_block.h:507
unsigned block_size
Size of individual blocks (in bytes).
Definition bearssl_block.h:517
unsigned log_block_size
Base-2 logarithm of the size of individual blocks, expressed in bytes.
Definition bearssl_block.h:523
size_t context_size
Size (in bytes) of the context structure appropriate for containing subkeys.
Definition bearssl_block.h:512
void(* init)(const br_block_ctr_class **ctx, const void *key, size_t key_len)
Initialisation function.
Definition bearssl_block.h:536
uint32_t(* run)(const br_block_ctr_class *const *ctx, const void *iv, uint32_t cc, void *data, size_t len)
Run the CTR encryption or decryption.
Definition bearssl_block.h:562
Class type for combined CTR and CBC-MAC implementations.
Definition bearssl_block.h:574
size_t context_size
Size (in bytes) of the context structure appropriate for containing subkeys.
Definition bearssl_block.h:579
unsigned log_block_size
Base-2 logarithm of the size of individual blocks, expressed in bytes.
Definition bearssl_block.h:590
void(* mac)(const br_block_ctrcbc_class *const *ctx, void *cbcmac, const void *data, size_t len)
Run the CBC-MAC only.
Definition bearssl_block.h:688
void(* encrypt)(const br_block_ctrcbc_class *const *ctx, void *ctr, void *cbcmac, void *data, size_t len)
Run the CTR encryption + CBC-MAC.
Definition bearssl_block.h:627
unsigned block_size
Size of individual blocks (in bytes).
Definition bearssl_block.h:584
void(* ctr)(const br_block_ctrcbc_class *const *ctx, void *ctr, void *data, size_t len)
Run the CTR encryption/decryption only.
Definition bearssl_block.h:669
void(* decrypt)(const br_block_ctrcbc_class *const *ctx, void *ctr, void *cbcmac, void *data, size_t len)
Run the CTR decryption + CBC-MAC.
Definition bearssl_block.h:651
void(* init)(const br_block_ctrcbc_class **ctx, const void *key, size_t key_len)
Initialisation function.
Definition bearssl_block.h:603
Context for DES subkeys (des_ct implementation, CBC decryption).
Definition bearssl_block.h:2331
const br_block_cbcdec_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:2333
Context for DES subkeys (des_ct implementation, CBC encryption).
Definition bearssl_block.h:2316
const br_block_cbcenc_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:2318
Context for DES subkeys (des_tab implementation, CBC decryption).
Definition bearssl_block.h:2239
const br_block_cbcdec_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:2241
Context for DES subkeys (des_tab implementation, CBC encryption).
Definition bearssl_block.h:2224
const br_block_cbcenc_class * vtable
Pointer to vtable for this context.
Definition bearssl_block.h:2226
Aggregate structure large enough to be used as context for subkeys (CBC decryption) for all AES imple...
Definition bearssl_block.h:2172
br_aes_pwr8_cbcdec_keys c_pwr8
Definition bearssl_block.h:2179
br_aes_ct64_cbcdec_keys c_ct64
Definition bearssl_block.h:2177
br_aes_x86ni_cbcdec_keys c_x86ni
Definition bearssl_block.h:2178
br_aes_small_cbcdec_keys c_small
Definition bearssl_block.h:2175
br_aes_big_cbcdec_keys c_big
Definition bearssl_block.h:2174
br_aes_ct_cbcdec_keys c_ct
Definition bearssl_block.h:2176
const br_block_cbcdec_class * vtable
Definition bearssl_block.h:2173
Aggregate structure large enough to be used as context for subkeys (CBC encryption) for all AES imple...
Definition bearssl_block.h:2158
br_aes_pwr8_cbcenc_keys c_pwr8
Definition bearssl_block.h:2165
const br_block_cbcenc_class * vtable
Definition bearssl_block.h:2159
br_aes_big_cbcenc_keys c_big
Definition bearssl_block.h:2160
br_aes_x86ni_cbcenc_keys c_x86ni
Definition bearssl_block.h:2164
br_aes_ct64_cbcenc_keys c_ct64
Definition bearssl_block.h:2163
br_aes_small_cbcenc_keys c_small
Definition bearssl_block.h:2161
br_aes_ct_cbcenc_keys c_ct
Definition bearssl_block.h:2162
Aggregate structure large enough to be used as context for subkeys (CTR encryption and decryption) fo...
Definition bearssl_block.h:2186
br_aes_big_ctr_keys c_big
Definition bearssl_block.h:2188
br_aes_small_ctr_keys c_small
Definition bearssl_block.h:2189
br_aes_ct_ctr_keys c_ct
Definition bearssl_block.h:2190
br_aes_ct64_ctr_keys c_ct64
Definition bearssl_block.h:2191
br_aes_pwr8_ctr_keys c_pwr8
Definition bearssl_block.h:2193
const br_block_ctr_class * vtable
Definition bearssl_block.h:2187
br_aes_x86ni_ctr_keys c_x86ni
Definition bearssl_block.h:2192
Aggregate structure large enough to be used as context for subkeys (CTR encryption/decryption + CBC-M...
Definition bearssl_block.h:2200
br_aes_x86ni_ctrcbc_keys c_x86ni
Definition bearssl_block.h:2206
br_aes_ct_ctrcbc_keys c_ct
Definition bearssl_block.h:2204
br_aes_big_ctrcbc_keys c_big
Definition bearssl_block.h:2202
br_aes_small_ctrcbc_keys c_small
Definition bearssl_block.h:2203
br_aes_pwr8_ctrcbc_keys c_pwr8
Definition bearssl_block.h:2207
br_aes_ct64_ctrcbc_keys c_ct64
Definition bearssl_block.h:2205
const br_block_ctrcbc_class * vtable
Definition bearssl_block.h:2201
Aggregate structure large enough to be used as context for subkeys (CBC decryption) for all DES imple...
Definition bearssl_block.h:2413
const br_block_cbcdec_class * vtable
Definition bearssl_block.h:2414
br_des_tab_cbcdec_keys c_tab
Definition bearssl_block.h:2415
br_des_ct_cbcdec_keys c_ct
Definition bearssl_block.h:2416
Aggregate structure large enough to be used as context for subkeys (CBC encryption) for all DES imple...
Definition bearssl_block.h:2403
const br_block_cbcenc_class * vtable
Definition bearssl_block.h:2404
br_des_ct_cbcenc_keys ct
Definition bearssl_block.h:2406
br_des_tab_cbcenc_keys tab
Definition bearssl_block.h:2405