134 uint64_t * ks, uint64_t val
int hamming_weight(uint64_t val)
Returns the Hamming weight of a 64 bits word.
uint64_t des_n_p(uint64_t val)
Inverse of P permutation (32 to 32 bits).
uint64_t des_n_pc1(uint64_t val)
Inverse of PC1 permutation - selection (56 to 64 bits).
uint8_t left_shifts[16]
Number of left shifts per round.
int hamming_distance(uint64_t val1, uint64_t val2)
Returns the Hamming distance between two 64 bits words.
uint64_t des_n_e(uint64_t val)
Inverse of E expansion - permutation (48 to 32 bits).
uint64_t des_n_fp(uint64_t val)
Inverse of final permutation (64 to 64 bits).
uint64_t des_f(uint64_t rk, uint64_t val)
The F function of the standard (48+32 bits to 32 bits).
uint64_t des_n_pc2(uint64_t val)
Inverse of PC2 permutation - selection (48 to 56 bits).
uint64_t des_enc(uint64_t *ks, uint64_t val)
Enciphers a 64 bits plaintext with a pre-computed key schedule.
uint64_t des_e(uint64_t val)
E expansion - permutation (32 to 48 bits).
uint64_t des_pc2(uint64_t val)
PC2 permutation - selection (56 to 48 bits).
uint64_t des_ip(uint64_t val)
Initial permutation (64 to 64 bits).
uint64_t des_sboxes(uint64_t val)
All SBoxes computation (48 to 32 bits).
uint64_t des_rs(uint64_t val)
Applies the right shift rotation of the standard (56 to 56 bits).
uint64_t des_pc1(uint64_t val)
PC1 permutation - selection (64 to 56 bits).
void des_ks(uint64_t *ks, uint64_t val)
Computes the whole key schedule from a 64 bits secret key and stores the sixteen 48 bits round keys i...
uint64_t des_dec(uint64_t *ks, uint64_t val)
Deciphers a 64 bits plaintext with a pre-computed key schedule.
uint64_t des_n_ip(uint64_t val)
Inverse of initial permutation (64 to 64 bits).
uint64_t des_fp(uint64_t val)
Final permutation (64 to 64 bits).
uint64_t des_sbox(int sbox, uint64_t val)
Single SBox computation (6 to 4 bits).
int des_check(void)
A functional verification of the DES implementation.
uint64_t des_right_half(uint64_t val)
Returns the 32 bits right half of a 64 bits word.
uint64_t des_set_parity_bits(uint64_t val)
Computes the 8 parity bits of a 64 bits word.
uint64_t des_p(uint64_t val)
P permutation (32 to 32 bits).
uint64_t des_left_half(uint64_t val)
Returns the 32 bits left half of a 64 bits word.
uint64_t des_ls(uint64_t val)
Applies the left shift rotation of the standard (56 to 56 bits).