Go to the source code of this file.
Functions | |
| static uint64_t | shuffle (uint64_t in, const uint8_t *shuffle, int shuffle_len) |
| static uint64_t | shuffle_inv (uint64_t in, const uint8_t *shuffle, int shuffle_len) |
| static uint32_t | f_func (uint32_t r, uint64_t k) |
| static uint64_t | key_shift_left (uint64_t CDn) |
| rotate the two halves of the expanded 56 bit key each 1 bit left | |
| uint64_t | ff_des_encdec (uint64_t in, uint64_t key, int decrypt) |
| en- or decrypt an 64-bit block of data with DES | |
| static uint64_t | rand64 (void) |
| int | main (void) |
Variables | |
| static const uint8_t | IP_shuffle [] |
| static const uint8_t | P_shuffle [] |
| static const uint8_t | PC1_shuffle [] |
| static const uint8_t | PC2_shuffle [] |
| static const uint8_t | S_boxes [8][32] |
| static const uint32_t | S_boxes_P_shuffle [8][64] |
| This table contains the results of applying both the S-box and P-shuffle. | |
Definition at line 193 of file des.c.
Referenced by f_func(), ff_des_encdec(), main(), and LCDProcClient::outputMusic().
rotate the two halves of the expanded 56 bit key each 1 bit left
Note: the specification calls this "shift", so I kept it although it is confusing.
Definition at line 243 of file des.c.
Referenced by ff_des_encdec().
en- or decrypt an 64-bit block of data with DES
| in | data to process. | |
| key | key to use for en-/decryption. | |
| decrypt | if 0 encrypt, else decrypt. |
Definition at line 251 of file des.c.
Referenced by ff_asfcrypt_dec(), and main().
| static uint64_t rand64 | ( | void | ) | [static] |
const uint8_t IP_shuffle[] [static] |
Initial value:
{
T(58, 50, 42, 34, 26, 18, 10, 2),
T(60, 52, 44, 36, 28, 20, 12, 4),
T(62, 54, 46, 38, 30, 22, 14, 6),
T(64, 56, 48, 40, 32, 24, 16, 8),
T(57, 49, 41, 33, 25, 17, 9, 1),
T(59, 51, 43, 35, 27, 19, 11, 3),
T(61, 53, 45, 37, 29, 21, 13, 5),
T(63, 55, 47, 39, 31, 23, 15, 7)
}
Definition at line 25 of file des.c.
Referenced by ff_des_encdec().
const uint8_t P_shuffle[] [static] |
const uint8_t PC1_shuffle[] [static] |
Initial value:
{
T(57, 49, 41, 33, 25, 17, 9),
T( 1, 58, 50, 42, 34, 26, 18),
T(10, 2, 59, 51, 43, 35, 27),
T(19, 11, 3, 60, 52, 44, 36),
T(63, 55, 47, 39, 31, 23, 15),
T( 7, 62, 54, 46, 38, 30, 22),
T(14, 6, 61, 53, 45, 37, 29),
T(21, 13, 5, 28, 20, 12, 4)
}
Definition at line 51 of file des.c.
Referenced by ff_des_encdec().
const uint8_t PC2_shuffle[] [static] |
const uint8_t S_boxes[8][32] [static] |
Initial value:
{
{
0x0e, 0xf4, 0x7d, 0x41, 0xe2, 0x2f, 0xdb, 0x18, 0xa3, 0x6a, 0xc6, 0xbc, 0x95, 0x59, 0x30, 0x87,
0xf4, 0xc1, 0x8e, 0x28, 0x4d, 0x96, 0x12, 0x7b, 0x5f, 0xbc, 0x39, 0xe7, 0xa3, 0x0a, 0x65, 0xd0,
}, {
0x3f, 0xd1, 0x48, 0x7e, 0xf6, 0x2b, 0x83, 0xe4, 0xc9, 0x07, 0x12, 0xad, 0x6c, 0x90, 0xb5, 0x5a,
0xd0, 0x8e, 0xa7, 0x1b, 0x3a, 0xf4, 0x4d, 0x21, 0xb5, 0x68, 0x7c, 0xc6, 0x09, 0x53, 0xe2, 0x9f,
}, {
0xda, 0x70, 0x09, 0x9e, 0x36, 0x43, 0x6f, 0xa5, 0x21, 0x8d, 0x5c, 0xe7, 0xcb, 0xb4, 0xf2, 0x18,
0x1d, 0xa6, 0xd4, 0x09, 0x68, 0x9f, 0x83, 0x70, 0x4b, 0xf1, 0xe2, 0x3c, 0xb5, 0x5a, 0x2e, 0xc7,
}, {
0xd7, 0x8d, 0xbe, 0x53, 0x60, 0xf6, 0x09, 0x3a, 0x41, 0x72, 0x28, 0xc5, 0x1b, 0xac, 0xe4, 0x9f,
0x3a, 0xf6, 0x09, 0x60, 0xac, 0x1b, 0xd7, 0x8d, 0x9f, 0x41, 0x53, 0xbe, 0xc5, 0x72, 0x28, 0xe4,
}, {
0xe2, 0xbc, 0x24, 0x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