Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Functions | |
static void | rotr (ut32 *x, int s) |
static void | rotl (ut32 *x, int s) |
static ut8 | apply_sbox (int si, ut8 x) |
static ut8 | apply_sbox_inv (int si, ut8 x) |
static ut8 | get_bit (int i, ut32 input) |
void | apply_IP (ut32 in[DW_BY_BLOCK], ut32 out[DW_BY_BLOCK]) |
void | apply_FP (ut32 in[DW_BY_BLOCK], ut32 out[DW_BY_BLOCK]) |
void | serpent_keyschedule (const serpent_state_t *st, ut32 subkeys[NB_SUBKEYS *DW_BY_BLOCK]) |
void | apply_xor (ut32 block[DW_BY_BLOCK], ut32 subkey[DW_BY_BLOCK]) |
void | apply_permut (ut32 block[DW_BY_BLOCK]) |
void | apply_permut_inv (ut32 block[DW_BY_BLOCK]) |
void | apply_round (int round, ut32 block[DW_BY_BLOCK], ut32 subkeys[DW_BY_BLOCK *NB_SUBKEYS]) |
void | apply_round_inv (int round, ut32 block[DW_BY_BLOCK], ut32 subkeys[DW_BY_BLOCK *NB_SUBKEYS]) |
void | serpent_encrypt (serpent_state_t *st, ut32 in[DW_BY_BLOCK], ut32 out[DW_BY_BLOCK]) |
void | serpent_decrypt (serpent_state_t *st, ut32 in[DW_BY_BLOCK], ut32 out[DW_BY_BLOCK]) |
Variables | |
static const ut8 | S [][16] |
static const ut8 | Sinv [][16] |
static const ut8 | IPTable [] |
static const ut8 | FPTable [] |
Definition at line 84 of file crypto_serpent_algo.c.
References DW_BY_BLOCK, FPTable, get_bit(), i, in, and out.
Referenced by apply_permut(), apply_permut_inv(), serpent_decrypt(), and serpent_encrypt().
Definition at line 75 of file crypto_serpent_algo.c.
References DW_BY_BLOCK, get_bit(), i, in, IPTable, and out.
Referenced by apply_permut(), apply_permut_inv(), serpent_decrypt(), serpent_encrypt(), and serpent_keyschedule().
void apply_permut | ( | ut32 | block[DW_BY_BLOCK] | ) |
Definition at line 145 of file crypto_serpent_algo.c.
References apply_FP(), apply_IP(), DW_BY_BLOCK, and rotl().
Referenced by apply_round().
void apply_permut_inv | ( | ut32 | block[DW_BY_BLOCK] | ) |
Definition at line 161 of file crypto_serpent_algo.c.
References apply_FP(), apply_IP(), DW_BY_BLOCK, and rotr().
Referenced by apply_round_inv().
Definition at line 177 of file crypto_serpent_algo.c.
References apply_permut(), apply_sbox(), apply_xor(), DW_BY_BLOCK, i, and NB_ROUNDS.
Referenced by serpent_encrypt().
Definition at line 198 of file crypto_serpent_algo.c.
References apply_permut_inv(), apply_sbox_inv(), apply_xor(), DW_BY_BLOCK, i, and NB_ROUNDS.
Referenced by serpent_decrypt().
Definition at line 60 of file crypto_serpent_algo.c.
Referenced by apply_round(), and serpent_keyschedule().
Definition at line 138 of file crypto_serpent_algo.c.
References DW_BY_BLOCK, and i.
Referenced by apply_round(), and apply_round_inv().
Definition at line 70 of file crypto_serpent_algo.c.
References i, input(), and rz_return_val_if_fail.
Referenced by apply_FP(), apply_IP(), and serpent_keyschedule().
Definition at line 55 of file crypto_serpent_algo.c.
Referenced by apply_permut(), and serpent_keyschedule().
Definition at line 51 of file crypto_serpent_algo.c.
Referenced by apply_permut_inv().
void serpent_decrypt | ( | serpent_state_t * | st, |
ut32 | in[DW_BY_BLOCK], | ||
ut32 | out[DW_BY_BLOCK] | ||
) |
Definition at line 235 of file crypto_serpent_algo.c.
References apply_FP(), apply_IP(), apply_round_inv(), DW_BY_BLOCK, i, in, NB_ROUNDS, NB_SUBKEYS, out, and serpent_keyschedule().
Referenced by update().
void serpent_encrypt | ( | serpent_state_t * | st, |
ut32 | in[DW_BY_BLOCK], | ||
ut32 | out[DW_BY_BLOCK] | ||
) |
Definition at line 220 of file crypto_serpent_algo.c.
References apply_FP(), apply_IP(), apply_round(), DW_BY_BLOCK, i, in, NB_ROUNDS, NB_SUBKEYS, out, and serpent_keyschedule().
Referenced by update().
void serpent_keyschedule | ( | const serpent_state_t * | st, |
ut32 | subkeys[NB_SUBKEYS *DW_BY_BLOCK] | ||
) |
Definition at line 93 of file crypto_serpent_algo.c.
References apply_IP(), apply_sbox(), DW_BY_BLOCK, DW_BY_USERKEY, get_bit(), i, in, serpent_state::key, serpent_state::key_size, memcpy(), NB_SUBKEYS, NIBBLES_BY_SUBKEY, out, rotl(), rz_return_if_fail, and si.
Referenced by serpent_decrypt(), and serpent_encrypt().
Definition at line 40 of file crypto_serpent_algo.c.
Referenced by apply_FP().
Definition at line 29 of file crypto_serpent_algo.c.
Referenced by apply_IP().
Definition at line 7 of file crypto_serpent_algo.c.
Referenced by apply_sbox().
Definition at line 18 of file crypto_serpent_algo.c.
Referenced by apply_sbox_inv().