RetroArch
Macros | Functions | Variables
des.c File Reference
#include "mbedtls/config.h"
#include "mbedtls/des.h"
#include <string.h>
#include "mbedtls/platform.h"
#include "arc4_alt.h"
Include dependency graph for des.c:

Macros

#define GET_UINT32_BE(n, b, i)
 
#define PUT_UINT32_BE(n, b, i)
 
#define DES_IP(X, Y)
 
#define DES_FP(X, Y)
 
#define DES_ROUND(X, Y)
 
#define SWAP(a, b)   { uint32_t t = a; a = b; b = t; t = 0; }
 
#define WEAK_KEY_COUNT   16
 

Functions

void mbedtls_des_init (mbedtls_des_context *ctx)
 Initialize DES context. More...
 
void mbedtls_des_free (mbedtls_des_context *ctx)
 Clear DES context. More...
 
void mbedtls_des3_init (mbedtls_des3_context *ctx)
 Initialize Triple-DES context. More...
 
void mbedtls_des3_free (mbedtls_des3_context *ctx)
 Clear Triple-DES context. More...
 
void mbedtls_des_key_set_parity (unsigned char key[MBEDTLS_DES_KEY_SIZE])
 Set key parity on the given key to odd. More...
 
int mbedtls_des_key_check_key_parity (const unsigned char key[MBEDTLS_DES_KEY_SIZE])
 Check that key parity on the given key is odd. More...
 
int mbedtls_des_key_check_weak (const unsigned char key[MBEDTLS_DES_KEY_SIZE])
 Check that key is not a weak or semi-weak DES key. More...
 
void mbedtls_des_setkey (uint32_t SK[32], const unsigned char key[MBEDTLS_DES_KEY_SIZE])
 Internal function for key expansion. (Only exposed to allow overriding it, see MBEDTLS_DES_SETKEY_ALT) More...
 
int mbedtls_des_setkey_enc (mbedtls_des_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE])
 DES key schedule (56-bit, encryption) More...
 
int mbedtls_des_setkey_dec (mbedtls_des_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE])
 DES key schedule (56-bit, decryption) More...
 
static void des3_set2key (uint32_t esk[96], uint32_t dsk[96], const unsigned char key[MBEDTLS_DES_KEY_SIZE *2])
 
int mbedtls_des3_set2key_enc (mbedtls_des3_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE *2])
 Triple-DES key schedule (112-bit, encryption) More...
 
int mbedtls_des3_set2key_dec (mbedtls_des3_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE *2])
 Triple-DES key schedule (112-bit, decryption) More...
 
static void des3_set3key (uint32_t esk[96], uint32_t dsk[96], const unsigned char key[24])
 
int mbedtls_des3_set3key_enc (mbedtls_des3_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE *3])
 Triple-DES key schedule (168-bit, encryption) More...
 
int mbedtls_des3_set3key_dec (mbedtls_des3_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE *3])
 Triple-DES key schedule (168-bit, decryption) More...
 
int mbedtls_des_crypt_ecb (mbedtls_des_context *ctx, const unsigned char input[8], unsigned char output[8])
 DES-ECB block encryption/decryption. More...
 
int mbedtls_des_crypt_cbc (mbedtls_des_context *ctx, int mode, size_t length, unsigned char iv[8], const unsigned char *input, unsigned char *output)
 DES-CBC buffer encryption/decryption. More...
 
int mbedtls_des3_crypt_ecb (mbedtls_des3_context *ctx, const unsigned char input[8], unsigned char output[8])
 3DES-ECB block encryption/decryption More...
 
int mbedtls_des3_crypt_cbc (mbedtls_des3_context *ctx, int mode, size_t length, unsigned char iv[8], const unsigned char *input, unsigned char *output)
 3DES-CBC buffer encryption/decryption More...
 
int mbedtls_des_self_test (int verbose)
 Checkup routine. More...
 

Variables

static const uint32_t SB1 [64]
 
static const uint32_t SB2 [64]
 
static const uint32_t SB3 [64]
 
static const uint32_t SB4 [64]
 
static const uint32_t SB5 [64]
 
static const uint32_t SB6 [64]
 
static const uint32_t SB7 [64]
 
static const uint32_t SB8 [64]
 
static const uint32_t LHs [16]
 
static const uint32_t RHs [16]
 
static const unsigned char odd_parity_table [128]
 
static const unsigned char weak_key_table [WEAK_KEY_COUNT][MBEDTLS_DES_KEY_SIZE]
 
static const unsigned char des3_test_keys [24]
 
static const unsigned char des3_test_buf [8]
 
static const unsigned char des3_test_ecb_dec [3][8]
 
static const unsigned char des3_test_ecb_enc [3][8]
 
static const unsigned char des3_test_iv [8]
 
static const unsigned char des3_test_cbc_dec [3][8]
 
static const unsigned char des3_test_cbc_enc [3][8]
 

Macro Definition Documentation

◆ DES_FP

#define DES_FP (   X,
  Y 
)
Value:
{ \
X = ((X << 31) | (X >> 1)) & 0xFFFFFFFF; \
T = (X ^ Y) & 0xAAAAAAAA; X ^= T; Y ^= T; \
Y = ((Y << 31) | (Y >> 1)) & 0xFFFFFFFF; \
T = ((Y >> 8) ^ X) & 0x00FF00FF; X ^= T; Y ^= (T << 8); \
T = ((Y >> 2) ^ X) & 0x33333333; X ^= T; Y ^= (T << 2); \
T = ((X >> 16) ^ Y) & 0x0000FFFF; Y ^= T; X ^= (T << 16); \
T = ((X >> 4) ^ Y) & 0x0F0F0F0F; Y ^= T; X ^= (T << 4); \
}
#define T(x)
Unknown compiler Device disconnected from port File already exists Saving to backup buffer Got connection Public address Setting disk in tray You have left the game You have joined with input devices *s *s has joined as player u A netplay connection attempt failed because the peer is not running or is running an old version of RetroArch use the same version use the same version This core does not support inter architecture netplay Incorrect password A netplay client has disconnected You do not have permission to play The input devices requested are not available Netplay peer s paused Give hardware rendered cores their own private context Avoids having to assume hardware state changes inbetween frames Adjusts menu screen appearance settings Improves performance at the cost of latency and more video stuttering Use only if you cannot obtain full speed otherwise Autodetect Capabilities Connecting to port Password Username Accounts List Endpoint Achievements Scan Content Import content Ask Block Frames نظام تشغيل الصوت Audio Enable Turbo Deadzone Audio Maximum Timing Skew Audio Output Dynamic Audio Rate Control الصوت Audio Volume WASAPI Exclusive Mode WASAPI Shared Buffer Length Load Override Files Automatically Load Shader Presets Automatically Confirm Quit Scroll Up Toggle Keyboard Basic menu controls Info Scroll Up Toggle Keyboard Don t overwrite SaveRAM on loading savestate Buildbot Assets URL Allow Camera Cheat Cheat File Load Cheat File Cheat Passes Hardcore Mode Achievement Badges Locked Test Unofficial Achievements Unlocked Verbose Mode Config ملفات التكوين Collections Content Allow to remove entries Downloads Cheats Show core name Authors Core label Permissions System manufacturer Controls Options Start a Core Automatically Buildbot Cores URL Updater CPU Cursor Custom Ratio Database Selection Start directory< Default > Directory not found Disk Cycle Tray Status Disk Index Don t care Download Core DPI Override Enable أنظمة التشغيل Check for Missing Firmware Before Loading Dynamic Backgrounds Menu entry hover color False Favorites Limit Maximum Run Speed Frontend Counters Create game options file مساعدة Changing Virtual Gamepad Overlay مساعدة Scanning For Content History List Enable Horizontal Menu معلومات Analog To Digital Type Left Analog X Left analog Left Analog Y Left analog Y(down)") MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X
#define X(a, b)
Definition: bba.c:185

◆ DES_IP

#define DES_IP (   X,
  Y 
)
Value:
{ \
T = ((X >> 4) ^ Y) & 0x0F0F0F0F; Y ^= T; X ^= (T << 4); \
T = ((X >> 16) ^ Y) & 0x0000FFFF; Y ^= T; X ^= (T << 16); \
T = ((Y >> 2) ^ X) & 0x33333333; X ^= T; Y ^= (T << 2); \
T = ((Y >> 8) ^ X) & 0x00FF00FF; X ^= T; Y ^= (T << 8); \
Y = ((Y << 1) | (Y >> 31)) & 0xFFFFFFFF; \
T = (X ^ Y) & 0xAAAAAAAA; Y ^= T; X ^= T; \
X = ((X << 1) | (X >> 31)) & 0xFFFFFFFF; \
}
#define T(x)
Unknown compiler Device disconnected from port File already exists Saving to backup buffer Got connection Public address Setting disk in tray You have left the game You have joined with input devices *s *s has joined as player u A netplay connection attempt failed because the peer is not running or is running an old version of RetroArch use the same version use the same version This core does not support inter architecture netplay Incorrect password A netplay client has disconnected You do not have permission to play The input devices requested are not available Netplay peer s paused Give hardware rendered cores their own private context Avoids having to assume hardware state changes inbetween frames Adjusts menu screen appearance settings Improves performance at the cost of latency and more video stuttering Use only if you cannot obtain full speed otherwise Autodetect Capabilities Connecting to port Password Username Accounts List Endpoint Achievements Scan Content Import content Ask Block Frames نظام تشغيل الصوت Audio Enable Turbo Deadzone Audio Maximum Timing Skew Audio Output Dynamic Audio Rate Control الصوت Audio Volume WASAPI Exclusive Mode WASAPI Shared Buffer Length Load Override Files Automatically Load Shader Presets Automatically Confirm Quit Scroll Up Toggle Keyboard Basic menu controls Info Scroll Up Toggle Keyboard Don t overwrite SaveRAM on loading savestate Buildbot Assets URL Allow Camera Cheat Cheat File Load Cheat File Cheat Passes Hardcore Mode Achievement Badges Locked Test Unofficial Achievements Unlocked Verbose Mode Config ملفات التكوين Collections Content Allow to remove entries Downloads Cheats Show core name Authors Core label Permissions System manufacturer Controls Options Start a Core Automatically Buildbot Cores URL Updater CPU Cursor Custom Ratio Database Selection Start directory< Default > Directory not found Disk Cycle Tray Status Disk Index Don t care Download Core DPI Override Enable أنظمة التشغيل Check for Missing Firmware Before Loading Dynamic Backgrounds Menu entry hover color False Favorites Limit Maximum Run Speed Frontend Counters Create game options file مساعدة Changing Virtual Gamepad Overlay مساعدة Scanning For Content History List Enable Horizontal Menu معلومات Analog To Digital Type Left Analog X Left analog Left Analog Y Left analog Y(down)") MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X
#define X(a, b)
Definition: bba.c:185

◆ DES_ROUND

#define DES_ROUND (   X,
  Y 
)
Value:
{ \
T = *SK++ ^ X; \
Y ^= SB8[ (T ) & 0x3F ] ^ \
SB6[ (T >> 8) & 0x3F ] ^ \
SB4[ (T >> 16) & 0x3F ] ^ \
SB2[ (T >> 24) & 0x3F ]; \
\
T = *SK++ ^ ((X << 28) | (X >> 4)); \
Y ^= SB7[ (T ) & 0x3F ] ^ \
SB5[ (T >> 8) & 0x3F ] ^ \
SB3[ (T >> 16) & 0x3F ] ^ \
SB1[ (T >> 24) & 0x3F ]; \
}
#define T(x)
static const uint32_t SB1[64]
Definition: des.c:79
static const uint32_t SB7[64]
Definition: des.c:199
static const uint32_t SB6[64]
Definition: des.c:179
static const uint32_t SB5[64]
Definition: des.c:159
#define X(a, b)
Definition: bba.c:185
static const uint32_t SB2[64]
Definition: des.c:99
static const uint32_t SB8[64]
Definition: des.c:219

◆ GET_UINT32_BE

#define GET_UINT32_BE (   n,
  b,
 
)
Value:
{ \
(n) = ( (uint32_t) (b)[(i) ] << 24 ) \
| ( (uint32_t) (b)[(i) + 1] << 16 ) \
| ( (uint32_t) (b)[(i) + 2] << 8 ) \
| ( (uint32_t) (b)[(i) + 3] ); \
}
GLboolean GLboolean GLboolean b
Definition: glext.h:6844
GLdouble n
Definition: glext.h:8396
unsigned int uint32_t
Definition: stdint.h:126

◆ PUT_UINT32_BE

#define PUT_UINT32_BE (   n,
  b,
 
)
Value:
{ \
(b)[(i) ] = (unsigned char) ( (n) >> 24 ); \
(b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \
(b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \
(b)[(i) + 3] = (unsigned char) ( (n) ); \
}
GLboolean GLboolean GLboolean b
Definition: glext.h:6844
GLdouble n
Definition: glext.h:8396

◆ SWAP

#define SWAP (   a,
  b 
)    { uint32_t t = a; a = b; b = t; t = 0; }

◆ WEAK_KEY_COUNT

#define WEAK_KEY_COUNT   16

Function Documentation

◆ des3_set2key()

static void des3_set2key ( uint32_t  esk[96],
uint32_t  dsk[96],
const unsigned char  key[MBEDTLS_DES_KEY_SIZE *2] 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ des3_set3key()

static void des3_set3key ( uint32_t  esk[96],
uint32_t  dsk[96],
const unsigned char  key[24] 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_des3_crypt_cbc()

int mbedtls_des3_crypt_cbc ( mbedtls_des3_context ctx,
int  mode,
size_t  length,
unsigned char  iv[8],
const unsigned char *  input,
unsigned char *  output 
)

3DES-CBC buffer encryption/decryption

Note
Upon exit, the content of the IV is updated so that you can call the function same function again on the following block(s) of data and get the same result as if it was encrypted in one call. This allows a "streaming" usage. If on the other hand you need to retain the contents of the IV, you should either save it manually or use the cipher module instead.
Parameters
ctx3DES context
modeMBEDTLS_DES_ENCRYPT or MBEDTLS_DES_DECRYPT
lengthlength of the input data
ivinitialization vector (updated after use)
inputbuffer holding the input data
outputbuffer holding the output data
Returns
0 if successful, or MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_des3_crypt_ecb()

int mbedtls_des3_crypt_ecb ( mbedtls_des3_context ctx,
const unsigned char  input[8],
unsigned char  output[8] 
)

3DES-ECB block encryption/decryption

Parameters
ctx3DES context
input64-bit input block
output64-bit output block
Returns
0 if successful
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_des3_free()

void mbedtls_des3_free ( mbedtls_des3_context ctx)

Clear Triple-DES context.

Parameters
ctxDES3 context to be cleared
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_des3_init()

void mbedtls_des3_init ( mbedtls_des3_context ctx)

Initialize Triple-DES context.

Parameters
ctxDES3 context to be initialized
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_des3_set2key_dec()

int mbedtls_des3_set2key_dec ( mbedtls_des3_context ctx,
const unsigned char  key[MBEDTLS_DES_KEY_SIZE *2] 
)

Triple-DES key schedule (112-bit, decryption)

Parameters
ctx3DES context to be initialized
key16-byte secret key
Returns
0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_des3_set2key_enc()

int mbedtls_des3_set2key_enc ( mbedtls_des3_context ctx,
const unsigned char  key[MBEDTLS_DES_KEY_SIZE *2] 
)

Triple-DES key schedule (112-bit, encryption)

Parameters
ctx3DES context to be initialized
key16-byte secret key
Returns
0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_des3_set3key_dec()

int mbedtls_des3_set3key_dec ( mbedtls_des3_context ctx,
const unsigned char  key[MBEDTLS_DES_KEY_SIZE *3] 
)

Triple-DES key schedule (168-bit, decryption)

Parameters
ctx3DES context to be initialized
key24-byte secret key
Returns
0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_des3_set3key_enc()

int mbedtls_des3_set3key_enc ( mbedtls_des3_context ctx,
const unsigned char  key[MBEDTLS_DES_KEY_SIZE *3] 
)

Triple-DES key schedule (168-bit, encryption)

Parameters
ctx3DES context to be initialized
key24-byte secret key
Returns
0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_des_crypt_cbc()

int mbedtls_des_crypt_cbc ( mbedtls_des_context ctx,
int  mode,
size_t  length,
unsigned char  iv[8],
const unsigned char *  input,
unsigned char *  output 
)

DES-CBC buffer encryption/decryption.

Note
Upon exit, the content of the IV is updated so that you can call the function same function again on the following block(s) of data and get the same result as if it was encrypted in one call. This allows a "streaming" usage. If on the other hand you need to retain the contents of the IV, you should either save it manually or use the cipher module instead.
Parameters
ctxDES context
modeMBEDTLS_DES_ENCRYPT or MBEDTLS_DES_DECRYPT
lengthlength of the input data
ivinitialization vector (updated after use)
inputbuffer holding the input data
outputbuffer holding the output data
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_des_crypt_ecb()

int mbedtls_des_crypt_ecb ( mbedtls_des_context ctx,
const unsigned char  input[8],
unsigned char  output[8] 
)

DES-ECB block encryption/decryption.

Parameters
ctxDES context
input64-bit input block
output64-bit output block
Returns
0 if successful
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_des_free()

void mbedtls_des_free ( mbedtls_des_context ctx)

Clear DES context.

Parameters
ctxDES context to be cleared
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_des_init()

void mbedtls_des_init ( mbedtls_des_context ctx)

Initialize DES context.

Parameters
ctxDES context to be initialized
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_des_key_check_key_parity()

int mbedtls_des_key_check_key_parity ( const unsigned char  key[MBEDTLS_DES_KEY_SIZE])

Check that key parity on the given key is odd.

            DES keys are 56 bits long, but each byte is padded with
            a parity bit to allow verification.
Parameters
key8-byte secret key
Returns
0 is parity was ok, 1 if parity was not correct.

◆ mbedtls_des_key_check_weak()

int mbedtls_des_key_check_weak ( const unsigned char  key[MBEDTLS_DES_KEY_SIZE])

Check that key is not a weak or semi-weak DES key.

Parameters
key8-byte secret key
Returns
0 if no weak key was found, 1 if a weak key was identified.
Here is the call graph for this function:

◆ mbedtls_des_key_set_parity()

void mbedtls_des_key_set_parity ( unsigned char  key[MBEDTLS_DES_KEY_SIZE])

Set key parity on the given key to odd.

            DES keys are 56 bits long, but each byte is padded with
            a parity bit to allow verification.
Parameters
key8-byte secret key

◆ mbedtls_des_self_test()

int mbedtls_des_self_test ( int  verbose)

Checkup routine.

Returns
0 if successful, or 1 if the test failed
Here is the call graph for this function:

◆ mbedtls_des_setkey()

void mbedtls_des_setkey ( uint32_t  SK[32],
const unsigned char  key[MBEDTLS_DES_KEY_SIZE] 
)

Internal function for key expansion. (Only exposed to allow overriding it, see MBEDTLS_DES_SETKEY_ALT)

Parameters
SKRound keys
keyBase key
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_des_setkey_dec()

int mbedtls_des_setkey_dec ( mbedtls_des_context ctx,
const unsigned char  key[MBEDTLS_DES_KEY_SIZE] 
)

DES key schedule (56-bit, decryption)

Parameters
ctxDES context to be initialized
key8-byte secret key
Returns
0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_des_setkey_enc()

int mbedtls_des_setkey_enc ( mbedtls_des_context ctx,
const unsigned char  key[MBEDTLS_DES_KEY_SIZE] 
)

DES key schedule (56-bit, encryption)

Parameters
ctxDES context to be initialized
key8-byte secret key
Returns
0
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ des3_test_buf

const unsigned char des3_test_buf[8]
static
Initial value:
=
{
0x4E, 0x6F, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74
}

◆ des3_test_cbc_dec

const unsigned char des3_test_cbc_dec[3][8]
static
Initial value:
=
{
{ 0x12, 0x9F, 0x40, 0xB9, 0xD2, 0x00, 0x56, 0xB3 },
{ 0x47, 0x0E, 0xFC, 0x9A, 0x6B, 0x8E, 0xE3, 0x93 },
{ 0xC5, 0xCE, 0xCF, 0x63, 0xEC, 0xEC, 0x51, 0x4C }
}

◆ des3_test_cbc_enc

const unsigned char des3_test_cbc_enc[3][8]
static
Initial value:
=
{
{ 0x54, 0xF1, 0x5A, 0xF6, 0xEB, 0xE3, 0xA4, 0xB4 },
{ 0x35, 0x76, 0x11, 0x56, 0x5F, 0xA1, 0x8E, 0x4D },
{ 0xCB, 0x19, 0x1F, 0x85, 0xD1, 0xED, 0x84, 0x39 }
}

◆ des3_test_ecb_dec

const unsigned char des3_test_ecb_dec[3][8]
static
Initial value:
=
{
{ 0xCD, 0xD6, 0x4F, 0x2F, 0x94, 0x27, 0xC1, 0x5D },
{ 0x69, 0x96, 0xC8, 0xFA, 0x47, 0xA2, 0xAB, 0xEB },
{ 0x83, 0x25, 0x39, 0x76, 0x44, 0x09, 0x1A, 0x0A }
}

◆ des3_test_ecb_enc

const unsigned char des3_test_ecb_enc[3][8]
static
Initial value:
=
{
{ 0x6A, 0x2A, 0x19, 0xF4, 0x1E, 0xCA, 0x85, 0x4B },
{ 0x03, 0xE6, 0x9F, 0x5B, 0xFA, 0x58, 0xEB, 0x42 },
{ 0xDD, 0x17, 0xE8, 0xB8, 0xB4, 0x37, 0xD2, 0x32 }
}

◆ des3_test_iv

const unsigned char des3_test_iv[8]
static
Initial value:
=
{
0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF,
}

◆ des3_test_keys

const unsigned char des3_test_keys[24]
static
Initial value:
=
{
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0x01,
0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0x01, 0x23
}

◆ LHs

const uint32_t LHs[16]
static
Initial value:
=
{
0x00000000, 0x00000001, 0x00000100, 0x00000101,
0x00010000, 0x00010001, 0x00010100, 0x00010101,
0x01000000, 0x01000001, 0x01000100, 0x01000101,
0x01010000, 0x01010001, 0x01010100, 0x01010101
}

◆ odd_parity_table

const unsigned char odd_parity_table[128]
static
Initial value:
= { 1, 2, 4, 7, 8,
11, 13, 14, 16, 19, 21, 22, 25, 26, 28, 31, 32, 35, 37, 38, 41, 42, 44,
47, 49, 50, 52, 55, 56, 59, 61, 62, 64, 67, 69, 70, 73, 74, 76, 79, 81,
82, 84, 87, 88, 91, 93, 94, 97, 98, 100, 103, 104, 107, 109, 110, 112,
115, 117, 118, 121, 122, 124, 127, 128, 131, 133, 134, 137, 138, 140,
143, 145, 146, 148, 151, 152, 155, 157, 158, 161, 162, 164, 167, 168,
171, 173, 174, 176, 179, 181, 182, 185, 186, 188, 191, 193, 194, 196,
199, 200, 203, 205, 206, 208, 211, 213, 214, 217, 218, 220, 223, 224,
227, 229, 230, 233, 234, 236, 239, 241, 242, 244, 247, 248, 251, 253,
254 }

◆ RHs

const uint32_t RHs[16]
static
Initial value:
=
{
0x00000000, 0x01000000, 0x00010000, 0x01010000,
0x00000100, 0x01000100, 0x00010100, 0x01010100,
0x00000001, 0x01000001, 0x00010001, 0x01010001,
0x00000101, 0x01000101, 0x00010101, 0x01010101,
}

◆ SB1

const uint32_t SB1[64]
static
Initial value:
=
{
0x01010400, 0x00000000, 0x00010000, 0x01010404,
0x01010004, 0x00010404, 0x00000004, 0x00010000,
0x00000400, 0x01010400, 0x01010404, 0x00000400,
0x01000404, 0x01010004, 0x01000000, 0x00000004,
0x00000404, 0x01000400, 0x01000400, 0x00010400,
0x00010400, 0x01010000, 0x01010000, 0x01000404,
0x00010004, 0x01000004, 0x01000004, 0x00010004,
0x00000000, 0x00000404, 0x00010404, 0x01000000,
0x00010000, 0x01010404, 0x00000004, 0x01010000,
0x01010400, 0x01000000, 0x01000000, 0x00000400,
0x01010004, 0x00010000, 0x00010400, 0x01000004,
0x00000400, 0x00000004, 0x01000404, 0x00010404,
0x01010404, 0x00010004, 0x01010000, 0x01000404,
0x01000004, 0x00000404, 0x00010404, 0x01010400,
0x00000404, 0x01000400, 0x01000400, 0x00000000,
0x00010004, 0x00010400, 0x00000000, 0x01010004
}

◆ SB2

const uint32_t SB2[64]
static
Initial value:
=
{
0x80108020, 0x80008000, 0x00008000, 0x00108020,
0x00100000, 0x00000020, 0x80100020, 0x80008020,
0x80000020, 0x80108020, 0x80108000, 0x80000000,
0x80008000, 0x00100000, 0x00000020, 0x80100020,
0x00108000, 0x00100020, 0x80008020, 0x00000000,
0x80000000, 0x00008000, 0x00108020, 0x80100000,
0x00100020, 0x80000020, 0x00000000, 0x00108000,
0x00008020, 0x80108000, 0x80100000, 0x00008020,
0x00000000, 0x00108020, 0x80100020, 0x00100000,
0x80008020, 0x80100000, 0x80108000, 0x00008000,
0x80100000, 0x80008000, 0x00000020, 0x80108020,
0x00108020, 0x00000020, 0x00008000, 0x80000000,
0x00008020, 0x80108000, 0x00100000, 0x80000020,
0x00100020, 0x80008020, 0x80000020, 0x00100020,
0x00108000, 0x00000000, 0x80008000, 0x00008020,
0x80000000, 0x80100020, 0x80108020, 0x00108000
}

◆ SB3

const uint32_t SB3[64]
static
Initial value:
=
{
0x00000208, 0x08020200, 0x00000000, 0x08020008,
0x08000200, 0x00000000, 0x00020208, 0x08000200,
0x00020008, 0x08000008, 0x08000008, 0x00020000,
0x08020208, 0x00020008, 0x08020000, 0x00000208,
0x08000000, 0x00000008, 0x08020200, 0x00000200,
0x00020200, 0x08020000, 0x08020008, 0x00020208,
0x08000208, 0x00020200, 0x00020000, 0x08000208,
0x00000008, 0x08020208, 0x00000200, 0x08000000,
0x08020200, 0x08000000, 0x00020008, 0x00000208,
0x00020000, 0x08020200, 0x08000200, 0x00000000,
0x00000200, 0x00020008, 0x08020208, 0x08000200,
0x08000008, 0x00000200, 0x00000000, 0x08020008,
0x08000208, 0x00020000, 0x08000000, 0x08020208,
0x00000008, 0x00020208, 0x00020200, 0x08000008,
0x08020000, 0x08000208, 0x00000208, 0x08020000,
0x00020208, 0x00000008, 0x08020008, 0x00020200
}

◆ SB4

const uint32_t SB4[64]
static
Initial value:
=
{
0x00802001, 0x00002081, 0x00002081, 0x00000080,
0x00802080, 0x00800081, 0x00800001, 0x00002001,
0x00000000, 0x00802000, 0x00802000, 0x00802081,
0x00000081, 0x00000000, 0x00800080, 0x00800001,
0x00000001, 0x00002000, 0x00800000, 0x00802001,
0x00000080, 0x00800000, 0x00002001, 0x00002080,
0x00800081, 0x00000001, 0x00002080, 0x00800080,
0x00002000, 0x00802080, 0x00802081, 0x00000081,
0x00800080, 0x00800001, 0x00802000, 0x00802081,
0x00000081, 0x00000000, 0x00000000, 0x00802000,
0x00002080, 0x00800080, 0x00800081, 0x00000001,
0x00802001, 0x00002081, 0x00002081, 0x00000080,
0x00802081, 0x00000081, 0x00000001, 0x00002000,
0x00800001, 0x00002001, 0x00802080, 0x00800081,
0x00002001, 0x00002080, 0x00800000, 0x00802001,
0x00000080, 0x00800000, 0x00002000, 0x00802080
}

◆ SB5

const uint32_t SB5[64]
static
Initial value:
=
{
0x00000100, 0x02080100, 0x02080000, 0x42000100,
0x00080000, 0x00000100, 0x40000000, 0x02080000,
0x40080100, 0x00080000, 0x02000100, 0x40080100,
0x42000100, 0x42080000, 0x00080100, 0x40000000,
0x02000000, 0x40080000, 0x40080000, 0x00000000,
0x40000100, 0x42080100, 0x42080100, 0x02000100,
0x42080000, 0x40000100, 0x00000000, 0x42000000,
0x02080100, 0x02000000, 0x42000000, 0x00080100,
0x00080000, 0x42000100, 0x00000100, 0x02000000,
0x40000000, 0x02080000, 0x42000100, 0x40080100,
0x02000100, 0x40000000, 0x42080000, 0x02080100,
0x40080100, 0x00000100, 0x02000000, 0x42080000,
0x42080100, 0x00080100, 0x42000000, 0x42080100,
0x02080000, 0x00000000, 0x40080000, 0x42000000,
0x00080100, 0x02000100, 0x40000100, 0x00080000,
0x00000000, 0x40080000, 0x02080100, 0x40000100
}

◆ SB6

const uint32_t SB6[64]
static
Initial value:
=
{
0x20000010, 0x20400000, 0x00004000, 0x20404010,
0x20400000, 0x00000010, 0x20404010, 0x00400000,
0x20004000, 0x00404010, 0x00400000, 0x20000010,
0x00400010, 0x20004000, 0x20000000, 0x00004010,
0x00000000, 0x00400010, 0x20004010, 0x00004000,
0x00404000, 0x20004010, 0x00000010, 0x20400010,
0x20400010, 0x00000000, 0x00404010, 0x20404000,
0x00004010, 0x00404000, 0x20404000, 0x20000000,
0x20004000, 0x00000010, 0x20400010, 0x00404000,
0x20404010, 0x00400000, 0x00004010, 0x20000010,
0x00400000, 0x20004000, 0x20000000, 0x00004010,
0x20000010, 0x20404010, 0x00404000, 0x20400000,
0x00404010, 0x20404000, 0x00000000, 0x20400010,
0x00000010, 0x00004000, 0x20400000, 0x00404010,
0x00004000, 0x00400010, 0x20004010, 0x00000000,
0x20404000, 0x20000000, 0x00400010, 0x20004010
}

◆ SB7

const uint32_t SB7[64]
static
Initial value:
=
{
0x00200000, 0x04200002, 0x04000802, 0x00000000,
0x00000800, 0x04000802, 0x00200802, 0x04200800,
0x04200802, 0x00200000, 0x00000000, 0x04000002,
0x00000002, 0x04000000, 0x04200002, 0x00000802,
0x04000800, 0x00200802, 0x00200002, 0x04000800,
0x04000002, 0x04200000, 0x04200800, 0x00200002,
0x04200000, 0x00000800, 0x00000802, 0x04200802,
0x00200800, 0x00000002, 0x04000000, 0x00200800,
0x04000000, 0x00200800, 0x00200000, 0x04000802,
0x04000802, 0x04200002, 0x04200002, 0x00000002,
0x00200002, 0x04000000, 0x04000800, 0x00200000,
0x04200800, 0x00000802, 0x00200802, 0x04200800,
0x00000802, 0x04000002, 0x04200802, 0x04200000,
0x00200800, 0x00000000, 0x00000002, 0x04200802,
0x00000000, 0x00200802, 0x04200000, 0x00000800,
0x04000002, 0x04000800, 0x00000800, 0x00200002
}

◆ SB8

const uint32_t SB8[64]
static
Initial value:
=
{
0x10001040, 0x00001000, 0x00040000, 0x10041040,
0x10000000, 0x10001040, 0x00000040, 0x10000000,
0x00040040, 0x10040000, 0x10041040, 0x00041000,
0x10041000, 0x00041040, 0x00001000, 0x00000040,
0x10040000, 0x10000040, 0x10001000, 0x00001040,
0x00041000, 0x00040040, 0x10040040, 0x10041000,
0x00001040, 0x00000000, 0x00000000, 0x10040040,
0x10000040, 0x10001000, 0x00041040, 0x00040000,
0x00041040, 0x00040000, 0x10041000, 0x00001000,
0x00000040, 0x10040040, 0x00001000, 0x00041040,
0x10001000, 0x00000040, 0x10000040, 0x10040000,
0x10040040, 0x10000000, 0x00040000, 0x10001040,
0x00000000, 0x10041040, 0x00040040, 0x10000040,
0x10040000, 0x10001000, 0x10001040, 0x00000000,
0x10041040, 0x00041000, 0x00041000, 0x00001040,
0x00001040, 0x00040040, 0x10000000, 0x10041000
}

◆ weak_key_table

const unsigned char weak_key_table[WEAK_KEY_COUNT][MBEDTLS_DES_KEY_SIZE]
static
Initial value:
=
{
{ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
{ 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE },
{ 0x1F, 0x1F, 0x1F, 0x1F, 0x0E, 0x0E, 0x0E, 0x0E },
{ 0xE0, 0xE0, 0xE0, 0xE0, 0xF1, 0xF1, 0xF1, 0xF1 },
{ 0x01, 0x1F, 0x01, 0x1F, 0x01, 0x0E, 0x01, 0x0E },
{ 0x1F, 0x01, 0x1F, 0x01, 0x0E, 0x01, 0x0E, 0x01 },
{ 0x01, 0xE0, 0x01, 0xE0, 0x01, 0xF1, 0x01, 0xF1 },
{ 0xE0, 0x01, 0xE0, 0x01, 0xF1, 0x01, 0xF1, 0x01 },
{ 0x01, 0xFE, 0x01, 0xFE, 0x01, 0xFE, 0x01, 0xFE },
{ 0xFE, 0x01, 0xFE, 0x01, 0xFE, 0x01, 0xFE, 0x01 },
{ 0x1F, 0xE0, 0x1F, 0xE0, 0x0E, 0xF1, 0x0E, 0xF1 },
{ 0xE0, 0x1F, 0xE0, 0x1F, 0xF1, 0x0E, 0xF1, 0x0E },
{ 0x1F, 0xFE, 0x1F, 0xFE, 0x0E, 0xFE, 0x0E, 0xFE },
{ 0xFE, 0x1F, 0xFE, 0x1F, 0xFE, 0x0E, 0xFE, 0x0E },
{ 0xE0, 0xFE, 0xE0, 0xFE, 0xF1, 0xFE, 0xF1, 0xFE },
{ 0xFE, 0xE0, 0xFE, 0xE0, 0xFE, 0xF1, 0xFE, 0xF1 }
}