Go to the source code of this file.
Macros | |
| #define | IMPLEMENT(x) |
| #define | INCREASE_SECURITY 0 |
| #define | AVOID_FUNCTION_CALL 0 |
| #define | SMALL_CIPHER 0 |
| #define | SBoxValue(x) |
| #define | InvSBoxValue(x) |
| #define | COPYDWORD(x, y) |
| #define | XOR32BITS(x, y) |
| #define | XOR64BITS(x, y) |
| #define | AES_setkey(key) |
| #define | BURN(key) |
| #define | SABOTAGE(buf, len) |
| #define | memcmp_s memcmp |
| #define | IV_KWA "\xA6\xA6\xA6\xA6\xA6\xA6\xA6\xA6" |
| #define | ALPHABET "0123456789" |
| #define | RADIX 10 |
| #define | LOGRDX 3.32192809488736 |
| #define | MINLEN 6 |
| #define | MAXLEN 56 |
| #define | FPE_PERMUTE FF1_cipher |
| #define | TWEAK_PARAMS uint8_t* tweak, const size_t tweakLen |
| #define | TWEAK_AGRS tweak, tweakLen |
Typedefs | |
| typedef uint8_t | block_t[BLOCKSIZE] |
| typedef uint8_t | state_t[Nb][4] |
| typedef void(*) | fmix_t(const block_t, block_t) |
| typedef char | alpha_t |
| typedef unsigned short | radix_t |
Enumerations | |
| enum | basic_constants { BLOCKSIZE = 128 / 8 , KEYSIZE = AES_KEYLENGTH , Nb = BLOCKSIZE / 4 , Nk = KEYSIZE / 4 , ROUNDS = Nk + 6 , HB = BLOCKSIZE / 2 , LAST = BLOCKSIZE - 1 , MIDST = LAST / 2 , PL = BLOCKSIZE + 1 } |
| enum | ctr_based_modes { CTR_DEFAULT , SIV_CTR = 'S' , SIVGCM_CTR = 'S' & 'G' , CCM_GCM = 'C' | 'G' } |
Functions | |
| static uint8_t | xtime (uint8_t x) |
| static void | xorBlock (const block_t src, block_t dest) |
| static uint8_t | mixG8 (uint8_t a, uint8_t b, uint8_t c, uint8_t d) |
| static void | KeyExpansion (const uint8_t *key) |
| static void | AddRoundKey (const uint8_t round, block_t state) |
| static void | SubBytes (block_t state) |
| static void | ShiftRows (state_t state) |
| static void | MixColumns (state_t state) |
| static void | rijndaelEncrypt (const block_t input, block_t output) |
| static void | InvSubBytes (block_t state) |
| static void | InvShiftRows (state_t state) |
| static void | InvMixColumns (state_t state) |
| static void | rijndaelDecrypt (const block_t input, block_t output) |
| static void | xorBEint (uint8_t *buff, size_t num, uint8_t pos) |
| static void | incBlock (block_t block, uint8_t index) |
| static void | doubleBblock (block_t array) |
| static void | doubleLblock (block_t array) |
| static void | divideBblock (block_t array) |
| static void | mulGF128 (const block_t x, block_t y) |
| static void | divideLblock (block_t array) |
| static void | dotGF128 (const block_t x, block_t y) |
| static void | mixThenXor (fmix_t mix, const block_t B, block_t f, const uint8_t *X, uint8_t n, uint8_t *Y) |
| static void | xMac (const void *data, const size_t dataSize, const block_t seed, fmix_t mix, block_t result) |
| static void | cMac (const block_t K1, const block_t K2, const void *data, const size_t dataSize, block_t mac) |
| static void | getSubkeys (fdouble_t gfdouble, const char quad, const uint8_t *key, block_t D, block_t Q) |
| static char | padBlock (const uint8_t len, block_t block) |
| void | SPP_EXTERNAL_ENCRYPTION_ecbEncrypt (const uint8_t *key, const void *pntxt, const size_t ptextLen, void *crtxt) |
| encrypt the input plaintext using ECB-AES block-cipher method | |
| char | SPP_EXTERNAL_ENCRYPTION_ecbDecrypt (const uint8_t *key, const void *crtxt, const size_t crtxtLen, void *pntxt) |
| decrypt the input ciphertext using ECB-AES block-cipher method | |
| char | SPP_EXTERNAL_ENCRYPTION_cbcEncrypt (const uint8_t *key, const block_t iVec, const void *pntxt, const size_t ptextLen, void *crtxt) |
| encrypt the input plaintext using CBC-AES block-cipher method | |
| char | SPP_EXTERNAL_ENCRYPTION_cbcDecrypt (const uint8_t *key, const block_t iVec, const void *crtxt, const size_t crtxtLen, void *pntxt) |
| decrypt the input ciphertext using CBC-AES block-cipher method | |
| static void | CFB_cipher (const uint8_t *key, const block_t iVec, const char mode, const void *input, const size_t dataSize, void *output) |
| the general scheme of CFB-AES block-ciphering algorithm | |
| void | SPP_EXTERNAL_ENCRYPTION_cfbEncrypt (const uint8_t *key, const block_t iVec, const void *pntxt, const size_t ptextLen, void *crtxt) |
| encrypt the input plaintext using CFB-AES block-cipher method | |
| void | SPP_EXTERNAL_ENCRYPTION_cfbDecrypt (const uint8_t *key, const block_t iVec, const void *crtxt, const size_t crtxtLen, void *pntxt) |
| decrypt the input ciphertext using CFB-AES block-cipher method | |
| void | SPP_EXTERNAL_ENCRYPTION_ofbEncrypt (const uint8_t *key, const block_t iVec, const void *pntxt, const size_t ptextLen, void *crtxt) |
| encrypt the input plaintext using OFB-AES block-cipher method | |
| void | SPP_EXTERNAL_ENCRYPTION_ofbDecrypt (const uint8_t *key, const block_t iVec, const void *crtxt, const size_t crtxtLen, void *pntxt) |
| decrypt the input ciphertext using OFB-AES block-cipher method | |
| static void | CTR_cipher (const block_t iCtr, const char mode, const void *input, const size_t dataSize, void *output) |
| the general scheme of operation in block-counter mode | |
| void | SPP_EXTERNAL_ENCRYPTION_ctrEncrypt (const uint8_t *key, const uint8_t *iv, const void *pntxt, const size_t ptextLen, void *crtxt) |
| encrypt the input plaintext using CTR-AES block-cipher method | |
| void | SPP_EXTERNAL_ENCRYPTION_ctrDecrypt (const uint8_t *key, const uint8_t *iv, const void *crtxt, const size_t crtxtLen, void *pntxt) |
| decrypt the input ciphertext using CTR-AES block-cipher method | |
| static char | XTS_cipher (const uint8_t *keypair, const char mode, const block_t tweak, const size_t sectid, const size_t dataSize, void *storage) |
| encrypt or decrypt a data unit with XTS method | |
| char | SPP_EXTERNAL_ENCRYPTION_xtsEncrypt (const uint8_t *keys, const uint8_t *tweak, const void *pntxt, const size_t ptextLen, void *crtxt) |
| encrypt the input plaintext using XTS-AES block-cipher method | |
| char | SPP_EXTERNAL_ENCRYPTION_xtsDecrypt (const uint8_t *keys, const uint8_t *tweak, const void *crtxt, const size_t crtxtLen, void *pntxt) |
| encrypt the input ciphertext using XTS-AES block-cipher method | |
| void | SPP_EXTERNAL_ENCRYPTION_cmac (const uint8_t *key, const void *data, const size_t dataSize, block_t mac) |
| derive the AES-CMAC of input data using an encryption key | |
| static void | gHash (const block_t H, const void *aData, const void *crtxt, const size_t aDataLen, const size_t crtxtLen, block_t gh) |
| static void | GCMsetup (const uint8_t *key, const uint8_t *nonce, block_t auKey, block_t iv) |
| void | SPP_EXTERNAL_ENCRYPTION_gcmEncrypt (const uint8_t *key, const uint8_t *nonce, const void *aData, const size_t aDataLen, const void *pntxt, const size_t ptextLen, void *crtxt) |
| encrypt the input plaintext using GCM-AES block-cipher method | |
| char | SPP_EXTERNAL_ENCRYPTION_gcmDecrypt (const uint8_t *key, const uint8_t *nonce, const void *aData, const size_t aDataLen, const void *crtxt, const size_t crtxtLen, void *pntxt) |
| decrypt the input ciphertext using GCM-AES block-cipher method | |
| static void | CCMtag (const block_t iv, const void *aData, const void *pntxt, const size_t aDataLen, const size_t ptextLen, block_t M) |
| void | SPP_EXTERNAL_ENCRYPTION_ccmEncrypt (const uint8_t *key, const uint8_t *nonce, const void *aData, const size_t aDataLen, const void *pntxt, const size_t ptextLen, void *crtxt) |
| encrypt the input plaintext using CCM-AES block-cipher method | |
| char | SPP_EXTERNAL_ENCRYPTION_ccmDecrypt (const uint8_t *key, const uint8_t *nonce, const void *aData, const size_t aDataLen, const void *crtxt, const size_t crtxtLen, void *pntxt) |
| decrypt the input ciphertext using CCM-AES block-cipher method | |
| static void | S2V (const uint8_t *key, const void *aData, const void *pntxt, const size_t aDataLen, const size_t ptextLen, block_t IV) |
| void | SPP_EXTERNAL_ENCRYPTION_sivEncrypt (const uint8_t *keys, const void *aData, const size_t aDataLen, const void *pntxt, const size_t ptextLen, block_t iv, void *crtxt) |
| encrypt the input plaintext using SIV-AES block-cipher method | |
| char | SPP_EXTERNAL_ENCRYPTION_sivDecrypt (const uint8_t *keys, const block_t iv, const void *aData, const size_t aDataLen, const void *crtxt, const size_t crtxtLen, void *pntxt) |
| decrypt the input ciphertext using SIV-AES block-cipher method | |
| static void | polyval (const block_t H, const void *aData, const void *pntxt, const size_t aDataLen, const size_t ptextLen, block_t pv) |
| static void | GCM_SIVsetup (const uint8_t *key, const uint8_t *nonce, block_t AK) |
| static void | GCM_SIVtag (const uint8_t *nonce, block_t pv, block_t tag) |
| void | SPP_EXTERNAL_ENCRYPTION_gcmSivEncrypt (const uint8_t *key, const uint8_t *nonce, const void *aData, const size_t aDataLen, const void *pntxt, const size_t ptextLen, void *crtxt) |
| encrypt the input plaintext using SIV-GCM-AES block-cipher method | |
| char | SPP_EXTERNAL_ENCRYPTION_gcmSivDecrypt (const uint8_t *key, const uint8_t *nonce, const void *aData, const size_t aDataLen, const void *crtxt, const size_t crtxtLen, void *pntxt) |
| decrypt the input ciphertext using SIV-GCM-AES block-cipher method | |
| static void | oMac (const uint8_t indx, const block_t D, const block_t Q, const void *data, const size_t dataSize, block_t mac) |
| void | SPP_EXTERNAL_ENCRYPTION_eaxEncrypt (const uint8_t *key, const uint8_t *nonce, const void *aData, const size_t aDataLen, const void *pntxt, const size_t ptextLen, void *crtxt) |
| encrypt the input plaintext using EAX-AES block-cipher method | |
| char | SPP_EXTERNAL_ENCRYPTION_eaxDecrypt (const uint8_t *key, const uint8_t *nonce, const void *aData, const size_t aDataLen, const void *crtxt, const size_t crtxtLen, void *pntxt) |
| decrypt the input ciphertext using EAX-AES block-cipher method | |
| static void | nop (const block_t x, block_t y) |
| static void | getDelta (const count_t index, const block_t Ld, const block_t delta0, block_t delta) |
| static void | OCB_cipher (const uint8_t *key, const uint8_t *nonce, const size_t ptextLen, const size_t aDataLen, const size_t dataSize, const void *aData, void *data, block_t tag) |
| encrypt or decrypt the data using OCB method | |
| void | SPP_EXTERNAL_ENCRYPTION_ocbEncrypt (const uint8_t *key, const uint8_t *nonce, const void *aData, const size_t aDataLen, const void *pntxt, const size_t ptextLen, void *crtxt) |
| encrypt the input stream using OCB-AES block-cipher method | |
| char | SPP_EXTERNAL_ENCRYPTION_ocbDecrypt (const uint8_t *key, const uint8_t *nonce, const void *aData, const size_t aDataLen, const void *crtxt, const size_t crtxtLen, void *pntxt) |
| decrypt the input stream using OCB-AES block-cipher method | |
| char | SPP_EXTERNAL_ENCRYPTION_keyWrap (const uint8_t *kek, const void *secret, const size_t secretLen, void *wrapped) |
| encrypt the input secret with key-wrapping method | |
| char | SPP_EXTERNAL_ENCRYPTION_keyUnwrap (const uint8_t *kek, const void *wrapped, const size_t wrapLen, void *secret) |
| unwrap/decrypt a wrapped secret according to RFC-3394 | |
| static void | addLblocks (const uint8_t *x, const uint8_t len, uint8_t *y) |
| static void | modP1305 (uint8_t *block, int32_t q) |
| static void | mulLblocks (const uint8_t *x, uint8_t *y) |
| void | SPP_EXTERNAL_ENCRYPTION_poly1305 (const uint8_t *keys, const block_t nonce, const void *data, const size_t dataSize, block_t mac) |
| derive the Poly1305-AES mac of message using a nonce and key pair. | |
| static void | numRadix (const radix_t *s, size_t len, uint8_t *num, size_t bytes) |
| static void | strRadix (const uint8_t *num, size_t bytes, radix_t *s, size_t len) |
| static void | addRadix (const radix_t *x, const size_t len, radix_t *y) |
| static void | subRadix (const radix_t *x, const size_t len, radix_t *y) |
| static void | FF1round (const uint8_t i, const block_t P, const size_t u, const size_t v, radix_t *C) |
| static void | FF1_cipher (const uint8_t *key, const char mode, const TWEAK_PARAMS, const size_t len, radix_t *X) |
| static char | FPE_cipher (const uint8_t *key, const char mode, const TWEAK_PARAMS, const void *input, const size_t dataSize, void *output) |
| encrypt or decrypt the input string with FPE method | |
| char | SPP_EXTERNAL_ENCRYPTION_fpeEncrypt (const uint8_t *key, const TWEAK_PARAMS, const void *pntxt, const size_t ptextLen, void *crtxt) |
| encrypt the input string using FPE-AES block-cipher method | |
| char | SPP_EXTERNAL_ENCRYPTION_fpeDecrypt (const uint8_t *key, const TWEAK_PARAMS, const void *crtxt, const size_t crtxtLen, void *pntxt) |
| decrypt a ciphertext string using FPE-AES block-cipher method | |
Variables | |
| static const char | sbox [256] |
| static const char | rsbox [256] |
| static uint8_t | RoundKey [BLOCKSIZE *ROUNDS+KEYSIZE] |
| static size_t | b1 |
| #define IMPLEMENT | ( | x | ) |
Definition at line 29 of file encryption.c.
| #define INCREASE_SECURITY 0 |
Definition at line 31 of file encryption.c.
| #define AVOID_FUNCTION_CALL 0 |
Definition at line 32 of file encryption.c.
| #define SMALL_CIPHER 0 |
Definition at line 33 of file encryption.c.
| #define SBoxValue | ( | x | ) |
Definition at line 83 of file encryption.c.
Referenced by KeyExpansion(), and SubBytes().
| #define InvSBoxValue | ( | x | ) |
| #define COPYDWORD | ( | x, | |
| y ) |
Definition at line 86 of file encryption.c.
Referenced by InvMixColumns(), MixColumns(), and SPP_EXTERNAL_ENCRYPTION_eaxEncrypt().
| #define XOR32BITS | ( | x, | |
| y ) |
Definition at line 87 of file encryption.c.
Referenced by GCM_SIVtag(), KeyExpansion(), SPP_EXTERNAL_ENCRYPTION_eaxDecrypt(), and SPP_EXTERNAL_ENCRYPTION_eaxEncrypt().
| #define XOR64BITS | ( | x, | |
| y ) |
| #define AES_setkey | ( | key | ) |
Referenced by CFB_cipher(), FF1_cipher(), GCM_SIVsetup(), GCMsetup(), getSubkeys(), SPP_EXTERNAL_ENCRYPTION_cbcDecrypt(), SPP_EXTERNAL_ENCRYPTION_cbcEncrypt(), SPP_EXTERNAL_ENCRYPTION_ccmDecrypt(), SPP_EXTERNAL_ENCRYPTION_ccmEncrypt(), SPP_EXTERNAL_ENCRYPTION_ctrEncrypt(), SPP_EXTERNAL_ENCRYPTION_ecbDecrypt(), SPP_EXTERNAL_ENCRYPTION_ecbEncrypt(), SPP_EXTERNAL_ENCRYPTION_keyUnwrap(), SPP_EXTERNAL_ENCRYPTION_keyWrap(), SPP_EXTERNAL_ENCRYPTION_ofbEncrypt(), SPP_EXTERNAL_ENCRYPTION_poly1305(), SPP_EXTERNAL_ENCRYPTION_sivDecrypt(), SPP_EXTERNAL_ENCRYPTION_sivEncrypt(), and XTS_cipher().
| #define BURN | ( | key | ) |
Referenced by CFB_cipher(), FPE_cipher(), OCB_cipher(), SPP_EXTERNAL_ENCRYPTION_cbcDecrypt(), SPP_EXTERNAL_ENCRYPTION_cbcEncrypt(), SPP_EXTERNAL_ENCRYPTION_ccmDecrypt(), SPP_EXTERNAL_ENCRYPTION_ccmEncrypt(), SPP_EXTERNAL_ENCRYPTION_cmac(), SPP_EXTERNAL_ENCRYPTION_ctrEncrypt(), SPP_EXTERNAL_ENCRYPTION_eaxDecrypt(), SPP_EXTERNAL_ENCRYPTION_eaxEncrypt(), SPP_EXTERNAL_ENCRYPTION_ecbDecrypt(), SPP_EXTERNAL_ENCRYPTION_ecbEncrypt(), SPP_EXTERNAL_ENCRYPTION_gcmDecrypt(), SPP_EXTERNAL_ENCRYPTION_gcmEncrypt(), SPP_EXTERNAL_ENCRYPTION_gcmSivDecrypt(), SPP_EXTERNAL_ENCRYPTION_gcmSivEncrypt(), SPP_EXTERNAL_ENCRYPTION_keyUnwrap(), SPP_EXTERNAL_ENCRYPTION_keyWrap(), SPP_EXTERNAL_ENCRYPTION_ofbEncrypt(), SPP_EXTERNAL_ENCRYPTION_poly1305(), SPP_EXTERNAL_ENCRYPTION_sivDecrypt(), SPP_EXTERNAL_ENCRYPTION_sivEncrypt(), and XTS_cipher().
| #define SABOTAGE | ( | buf, | |
| len ) |
| #define memcmp_s memcmp |
| #define IV_KWA "\xA6\xA6\xA6\xA6\xA6\xA6\xA6\xA6" |
Definition at line 1820 of file encryption.c.
Referenced by SPP_EXTERNAL_ENCRYPTION_keyUnwrap(), and SPP_EXTERNAL_ENCRYPTION_keyWrap().
| #define ALPHABET "0123456789" |
Definition at line 2009 of file encryption.c.
Referenced by FPE_cipher().
| #define RADIX 10 |
Definition at line 2010 of file encryption.c.
Referenced by addRadix(), FF1_cipher(), FPE_cipher(), numRadix(), strRadix(), and subRadix().
| #define LOGRDX 3.32192809488736 |
Definition at line 2011 of file encryption.c.
Referenced by FPE_cipher().
| #define MINLEN 6 |
Definition at line 2012 of file encryption.c.
Referenced by FPE_cipher().
| #define MAXLEN 56 |
Definition at line 2013 of file encryption.c.
Referenced by FPE_cipher().
| #define FPE_PERMUTE FF1_cipher |
Definition at line 2033 of file encryption.c.
Referenced by FPE_cipher().
| #define TWEAK_PARAMS uint8_t* tweak, const size_t tweakLen |
Definition at line 2034 of file encryption.c.
Referenced by FF1_cipher(), FPE_cipher(), SPP_EXTERNAL_ENCRYPTION_fpeDecrypt(), and SPP_EXTERNAL_ENCRYPTION_fpeEncrypt().
| #define TWEAK_AGRS tweak, tweakLen |
Definition at line 2035 of file encryption.c.
Referenced by FPE_cipher(), SPP_EXTERNAL_ENCRYPTION_fpeDecrypt(), and SPP_EXTERNAL_ENCRYPTION_fpeEncrypt().
| typedef uint8_t block_t[BLOCKSIZE] |
block_t indicates fixed-size memory blocks, and state_t represents the state matrix. note that state[i][j] means the i-th COLUMN and j-th ROW of matrix
Definition at line 76 of file encryption.c.
| typedef uint8_t state_t[Nb][4] |
Definition at line 77 of file encryption.c.
function-pointer types, indicating functions that take fixed-size blocks:
Definition at line 358 of file encryption.c.
| typedef char alpha_t |
Definition at line 2019 of file encryption.c.
| typedef unsigned short radix_t |
Definition at line 2025 of file encryption.c.
| enum basic_constants |
| Enumerator | |
|---|---|
| BLOCKSIZE | |
| KEYSIZE | |
| Nb | |
| Nk | |
| ROUNDS | |
| HB | |
| LAST | |
| MIDST | |
| PL | |
Definition at line 16 of file encryption.c.
| enum ctr_based_modes |
| Enumerator | |
|---|---|
| CTR_DEFAULT | |
| SIV_CTR | |
| SIVGCM_CTR | |
| CCM_GCM | |
Definition at line 906 of file encryption.c.
|
static |
doubling the value of x in Galois bit field GF(2^8) with polynomial 0x11b
Definition at line 105 of file encryption.c.
References xtime().
Referenced by MixColumns(), mixG8(), and xtime().
XOR two 128bit blocks, i.e. add two numbers in Galois bit field GF(2^128)
Definition at line 111 of file encryption.c.
References BLOCKSIZE, and xorBlock().
Referenced by AddRoundKey(), CCMtag(), CFB_cipher(), cMac(), CTR_cipher(), dotGF128(), getDelta(), mulGF128(), OCB_cipher(), S2V(), SPP_EXTERNAL_ENCRYPTION_cbcDecrypt(), SPP_EXTERNAL_ENCRYPTION_cbcEncrypt(), SPP_EXTERNAL_ENCRYPTION_eaxDecrypt(), SPP_EXTERNAL_ENCRYPTION_eaxEncrypt(), SPP_EXTERNAL_ENCRYPTION_gcmDecrypt(), SPP_EXTERNAL_ENCRYPTION_gcmEncrypt(), SPP_EXTERNAL_ENCRYPTION_ofbEncrypt(), xMac(), xorBlock(), and XTS_cipher().
|
static |
inverse multiply in 8bit GF: mul(a,14) ^ mul(b,11) ^ mul(c,13) ^ mul(d,9)
Definition at line 124 of file encryption.c.
References mixG8(), and xtime().
Referenced by InvMixColumns(), and mixG8().
|
static |
This function produces (ROUNDS+1) round keys, which are used in each round to encrypt/decrypt the intermediate states. First round key is the main key itself, and other rounds are constructed from the previous ones as follows
Definition at line 145 of file encryption.c.
References BLOCKSIZE, KeyExpansion(), KEYSIZE, Nk, RoundKey, ROUNDS, SBoxValue, and XOR32BITS.
Referenced by KeyExpansion().
|
static |
XOR the round keys with the rijndael state matrix; namely, add them in GF
Definition at line 182 of file encryption.c.
References AddRoundKey(), BLOCKSIZE, RoundKey, and xorBlock().
Referenced by AddRoundKey(), rijndaelDecrypt(), and rijndaelEncrypt().
|
static |
Substitute values in the state matrix with associated values in the S-box
Definition at line 188 of file encryption.c.
References BLOCKSIZE, SBoxValue, and SubBytes().
Referenced by rijndaelEncrypt(), and SubBytes().
|
static |
Shift/rotate the rows of the state matrix to the left. Each row is shifted with a different offset (= Row number). So the "zeroth" row is not shifted
Definition at line 199 of file encryption.c.
References ShiftRows().
Referenced by rijndaelEncrypt(), and ShiftRows().
|
static |
Use matrix multiplication in Galois field to mix the columns of the state
Definition at line 222 of file encryption.c.
References COPYDWORD, MixColumns(), Nb, and xtime().
Referenced by MixColumns(), and rijndaelEncrypt().
Encrypt a plaintext input block and save the result/ciphertext as output.
Definition at line 243 of file encryption.c.
References AddRoundKey(), BLOCKSIZE, MixColumns(), rijndaelEncrypt(), ROUNDS, ShiftRows(), and SubBytes().
Referenced by CCMtag(), CFB_cipher(), cMac(), CTR_cipher(), FF1_cipher(), FF1round(), GCM_SIVsetup(), GCM_SIVtag(), GCMsetup(), getSubkeys(), OCB_cipher(), oMac(), rijndaelEncrypt(), S2V(), SPP_EXTERNAL_ENCRYPTION_cbcEncrypt(), SPP_EXTERNAL_ENCRYPTION_ecbEncrypt(), SPP_EXTERNAL_ENCRYPTION_gcmDecrypt(), SPP_EXTERNAL_ENCRYPTION_gcmEncrypt(), SPP_EXTERNAL_ENCRYPTION_keyWrap(), SPP_EXTERNAL_ENCRYPTION_ofbEncrypt(), SPP_EXTERNAL_ENCRYPTION_poly1305(), and XTS_cipher().
|
static |
Substitutes the values in state matrix with values of the inverted S-box.
Definition at line 269 of file encryption.c.
References BLOCKSIZE, InvSBoxValue, and InvSubBytes().
Referenced by InvSubBytes(), and rijndaelDecrypt().
|
static |
This function shifts (i.e rotates) the rows of the state matrix to right.
Definition at line 279 of file encryption.c.
References InvShiftRows().
Referenced by InvShiftRows(), and rijndaelDecrypt().
|
static |
Reverse the process of mixing columns by matrix multiplication in GF(2^8)
Definition at line 302 of file encryption.c.
References COPYDWORD, InvMixColumns(), mixG8(), and Nb.
Referenced by InvMixColumns(), and rijndaelDecrypt().
Decrypt a ciphertext input block and save the result/plaintext to output.
Definition at line 316 of file encryption.c.
References AddRoundKey(), BLOCKSIZE, InvMixColumns(), InvShiftRows(), InvSubBytes(), rijndaelDecrypt(), and ROUNDS.
Referenced by OCB_cipher(), rijndaelDecrypt(), SPP_EXTERNAL_ENCRYPTION_cbcDecrypt(), SPP_EXTERNAL_ENCRYPTION_ecbDecrypt(), SPP_EXTERNAL_ENCRYPTION_keyUnwrap(), and XTS_cipher().
|
static |
xor a byte array with a big-endian integer, whose LSB is at specified pos
Definition at line 412 of file encryption.c.
References xorBEint().
Referenced by CCMtag(), FF1_cipher(), FF1round(), gHash(), SPP_EXTERNAL_ENCRYPTION_ctrEncrypt(), SPP_EXTERNAL_ENCRYPTION_keyUnwrap(), SPP_EXTERNAL_ENCRYPTION_keyWrap(), and xorBEint().
|
static |
increment the value of a 128-bit counter block, regarding its endian-ness
Definition at line 423 of file encryption.c.
References HB, and incBlock().
Referenced by CTR_cipher(), and incBlock().
|
static |
Multiply a block by two in Galois bit field GF(2^128): big-endian version
Definition at line 436 of file encryption.c.
References BLOCKSIZE, doubleBblock(), and LAST.
Referenced by doubleBblock(), getDelta(), OCB_cipher(), S2V(), SPP_EXTERNAL_ENCRYPTION_cmac(), SPP_EXTERNAL_ENCRYPTION_eaxDecrypt(), and SPP_EXTERNAL_ENCRYPTION_eaxEncrypt().
|
static |
Multiply a block by two in Galois field GF(2^128): little-endian version.
Definition at line 451 of file encryption.c.
References doubleLblock().
Referenced by doubleLblock(), SPP_EXTERNAL_ENCRYPTION_eaxDecrypt(), SPP_EXTERNAL_ENCRYPTION_eaxEncrypt(), and XTS_cipher().
|
static |
Divide a 128-bit big-endian integer by two in Galois bit field GF(2^128).
Definition at line 466 of file encryption.c.
References BLOCKSIZE, and divideBblock().
Referenced by divideBblock(), and mulGF128().
Multiply two 128-bit numbers (big-endian blocks) in the Galois bit field.
Definition at line 478 of file encryption.c.
References BLOCKSIZE, divideBblock(), mulGF128(), and xorBlock().
Referenced by gHash(), and mulGF128().
|
static |
Divide a block by two in 128-bit Galois field: the little-endian version.
Definition at line 501 of file encryption.c.
References BLOCKSIZE, divideLblock(), and LAST.
Referenced by divideLblock(), and dotGF128().
The so-called "dot multiplying" in GF(2^128), used in POLYVAL calculation
Definition at line 513 of file encryption.c.
References BLOCKSIZE, divideLblock(), dotGF128(), and xorBlock().
Referenced by dotGF128(), and polyval().
|
static |
mix/cipher the block B and then xor the result with n bytes of X to get Y
Definition at line 536 of file encryption.c.
References mixThenXor().
Referenced by CFB_cipher(), CTR_cipher(), mixThenXor(), OCB_cipher(), SPP_EXTERNAL_ENCRYPTION_cbcDecrypt(), and SPP_EXTERNAL_ENCRYPTION_ofbEncrypt().
|
static |
xor the result with input data and then apply the digest/mixing function. repeat this process for each block of data, until all blocks are digested.
Definition at line 554 of file encryption.c.
References BLOCKSIZE, xMac(), and xorBlock().
Referenced by CCMtag(), cMac(), FF1_cipher(), FF1round(), gHash(), OCB_cipher(), polyval(), and xMac().
|
static |
calculate CMAC of input data using pre-calculated keys: K1 (D) and K2 (Q)
Definition at line 579 of file encryption.c.
References BLOCKSIZE, cMac(), rijndaelEncrypt(), xMac(), and xorBlock().
Referenced by cMac(), OCB_cipher(), oMac(), S2V(), and SPP_EXTERNAL_ENCRYPTION_cmac().
|
static |
calculate key-dependent constants D and Q using a given doubling function
Definition at line 596 of file encryption.c.
References AES_setkey, BLOCKSIZE, getSubkeys(), and rijndaelEncrypt().
Referenced by getSubkeys(), OCB_cipher(), S2V(), SPP_EXTERNAL_ENCRYPTION_cmac(), SPP_EXTERNAL_ENCRYPTION_eaxDecrypt(), and SPP_EXTERNAL_ENCRYPTION_eaxEncrypt().
|
static |
in ECB mode & CBC without CTS, the last (partial) block has to be padded.
Definition at line 613 of file encryption.c.
References AES_PADDING, BLOCKSIZE, and padBlock().
Referenced by padBlock(), SPP_EXTERNAL_ENCRYPTION_cbcEncrypt(), and SPP_EXTERNAL_ENCRYPTION_ecbEncrypt().
| void SPP_EXTERNAL_ENCRYPTION_ecbEncrypt | ( | const uint8_t * | key, |
| const void * | pntxt, | ||
| const size_t | ptextLen, | ||
| void * | crtxt ) |
encrypt the input plaintext using ECB-AES block-cipher method
| key | encryption key with a fixed size specified by KEYSIZE |
| pntxt | input plaintext buffer |
| ptextLen | size of plaintext in bytes |
| crtxt | resulting cipher-text buffer |
Definition at line 639 of file encryption.c.
References AES_setkey, BLOCKSIZE, BURN, padBlock(), rijndaelEncrypt(), RoundKey, and SPP_EXTERNAL_ENCRYPTION_ecbEncrypt().
Referenced by SPP_EXTERNAL_ENCRYPTION_ecbEncrypt().
| char SPP_EXTERNAL_ENCRYPTION_ecbDecrypt | ( | const uint8_t * | key, |
| const void * | crtxt, | ||
| const size_t | crtxtLen, | ||
| void * | pntxt ) |
decrypt the input ciphertext using ECB-AES block-cipher method
| key | decryption key with a fixed size specified by KEYSIZE |
| crtxt | input ciphertext buffer |
| crtxtLen | size of ciphertext in bytes |
| pntxt | resulting plaintext buffer |
Definition at line 666 of file encryption.c.
References AES_setkey, BLOCKSIZE, BURN, M_DECRYPTION_ERROR, M_SUCCESS, rijndaelDecrypt(), RoundKey, and SPP_EXTERNAL_ENCRYPTION_ecbDecrypt().
Referenced by SPP_EXTERNAL_ENCRYPTION_ecbDecrypt().
| char SPP_EXTERNAL_ENCRYPTION_cbcEncrypt | ( | const uint8_t * | key, |
| const block_t | iVec, | ||
| const void * | pntxt, | ||
| const size_t | ptextLen, | ||
| void * | crtxt ) |
encrypt the input plaintext using CBC-AES block-cipher method
| key | encryption key with a fixed size specified by KEYSIZE |
| iVec | initialization vector |
| pntxt | input plaintext buffer |
| ptextLen | size of plaintext in bytes |
| crtxt | resulting cipher-text buffer |
Definition at line 700 of file encryption.c.
References AES_setkey, BLOCKSIZE, BURN, M_DATALENGTH_ERROR, M_SUCCESS, padBlock(), rijndaelEncrypt(), RoundKey, SPP_EXTERNAL_ENCRYPTION_cbcEncrypt(), and xorBlock().
Referenced by SPP_EXTERNAL_ENCRYPTION_cbcEncrypt(), and SPP_EXTERNAL_ENCRYPTION_cbcEncrypt().
| char SPP_EXTERNAL_ENCRYPTION_cbcDecrypt | ( | const uint8_t * | key, |
| const block_t | iVec, | ||
| const void * | crtxt, | ||
| const size_t | crtxtLen, | ||
| void * | pntxt ) |
decrypt the input ciphertext using CBC-AES block-cipher method
| key | decryption key with a fixed size specified by KEYSIZE |
| iVec | initialization vector |
| crtxt | input ciphertext buffer |
| crtxtLen | size of ciphertext in bytes |
| pntxt | resulting plaintext buffer |
Definition at line 749 of file encryption.c.
References AES_setkey, BLOCKSIZE, BURN, M_DATALENGTH_ERROR, M_SUCCESS, mixThenXor(), rijndaelDecrypt(), RoundKey, SPP_EXTERNAL_ENCRYPTION_cbcDecrypt(), and xorBlock().
Referenced by SPP_EXTERNAL_ENCRYPTION_cbcDecrypt(), and SPP_EXTERNAL_ENCRYPTION_cbcDecrypt().
|
static |
the general scheme of CFB-AES block-ciphering algorithm
| key | encryption key with a fixed size specified by KEYSIZE |
| iVec | initialization vector |
| mode | mode of operation: (1) to encrypt, (0) to decrypt |
| input | buffer of the input plain/cipher-text |
| dataSize | size of input in bytes |
| output | buffer of the resulting cipher/plain-text |
Definition at line 802 of file encryption.c.
References AES_setkey, BLOCKSIZE, BURN, CFB_cipher(), mixThenXor(), rijndaelEncrypt(), RoundKey, and xorBlock().
Referenced by CFB_cipher(), SPP_EXTERNAL_ENCRYPTION_cfbDecrypt(), and SPP_EXTERNAL_ENCRYPTION_cfbEncrypt().
| void SPP_EXTERNAL_ENCRYPTION_cfbEncrypt | ( | const uint8_t * | key, |
| const block_t | iVec, | ||
| const void * | pntxt, | ||
| const size_t | ptextLen, | ||
| void * | crtxt ) |
encrypt the input plaintext using CFB-AES block-cipher method
| key | encryption key with a fixed size specified by KEYSIZE |
| iVec | initialization vector |
| pntxt | input plaintext buffer |
| ptextLen | size of plaintext in bytes |
| crtxt | resulting cipher-text buffer |
Definition at line 830 of file encryption.c.
References CFB_cipher(), and SPP_EXTERNAL_ENCRYPTION_cfbEncrypt().
Referenced by SPP_EXTERNAL_ENCRYPTION_cfbEncrypt(), and SPP_EXTERNAL_ENCRYPTION_cfbEncrypt().
| void SPP_EXTERNAL_ENCRYPTION_cfbDecrypt | ( | const uint8_t * | key, |
| const block_t | iVec, | ||
| const void * | crtxt, | ||
| const size_t | crtxtLen, | ||
| void * | pntxt ) |
decrypt the input ciphertext using CFB-AES block-cipher method
| key | decryption key with a fixed size specified by KEYSIZE |
| iVec | initialization vector |
| crtxt | input ciphertext buffer |
| crtxtLen | size of ciphertext in bytes |
| pntxt | resulting plaintext buffer |
Definition at line 844 of file encryption.c.
References CFB_cipher(), and SPP_EXTERNAL_ENCRYPTION_cfbDecrypt().
Referenced by SPP_EXTERNAL_ENCRYPTION_cfbDecrypt(), and SPP_EXTERNAL_ENCRYPTION_cfbDecrypt().
| void SPP_EXTERNAL_ENCRYPTION_ofbEncrypt | ( | const uint8_t * | key, |
| const block_t | iVec, | ||
| const void * | pntxt, | ||
| const size_t | ptextLen, | ||
| void * | crtxt ) |
encrypt the input plaintext using OFB-AES block-cipher method
| key | encryption key with a fixed size specified by KEYSIZE |
| iVec | initialization vector |
| pntxt | input plaintext buffer |
| ptextLen | size of plaintext in bytes |
| crtxt | resulting cipher-text buffer |
Definition at line 864 of file encryption.c.
References AES_setkey, BLOCKSIZE, BURN, mixThenXor(), rijndaelEncrypt(), RoundKey, SPP_EXTERNAL_ENCRYPTION_ofbEncrypt(), and xorBlock().
Referenced by SPP_EXTERNAL_ENCRYPTION_ofbDecrypt(), SPP_EXTERNAL_ENCRYPTION_ofbEncrypt(), and SPP_EXTERNAL_ENCRYPTION_ofbEncrypt().
| void SPP_EXTERNAL_ENCRYPTION_ofbDecrypt | ( | const uint8_t * | key, |
| const block_t | iVec, | ||
| const void * | crtxt, | ||
| const size_t | crtxtLen, | ||
| void * | pntxt ) |
decrypt the input ciphertext using OFB-AES block-cipher method
| key | decryption key with a fixed size specified by KEYSIZE |
| iVec | initialization vector |
| crtxt | input ciphertext buffer |
| crtxtLen | size of ciphertext in bytes |
| pntxt | resulting plaintext buffer |
Definition at line 892 of file encryption.c.
References SPP_EXTERNAL_ENCRYPTION_ofbDecrypt(), and SPP_EXTERNAL_ENCRYPTION_ofbEncrypt().
Referenced by SPP_EXTERNAL_ENCRYPTION_ofbDecrypt(), and SPP_EXTERNAL_ENCRYPTION_ofbDecrypt().
|
static |
the general scheme of operation in block-counter mode
| iCtr | initialized counter block |
| mode | specifies the "counter based" block-cipher or AEAD mode |
| input | buffer of the input plain/cipher-text |
| dataSize | size of input in bytes |
| output | buffer of the resulting cipher/plain-text |
Definition at line 922 of file encryption.c.
References BLOCKSIZE, CCM_GCM, CTR_cipher(), incBlock(), LAST, mixThenXor(), rijndaelEncrypt(), SIV_CTR, SIVGCM_CTR, and xorBlock().
Referenced by CTR_cipher(), SPP_EXTERNAL_ENCRYPTION_ccmDecrypt(), SPP_EXTERNAL_ENCRYPTION_ccmEncrypt(), SPP_EXTERNAL_ENCRYPTION_ctrEncrypt(), SPP_EXTERNAL_ENCRYPTION_eaxDecrypt(), SPP_EXTERNAL_ENCRYPTION_eaxEncrypt(), SPP_EXTERNAL_ENCRYPTION_gcmDecrypt(), SPP_EXTERNAL_ENCRYPTION_gcmEncrypt(), SPP_EXTERNAL_ENCRYPTION_gcmSivDecrypt(), SPP_EXTERNAL_ENCRYPTION_gcmSivEncrypt(), SPP_EXTERNAL_ENCRYPTION_sivDecrypt(), and SPP_EXTERNAL_ENCRYPTION_sivEncrypt().
| void SPP_EXTERNAL_ENCRYPTION_ctrEncrypt | ( | const uint8_t * | key, |
| const uint8_t * | iv, | ||
| const void * | pntxt, | ||
| const size_t | ptextLen, | ||
| void * | crtxt ) |
encrypt the input plaintext using CTR-AES block-cipher method
| key | encryption key with a fixed size specified by KEYSIZE |
| iv | initialization vector a.k.a. nonce |
| pntxt | input plaintext buffer |
| ptextLen | size of plaintext in bytes |
| crtxt | resulting cipher-text buffer |
Definition at line 965 of file encryption.c.
References AES_setkey, BURN, CTR_cipher(), CTR_DEFAULT, CTR_IV_LENGTH, CTR_START_VALUE, LAST, RoundKey, SPP_EXTERNAL_ENCRYPTION_ctrEncrypt(), and xorBEint().
Referenced by SPP_EXTERNAL_ENCRYPTION_ctrDecrypt(), SPP_EXTERNAL_ENCRYPTION_ctrEncrypt(), and SPP_EXTERNAL_ENCRYPTION_ofbDecrypt().
| void SPP_EXTERNAL_ENCRYPTION_ctrDecrypt | ( | const uint8_t * | key, |
| const uint8_t * | iv, | ||
| const void * | crtxt, | ||
| const size_t | crtxtLen, | ||
| void * | pntxt ) |
decrypt the input ciphertext using CTR-AES block-cipher method
| key | decryption key with a fixed size specified by KEYSIZE |
| iv | initialization vector a.k.a. nonce |
| crtxt | input ciphertext buffer |
| crtxtLen | size of ciphertext in bytes |
| pntxt | resulting plaintext buffer |
Definition at line 989 of file encryption.c.
References SPP_EXTERNAL_ENCRYPTION_ctrDecrypt(), and SPP_EXTERNAL_ENCRYPTION_ctrEncrypt().
Referenced by SPP_EXTERNAL_ENCRYPTION_ctrDecrypt(), and SPP_EXTERNAL_ENCRYPTION_ofbDecrypt().
|
static |
encrypt or decrypt a data unit with XTS method
| keypair | pair of encryption keys, each one has KEYSIZE bytes |
| mode | mode of operation: encrypting (1) or decrypting (0) |
| tweak | data unit identifier block, similar to nonce in CTR mode |
| sectid | sector id: in case of a null tweak, use this instead |
| dataSize | size of input data, to be encrypted/decrypted |
| storage | result of encryption/decryption process |
Definition at line 1012 of file encryption.c.
References AES_setkey, BLOCKSIZE, BURN, doubleLblock(), KEYSIZE, M_DATALENGTH_ERROR, M_SUCCESS, rijndaelDecrypt(), rijndaelEncrypt(), RoundKey, xorBlock(), and XTS_cipher().
Referenced by SPP_EXTERNAL_ENCRYPTION_xtsDecrypt(), SPP_EXTERNAL_ENCRYPTION_xtsEncrypt(), and XTS_cipher().
| char SPP_EXTERNAL_ENCRYPTION_xtsEncrypt | ( | const uint8_t * | keys, |
| const uint8_t * | tweak, | ||
| const void * | pntxt, | ||
| const size_t | ptextLen, | ||
| void * | crtxt ) |
encrypt the input plaintext using XTS-AES block-cipher method
| keys | two-part encryption key with a fixed size of 2*KEYSIZE |
| tweak | tweak bytes of data unit, a.k.a sector ID (little-endian) |
| pntxt | input plaintext buffer |
| ptextLen | size of plaintext in bytes |
| crtxt | resulting cipher-text buffer |
Definition at line 1073 of file encryption.c.
References SPP_EXTERNAL_ENCRYPTION_xtsEncrypt(), and XTS_cipher().
Referenced by SPP_EXTERNAL_ENCRYPTION_ofbDecrypt(), and SPP_EXTERNAL_ENCRYPTION_xtsEncrypt().
| char SPP_EXTERNAL_ENCRYPTION_xtsDecrypt | ( | const uint8_t * | keys, |
| const uint8_t * | tweak, | ||
| const void * | crtxt, | ||
| const size_t | crtxtLen, | ||
| void * | pntxt ) |
encrypt the input ciphertext using XTS-AES block-cipher method
| keys | two-part encryption key with a fixed size of 2*KEYSIZE |
| tweak | tweak bytes of data unit, a.k.a sector ID (little-endian) |
| crtxt | input ciphertext buffer |
| crtxtLen | size of ciphertext in bytes |
| pntxt | resulting plaintext buffer |
Definition at line 1089 of file encryption.c.
References SPP_EXTERNAL_ENCRYPTION_xtsDecrypt(), and XTS_cipher().
Referenced by SPP_EXTERNAL_ENCRYPTION_ofbDecrypt(), and SPP_EXTERNAL_ENCRYPTION_xtsDecrypt().
| void SPP_EXTERNAL_ENCRYPTION_cmac | ( | const uint8_t * | key, |
| const void * | data, | ||
| const size_t | dataSize, | ||
| block_t | mac ) |
derive the AES-CMAC of input data using an encryption key
| key | AES encryption key |
| data | buffer of input data |
| dataSize | size of data in bytes |
| mac | calculated CMAC hash |
Definition at line 1109 of file encryption.c.
References BURN, cMac(), doubleBblock(), getSubkeys(), RoundKey, and SPP_EXTERNAL_ENCRYPTION_cmac().
Referenced by SPP_EXTERNAL_ENCRYPTION_cmac(), and SPP_EXTERNAL_ENCRYPTION_cmac().
|
static |
calculate G-Hash of ciphertext and AAD using an authentication subkey H
Definition at line 1128 of file encryption.c.
References gHash(), LAST, MIDST, mulGF128(), xMac(), and xorBEint().
Referenced by GCMsetup(), gHash(), SPP_EXTERNAL_ENCRYPTION_gcmDecrypt(), and SPP_EXTERNAL_ENCRYPTION_gcmEncrypt().
encrypt zeros to get the authentication subkey (H), and construct the IV.
Definition at line 1141 of file encryption.c.
References AES_setkey, GCM_NONCE_LEN, GCMsetup(), gHash(), LAST, and rijndaelEncrypt().
Referenced by GCMsetup(), SPP_EXTERNAL_ENCRYPTION_gcmDecrypt(), and SPP_EXTERNAL_ENCRYPTION_gcmEncrypt().
| void SPP_EXTERNAL_ENCRYPTION_gcmEncrypt | ( | const uint8_t * | key, |
| const uint8_t * | nonce, | ||
| const void * | aData, | ||
| const size_t | aDataLen, | ||
| const void * | pntxt, | ||
| const size_t | ptextLen, | ||
| void * | crtxt ) |
encrypt the input plaintext using GCM-AES block-cipher method
| key | encryption key with a fixed size specified by KEYSIZE |
| nonce | a.k.a initialization vector with fixed size: GCM_NONCE_LEN |
| aData | additional authentication data |
| aDataLen | size of additional authentication data |
| pntxt | input plain-text buffer |
| ptextLen | size of plaintext in bytes |
| crtxt | resulting cipher-text buffer + message authentication tag |
Definition at line 1165 of file encryption.c.
References BURN, CCM_GCM, CTR_cipher(), GCM_TAG_LEN, GCMsetup(), gHash(), rijndaelEncrypt(), RoundKey, SPP_EXTERNAL_ENCRYPTION_gcmEncrypt(), and xorBlock().
Referenced by SPP_EXTERNAL_ENCRYPTION_CYPHER_encryptPacket(), SPP_EXTERNAL_ENCRYPTION_gcmEncrypt(), and SPP_EXTERNAL_ENCRYPTION_sivDecrypt().
| char SPP_EXTERNAL_ENCRYPTION_gcmDecrypt | ( | const uint8_t * | key, |
| const uint8_t * | nonce, | ||
| const void * | aData, | ||
| const size_t | aDataLen, | ||
| const void * | crtxt, | ||
| const size_t | crtxtLen, | ||
| void * | pntxt ) |
decrypt the input ciphertext using GCM-AES block-cipher method
| key | decryption key with a fixed size specified by KEYSIZE |
| nonce | a.k.a initialization vector with fixed size: GCM_NONCE_LEN |
| aData | additional authentication data |
| aDataLen | size of additional authentication data |
| crtxt | input cipher-text buffer + appended authentication tag |
| crtxtLen | size of ciphertext, excluding tag |
| pntxt | resulting plaintext buffer |
Definition at line 1193 of file encryption.c.
References BURN, CCM_GCM, CTR_cipher(), GCM_TAG_LEN, GCMsetup(), gHash(), M_AUTHENTICATION_ERROR, M_SUCCESS, memcmp_s, rijndaelEncrypt(), RoundKey, SPP_EXTERNAL_ENCRYPTION_gcmDecrypt(), and xorBlock().
Referenced by SPP_EXTERNAL_ENCRYPTION_gcmDecrypt(), and SPP_EXTERNAL_ENCRYPTION_sivDecrypt().
|
static |
this function calculates the CBC-MAC of plaintext and authentication data
Definition at line 1223 of file encryption.c.
References BLOCKSIZE, CCM_TAG_LEN, CCMtag(), LAST, rijndaelEncrypt(), xMac(), xorBEint(), and xorBlock().
Referenced by CCMtag(), SPP_EXTERNAL_ENCRYPTION_ccmDecrypt(), and SPP_EXTERNAL_ENCRYPTION_ccmEncrypt().
| void SPP_EXTERNAL_ENCRYPTION_ccmEncrypt | ( | const uint8_t * | key, |
| const uint8_t * | nonce, | ||
| const void * | aData, | ||
| const size_t | aDataLen, | ||
| const void * | pntxt, | ||
| const size_t | ptextLen, | ||
| void * | crtxt ) |
encrypt the input plaintext using CCM-AES block-cipher method
| key | encryption key with a fixed size specified by KEYSIZE |
| nonce | a.k.a initialization vector with fixed size: CCM_NONCE_LEN |
| aData | additional authentication data |
| aDataLen | size of additional authentication data |
| pntxt | input plain-text buffer |
| ptextLen | size of plaintext in bytes |
| crtxt | resulting cipher-text buffer + message authentication tag |
Definition at line 1269 of file encryption.c.
References AES_setkey, BURN, CCM_GCM, CCM_NONCE_LEN, CCM_TAG_LEN, CCMtag(), CTR_cipher(), RoundKey, and SPP_EXTERNAL_ENCRYPTION_ccmEncrypt().
Referenced by SPP_EXTERNAL_ENCRYPTION_ccmEncrypt(), and SPP_EXTERNAL_ENCRYPTION_sivDecrypt().
| char SPP_EXTERNAL_ENCRYPTION_ccmDecrypt | ( | const uint8_t * | key, |
| const uint8_t * | nonce, | ||
| const void * | aData, | ||
| const size_t | aDataLen, | ||
| const void * | crtxt, | ||
| const size_t | crtxtLen, | ||
| void * | pntxt ) |
decrypt the input ciphertext using CCM-AES block-cipher method
| key | decryption key with a fixed size specified by KEYSIZE |
| nonce | a.k.a initialization vector with fixed size: CCM_NONCE_LEN |
| aData | additional authentication data |
| aDataLen | size of additional authentication data |
| crtxt | input cipher-text buffer + appended authentication tag |
| crtxtLen | size of ciphertext, excluding tag |
| pntxt | resulting plaintext buffer |
Definition at line 1296 of file encryption.c.
References AES_setkey, BURN, CCM_GCM, CCM_NONCE_LEN, CCM_TAG_LEN, CCMtag(), CTR_cipher(), M_AUTHENTICATION_ERROR, M_SUCCESS, memcmp_s, RoundKey, SABOTAGE, and SPP_EXTERNAL_ENCRYPTION_ccmDecrypt().
Referenced by SPP_EXTERNAL_ENCRYPTION_ccmDecrypt(), and SPP_EXTERNAL_ENCRYPTION_sivDecrypt().
|
static |
calculate the CMAC* of AAD unit(s), then plaintext, and synthesize the IV
Definition at line 1325 of file encryption.c.
References BLOCKSIZE, cMac(), doubleBblock(), getSubkeys(), rijndaelEncrypt(), S2V(), and xorBlock().
Referenced by S2V(), SPP_EXTERNAL_ENCRYPTION_sivDecrypt(), and SPP_EXTERNAL_ENCRYPTION_sivEncrypt().
| void SPP_EXTERNAL_ENCRYPTION_sivEncrypt | ( | const uint8_t * | keys, |
| const void * | aData, | ||
| const size_t | aDataLen, | ||
| const void * | pntxt, | ||
| const size_t | ptextLen, | ||
| block_t | iv, | ||
| void * | crtxt ) |
encrypt the input plaintext using SIV-AES block-cipher method
| keys | two-part encryption key with a fixed size of 2*KEYSIZE |
| aData | additional authentication data |
| aDataLen | size of additional authentication data |
| pntxt | input plain-text buffer |
| ptextLen | size of plaintext in bytes |
| iv | synthesized I.V block, typically prepended to ciphertext |
| crtxt | resulting cipher-text buffer |
Definition at line 1373 of file encryption.c.
References AES_setkey, BURN, CTR_cipher(), KEYSIZE, RoundKey, S2V(), SIV_CTR, and SPP_EXTERNAL_ENCRYPTION_sivEncrypt().
Referenced by SPP_EXTERNAL_ENCRYPTION_sivEncrypt(), and SPP_EXTERNAL_ENCRYPTION_sivEncrypt().
| char SPP_EXTERNAL_ENCRYPTION_sivDecrypt | ( | const uint8_t * | keys, |
| const block_t | iv, | ||
| const void * | aData, | ||
| const size_t | aDataLen, | ||
| const void * | crtxt, | ||
| const size_t | crtxtLen, | ||
| void * | pntxt ) |
decrypt the input ciphertext using SIV-AES block-cipher method
| keys | two-part encryption key with a fixed size of 2*KEYSIZE |
| iv | provided I.V block to validate |
| aData | additional authentication data |
| aDataLen | size of additional authentication data |
| crtxt | input cipher-text buffer |
| crtxtLen | size of ciphertext in bytes |
| pntxt | resulting plaintext buffer |
Definition at line 1395 of file encryption.c.
References AES_setkey, BURN, CTR_cipher(), KEYSIZE, M_AUTHENTICATION_ERROR, M_SUCCESS, memcmp_s, RoundKey, S2V(), SABOTAGE, SIV_CTR, and SPP_EXTERNAL_ENCRYPTION_sivDecrypt().
Referenced by SPP_EXTERNAL_ENCRYPTION_sivDecrypt(), and SPP_EXTERNAL_ENCRYPTION_sivDecrypt().
|
static |
calculate the POLYVAL of plaintext and AAD using authentication subkey H.
Definition at line 1422 of file encryption.c.
References dotGF128(), HB, polyval(), and xMac().
Referenced by polyval(), SPP_EXTERNAL_ENCRYPTION_gcmSivDecrypt(), and SPP_EXTERNAL_ENCRYPTION_gcmSivEncrypt().
|
static |
derive the pair of authentication-encryption-keys from main key and nonce
Definition at line 1435 of file encryption.c.
References AES_setkey, BLOCKSIZE, GCM_SIVsetup(), HB, KEYSIZE, Nk, rijndaelEncrypt(), and SIVGCM_NONCE_LEN.
Referenced by GCM_SIVsetup(), SPP_EXTERNAL_ENCRYPTION_gcmSivDecrypt(), and SPP_EXTERNAL_ENCRYPTION_gcmSivEncrypt().
get the tag in GCM-SIV mode, given the nonce and calculated POLYVAL block
Definition at line 1452 of file encryption.c.
References GCM_SIVtag(), LAST, rijndaelEncrypt(), XOR32BITS, and XOR64BITS.
Referenced by GCM_SIVtag(), SPP_EXTERNAL_ENCRYPTION_gcmSivDecrypt(), and SPP_EXTERNAL_ENCRYPTION_gcmSivEncrypt().
| void SPP_EXTERNAL_ENCRYPTION_gcmSivEncrypt | ( | const uint8_t * | key, |
| const uint8_t * | nonce, | ||
| const void * | aData, | ||
| const size_t | aDataLen, | ||
| const void * | pntxt, | ||
| const size_t | ptextLen, | ||
| void * | crtxt ) |
encrypt the input plaintext using SIV-GCM-AES block-cipher method
| key | encryption key with a fixed size specified by KEYSIZE |
| nonce | provided 96-bit nonce |
| aData | additional authentication data |
| aDataLen | size of additional authentication data |
| pntxt | input plain-text buffer |
| ptextLen | size of plaintext in bytes |
| crtxt | resulting cipher-text buffer + message authentication tag |
Definition at line 1470 of file encryption.c.
References BURN, CTR_cipher(), GCM_SIVsetup(), GCM_SIVtag(), polyval(), RoundKey, SIVGCM_CTR, and SPP_EXTERNAL_ENCRYPTION_gcmSivEncrypt().
Referenced by SPP_EXTERNAL_ENCRYPTION_gcmSivEncrypt(), and SPP_EXTERNAL_ENCRYPTION_sivDecrypt().
| char SPP_EXTERNAL_ENCRYPTION_gcmSivDecrypt | ( | const uint8_t * | key, |
| const uint8_t * | nonce, | ||
| const void * | aData, | ||
| const size_t | aDataLen, | ||
| const void * | crtxt, | ||
| const size_t | crtxtLen, | ||
| void * | pntxt ) |
decrypt the input ciphertext using SIV-GCM-AES block-cipher method
| key | decryption key with a fixed size specified by KEYSIZE |
| nonce | provided 96-bit nonce |
| aData | additional authentication data |
| aDataLen | size of additional authentication data |
| crtxt | input cipher-text buffer + appended authentication tag |
| crtxtLen | size of ciphertext, excluding tag |
| pntxt | resulting plaintext buffer |
Definition at line 1496 of file encryption.c.
References BURN, CTR_cipher(), GCM_SIVsetup(), GCM_SIVtag(), M_AUTHENTICATION_ERROR, M_SUCCESS, memcmp_s, polyval(), RoundKey, SABOTAGE, SIVGCM_CTR, SIVGCM_TAG_LEN, and SPP_EXTERNAL_ENCRYPTION_gcmSivDecrypt().
Referenced by SPP_EXTERNAL_ENCRYPTION_gcmSivDecrypt(), and SPP_EXTERNAL_ENCRYPTION_sivDecrypt().
|
static |
this function calculates the OMAC of a data array using D (K1) and Q (K2)
Definition at line 1525 of file encryption.c.
References BLOCKSIZE, cMac(), LAST, oMac(), and rijndaelEncrypt().
Referenced by oMac(), SPP_EXTERNAL_ENCRYPTION_eaxDecrypt(), and SPP_EXTERNAL_ENCRYPTION_eaxEncrypt().
| void SPP_EXTERNAL_ENCRYPTION_eaxEncrypt | ( | const uint8_t * | key, |
| const uint8_t * | nonce, | ||
| const void * | aData, | ||
| const size_t | aDataLen, | ||
| const void * | pntxt, | ||
| const size_t | ptextLen, | ||
| void * | crtxt ) |
encrypt the input plaintext using EAX-AES block-cipher method
| key | encryption key with a fixed size specified by KEYSIZE |
| nonce | nonce with variable size in EAX' and fixed size in EAX |
| nonceLen | size of the nonce byte array; should be non-zero in EAX' |
| aData | additional authentication data; used in EAX only |
| aDataLen | size of additional authentication data |
| pntxt | input plain-text buffer |
| ptextLen | size of plaintext in bytes |
| crtxt | ciphertext result + auth. tag (4 bytes mac in EAX') |
Definition at line 1557 of file encryption.c.
References BURN, COPYDWORD, CTR_cipher(), CTR_DEFAULT, doubleBblock(), doubleLblock(), EAX_NONCE_LEN, EAX_TAG_LEN, EAXP, getSubkeys(), oMac(), RoundKey, SPP_EXTERNAL_ENCRYPTION_eaxEncrypt(), XOR32BITS, and xorBlock().
Referenced by SPP_EXTERNAL_ENCRYPTION_eaxEncrypt(), and SPP_EXTERNAL_ENCRYPTION_sivDecrypt().
| char SPP_EXTERNAL_ENCRYPTION_eaxDecrypt | ( | const uint8_t * | key, |
| const uint8_t * | nonce, | ||
| const void * | aData, | ||
| const size_t | aDataLen, | ||
| const void * | crtxt, | ||
| const size_t | crtxtLen, | ||
| void * | pntxt ) |
decrypt the input ciphertext using EAX-AES block-cipher method
| key | decryption key with a fixed size specified by KEYSIZE |
| nonce | nonce with variable size in EAX' and fixed size in EAX |
| nonceLen | size of the nonce byte array; only used in EAX' |
| aData | additional authentication data; for EAX only, not EAX' |
| aDataLen | size of additional authentication data |
| crtxt | input cipher-text buffer + appended authentication tag |
| crtxtLen | size of cipher-text; excluding tag / 4-bytes mac in EAX' |
| pntxt | resulting plaintext buffer |
Definition at line 1607 of file encryption.c.
References BURN, CTR_cipher(), CTR_DEFAULT, doubleBblock(), doubleLblock(), EAX_NONCE_LEN, EAX_TAG_LEN, EAXP, getSubkeys(), M_AUTHENTICATION_ERROR, M_SUCCESS, memcmp_s, oMac(), RoundKey, SPP_EXTERNAL_ENCRYPTION_eaxDecrypt(), XOR32BITS, and xorBlock().
Referenced by SPP_EXTERNAL_ENCRYPTION_eaxDecrypt(), and SPP_EXTERNAL_ENCRYPTION_sivDecrypt().
Definition at line 1656 of file encryption.c.
References nop().
Referenced by nop(), and OCB_cipher().
Calculate the offset block (Δ_i) at a specified index, given the initial Δ_0 and L$ blocks. This method has minimum memory usage, but it might be slow. To make it faster, pre-calculate all L_{i}s (avoid doubling inside the loop).
Definition at line 1661 of file encryption.c.
References BLOCKSIZE, doubleBblock(), getDelta(), and xorBlock().
Referenced by getDelta(), and OCB_cipher().
|
static |
encrypt or decrypt the data using OCB method
| key | encryption or decryption key |
| nonce | byte array with a fixed size of OCB_NONCE_LEN |
| ptextLen | size of input 'plain'text; which is zero in decryption |
| aDataLen | size of additional authentication data |
| dataSize | size of input data, to be encrypted/decrypted |
| aData | additional authentication data |
| data | result of encryption/decryption process |
| tag | calculated tag from plaintext checksum, and PMAC of aData |
Definition at line 1692 of file encryption.c.
References BLOCKSIZE, BURN, cMac(), doubleBblock(), getDelta(), getSubkeys(), HB, LAST, mixThenXor(), nop(), OCB_cipher(), OCB_NONCE_LEN, OCB_TAG_LEN, rijndaelDecrypt(), rijndaelEncrypt(), RoundKey, xMac(), and xorBlock().
Referenced by OCB_cipher(), SPP_EXTERNAL_ENCRYPTION_ocbDecrypt(), and SPP_EXTERNAL_ENCRYPTION_ocbEncrypt().
| void SPP_EXTERNAL_ENCRYPTION_ocbEncrypt | ( | const uint8_t * | key, |
| const uint8_t * | nonce, | ||
| const void * | aData, | ||
| const size_t | aDataLen, | ||
| const void * | pntxt, | ||
| const size_t | ptextLen, | ||
| void * | crtxt ) |
encrypt the input stream using OCB-AES block-cipher method
| key | encryption key with a fixed size specified by KEYSIZE |
| nonce | a.k.a initialization vector with fixed size: OCB_NONCE_LEN |
| aData | additional authentication data |
| aDataLen | size of additional authentication data |
| pntxt | input plain-text buffer |
| ptextLen | size of plaintext in bytes |
| crtxt | resulting cipher-text buffer + message authentication tag |
Definition at line 1773 of file encryption.c.
References OCB_cipher(), OCB_TAG_LEN, and SPP_EXTERNAL_ENCRYPTION_ocbEncrypt().
Referenced by SPP_EXTERNAL_ENCRYPTION_ocbEncrypt(), and SPP_EXTERNAL_ENCRYPTION_sivDecrypt().
| char SPP_EXTERNAL_ENCRYPTION_ocbDecrypt | ( | const uint8_t * | key, |
| const uint8_t * | nonce, | ||
| const void * | aData, | ||
| const size_t | aDataLen, | ||
| const void * | crtxt, | ||
| const size_t | crtxtLen, | ||
| void * | pntxt ) |
decrypt the input stream using OCB-AES block-cipher method
| key | decryption key with a fixed size specified by KEYSIZE |
| nonce | a.k.a initialization vector with fixed size: OCB_NONCE_LEN |
| aData | additional authentication data |
| aDataLen | size of additional authentication data |
| crtxt | input cipher-text buffer + appended authentication tag |
| crtxtLen | size of ciphertext, excluding tag |
| pntxt | resulting plaintext buffer |
Definition at line 1796 of file encryption.c.
References M_AUTHENTICATION_ERROR, M_SUCCESS, memcmp_s, OCB_cipher(), OCB_TAG_LEN, SABOTAGE, and SPP_EXTERNAL_ENCRYPTION_ocbDecrypt().
Referenced by SPP_EXTERNAL_ENCRYPTION_ocbDecrypt(), and SPP_EXTERNAL_ENCRYPTION_sivDecrypt().
| char SPP_EXTERNAL_ENCRYPTION_keyWrap | ( | const uint8_t * | kek, |
| const void * | secret, | ||
| const size_t | secretLen, | ||
| void * | wrapped ) |
encrypt the input secret with key-wrapping method
| kek | key-encryption-key a.k.a master key |
| secret | input plaintext secret |
| secretLen | size of secret in bytes |
| wrapped | wrapped secret, prepended with an additional half-block |
Definition at line 1829 of file encryption.c.
References AES_setkey, BURN, HB, IV_KWA, M_DATALENGTH_ERROR, M_SUCCESS, MIDST, rijndaelEncrypt(), RoundKey, SPP_EXTERNAL_ENCRYPTION_keyWrap(), and xorBEint().
Referenced by SPP_EXTERNAL_ENCRYPTION_keyWrap(), and SPP_EXTERNAL_ENCRYPTION_sivDecrypt().
| char SPP_EXTERNAL_ENCRYPTION_keyUnwrap | ( | const uint8_t * | kek, |
| const void * | wrapped, | ||
| const size_t | wrapLen, | ||
| void * | secret ) |
unwrap/decrypt a wrapped secret according to RFC-3394
| kek | key-encryption-key a.k.a master key |
| wrapped | ciphertext input, the wrapped secret |
| wrapLen | size of ciphertext/wrapped input in bytes |
| secret | unwrapped secret, which is a half block shorter than input |
Definition at line 1865 of file encryption.c.
References AES_setkey, BURN, HB, IV_KWA, M_AUTHENTICATION_ERROR, M_DATALENGTH_ERROR, M_SUCCESS, memcmp_s, MIDST, rijndaelDecrypt(), RoundKey, SABOTAGE, SPP_EXTERNAL_ENCRYPTION_keyUnwrap(), and xorBEint().
Referenced by SPP_EXTERNAL_ENCRYPTION_keyUnwrap(), and SPP_EXTERNAL_ENCRYPTION_sivDecrypt().
|
static |
add two little-endian blocks x and y up to length len, so that: y = y + x
Definition at line 1905 of file encryption.c.
References addLblocks().
Referenced by addLblocks(), and SPP_EXTERNAL_ENCRYPTION_poly1305().
|
static |
derive modulo(2^130-5) for a large integer saved in a little-endian block
Definition at line 1916 of file encryption.c.
References modP1305(), and PL.
Referenced by modP1305(), mulLblocks(), and SPP_EXTERNAL_ENCRYPTION_poly1305().
|
static |
modular multiplication of two little-endian poly1305 blocks: y *= x mod P
Definition at line 1930 of file encryption.c.
References modP1305(), mulLblocks(), and PL.
Referenced by mulLblocks(), and SPP_EXTERNAL_ENCRYPTION_poly1305().
| void SPP_EXTERNAL_ENCRYPTION_poly1305 | ( | const uint8_t * | keys, |
| const block_t | nonce, | ||
| const void * | data, | ||
| const size_t | dataSize, | ||
| block_t | mac ) |
derive the Poly1305-AES mac of message using a nonce and key pair.
| keys | pair of encryption/mixing keys (k, r); size = KEYSIZE + 16 |
| nonce | a 128 bit string which is encrypted by AES_k |
| data | buffer of input data |
| dataSize | size of data in bytes |
| mac | calculated Poly1305-AES mac |
Definition at line 1957 of file encryption.c.
References addLblocks(), AES_setkey, BLOCKSIZE, BURN, KEYSIZE, modP1305(), mulLblocks(), PL, rijndaelEncrypt(), RoundKey, and SPP_EXTERNAL_ENCRYPTION_poly1305().
Referenced by SPP_EXTERNAL_ENCRYPTION_poly1305(), and SPP_EXTERNAL_ENCRYPTION_poly1305().
|
static |
convert the string s in base-RADIX to a big-endian number, denoted by num
Definition at line 2040 of file encryption.c.
References numRadix(), and RADIX.
Referenced by FF1round(), and numRadix().
|
static |
convert a big-endian number to string s, its representation in base-RADIX
Definition at line 2055 of file encryption.c.
References RADIX, and strRadix().
Referenced by FF1round(), and strRadix().
add two numbers x, y in base-RADIX and save the result in y, i.e. y += x;
Definition at line 2070 of file encryption.c.
References addRadix(), and RADIX.
Referenced by addRadix(), and FF1_cipher().
subtract two numbers in base-RADIX and save the result in y, i.e. y -= x;
Definition at line 2081 of file encryption.c.
References RADIX, and subRadix().
Referenced by FF1_cipher(), and subRadix().
|
static |
derive C at step i of FF1 rounds, given the values: u, v and PRF_init = P
Definition at line 2092 of file encryption.c.
References b1, BLOCKSIZE, FF1round(), LAST, numRadix(), rijndaelEncrypt(), strRadix(), xMac(), and xorBEint().
Referenced by FF1_cipher(), and FF1round().
|
static |
encrypt/decrypt a base-RADIX string X with length len using FF1 algorithm
Definition at line 2118 of file encryption.c.
References addRadix(), AES_setkey, b1, BLOCKSIZE, FF1_cipher(), FF1round(), LAST, RADIX, rijndaelEncrypt(), subRadix(), TWEAK_PARAMS, xMac(), and xorBEint().
Referenced by FF1_cipher().
|
static |
encrypt or decrypt the input string with FPE method
| key | encryption or decryption key |
| mode | mode of operation: encrypting (1) or decrypting (0) |
| tweak | tweak byte array |
| tweakLen | size of tweak. must be exactly 7 in FF3-1 |
| input | input string, consisted of characters in ALPHABET |
| dataSize | length of the string, or its number of characters |
| output | result of format-preserved encryption/decryption |
Definition at line 2269 of file encryption.c.
References ALPHABET, b1, BURN, FPE_cipher(), FPE_PERMUTE, KEYSIZE, LAST, LOGRDX, M_DATAFORMAT_ERROR, M_DATALENGTH_ERROR, M_MEMORY_ERROR, M_SUCCESS, MAXLEN, MINLEN, RADIX, RoundKey, TWEAK_AGRS, and TWEAK_PARAMS.
Referenced by FPE_cipher(), SPP_EXTERNAL_ENCRYPTION_fpeDecrypt(), and SPP_EXTERNAL_ENCRYPTION_fpeEncrypt().
| char SPP_EXTERNAL_ENCRYPTION_fpeEncrypt | ( | const uint8_t * | key, |
| const TWEAK_PARAMS | , | ||
| const void * | pntxt, | ||
| const size_t | ptextLen, | ||
| void * | crtxt ) |
encrypt the input string using FPE-AES block-cipher method
| key | encryption key with a fixed size specified by KEYSIZE |
| tweak | tweak byte array; similar to nonce in other schemes |
| tweakLen | size of tweak. must be exactly 7 in FF3-1 |
| pntxt | input plaintext string, consisted of ALPHABET characters |
| ptextLen | size of plaintext string, or number of characters |
| crtxt | resulting ciphertext string |
Definition at line 2328 of file encryption.c.
References FPE_cipher(), SPP_EXTERNAL_ENCRYPTION_fpeEncrypt(), TWEAK_AGRS, and TWEAK_PARAMS.
Referenced by SPP_EXTERNAL_ENCRYPTION_fpeEncrypt(), and SPP_EXTERNAL_ENCRYPTION_fpeEncrypt().
| char SPP_EXTERNAL_ENCRYPTION_fpeDecrypt | ( | const uint8_t * | key, |
| const TWEAK_PARAMS | , | ||
| const void * | crtxt, | ||
| const size_t | crtxtLen, | ||
| void * | pntxt ) |
decrypt a ciphertext string using FPE-AES block-cipher method
| key | decryption key with a fixed size specified by KEYSIZE |
| tweak | tweak byte array; similar to nonce in other schemes |
| tweakLen | size of tweak. must be exactly 7 in FF3-1 |
| crtxt | input ciphertext string, consisted of ALPHABET characters |
| crtxtLen | size of ciphertext string, or number of characters |
| pntxt | resulting plaintext string |
Definition at line 2344 of file encryption.c.
References FPE_cipher(), SPP_EXTERNAL_ENCRYPTION_fpeDecrypt(), TWEAK_AGRS, and TWEAK_PARAMS.
Referenced by SPP_EXTERNAL_ENCRYPTION_fpeDecrypt(), and SPP_EXTERNAL_ENCRYPTION_fpeDecrypt().
|
static |
Lookup-tables are "static constant", so that they can be placed in read-only storage instead of RAM. They can be computed dynamically trading ROM for RAM. This may be useful in (embedded) bootloader applications, where ROM is often limited. Note that sbox[y] = x, if and only if rsbox[x] = y. For more details on dynamic sbox computation, see https://en.wikipedia.org/wiki/Rijndael_S-box
Definition at line 41 of file encryption.c.
|
static |
Definition at line 54 of file encryption.c.
The array that stores all round keys during the AES key-expansion process
Definition at line 72 of file encryption.c.
Referenced by AddRoundKey(), CFB_cipher(), FPE_cipher(), KeyExpansion(), OCB_cipher(), SPP_EXTERNAL_ENCRYPTION_cbcDecrypt(), SPP_EXTERNAL_ENCRYPTION_cbcEncrypt(), SPP_EXTERNAL_ENCRYPTION_ccmDecrypt(), SPP_EXTERNAL_ENCRYPTION_ccmEncrypt(), SPP_EXTERNAL_ENCRYPTION_cmac(), SPP_EXTERNAL_ENCRYPTION_ctrEncrypt(), SPP_EXTERNAL_ENCRYPTION_eaxDecrypt(), SPP_EXTERNAL_ENCRYPTION_eaxEncrypt(), SPP_EXTERNAL_ENCRYPTION_ecbDecrypt(), SPP_EXTERNAL_ENCRYPTION_ecbEncrypt(), SPP_EXTERNAL_ENCRYPTION_gcmDecrypt(), SPP_EXTERNAL_ENCRYPTION_gcmEncrypt(), SPP_EXTERNAL_ENCRYPTION_gcmSivDecrypt(), SPP_EXTERNAL_ENCRYPTION_gcmSivEncrypt(), SPP_EXTERNAL_ENCRYPTION_keyUnwrap(), SPP_EXTERNAL_ENCRYPTION_keyWrap(), SPP_EXTERNAL_ENCRYPTION_ofbEncrypt(), SPP_EXTERNAL_ENCRYPTION_poly1305(), SPP_EXTERNAL_ENCRYPTION_sivDecrypt(), SPP_EXTERNAL_ENCRYPTION_sivEncrypt(), and XTS_cipher().
|
static |
Definition at line 2037 of file encryption.c.
Referenced by FF1_cipher(), FF1round(), and FPE_cipher().