Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | sbox |
struct | optimised_sbox |
Macros | |
#define | UPPER_LIMIT 0x400000 |
#define | BIT(x, n) (((x) >> (n)) & 1) |
#define | BITSWAP8(val, B7, B6, B5, B4, B3, B2, B1, B0) |
Functions | |
static ut8 | fn (ut8 in, const struct optimised_sbox *sboxes, ut32 key) |
static void | expand_1st_key (ut32 *dstkey, const ut32 *srckey) |
static void | expand_2nd_key (ut32 *dstkey, const ut32 *srckey) |
static void | expand_subkey (ut32 *subkey, ut16 seed) |
static ut16 | feistel (ut16 val, const int *bitsA, const int *bitsB, const struct optimised_sbox *boxes1, const struct optimised_sbox *boxes2, const struct optimised_sbox *boxes3, const struct optimised_sbox *boxes4, ut32 key1, ut32 key2, ut32 key3, ut32 key4) |
static int | extract_inputs (ut32 val, const int *inputs) |
static void | optimise_sboxes (struct optimised_sbox *out, const struct sbox *in) |
static void | cps2_crypt (int dir, const ut16 *rom, ut16 *dec, int length, const ut32 *master_key, ut32 upper_limit) |
static bool | set_key (RzCrypto *cry, const ut8 *key, int keylen, int mode, int direction) |
static int | get_key_size (RzCrypto *cry) |
static bool | cps2_use (const char *algo) |
static bool | update (RzCrypto *cry, const ut8 *buf, int len) |
static bool | cps2_init (RzCrypto *cry) |
static bool | cps2_fini (RzCrypto *cry) |
Variables | |
static const int | fn1_groupA [8] = { 10, 4, 6, 7, 2, 13, 15, 14 } |
static const int | fn1_groupB [8] = { 0, 1, 3, 5, 8, 9, 11, 12 } |
static const int | fn2_groupA [8] = { 6, 0, 2, 13, 1, 4, 14, 7 } |
static const int | fn2_groupB [8] = { 3, 5, 9, 10, 8, 15, 12, 11 } |
static const struct sbox | fn1_r1_boxes [4] |
static const struct sbox | fn1_rz_boxes [4] |
static const struct sbox | fn1_r3_boxes [4] |
static const struct sbox | fn1_r4_boxes [4] |
static const struct sbox | fn2_r1_boxes [4] |
static const struct sbox | fn2_rz_boxes [4] |
static const struct sbox | fn2_r3_boxes [4] |
static const struct sbox | fn2_r4_boxes [4] |
RzCryptoPlugin | rz_crypto_plugin_cps2 |
RZ_API RzLibStruct | rizin_plugin |
Definition at line 11 of file crypto_cps2.c.
#define UPPER_LIMIT 0x400000 |
Definition at line 7 of file crypto_cps2.c.
|
static |
Definition at line 2777 of file crypto_cps2.c.
References a, BIT, eprintf, expand_1st_key(), expand_2nd_key(), expand_subkey(), feistel(), fn1_groupA, fn1_groupB, fn1_r1_boxes, fn1_r3_boxes, fn1_r4_boxes, fn1_rz_boxes, fn2_groupA, fn2_groupB, fn2_r1_boxes, fn2_r3_boxes, fn2_r4_boxes, fn2_rz_boxes, i, length, and optimise_sboxes().
Referenced by update().
Definition at line 2947 of file crypto_cps2.c.
References free(), rz_return_val_if_fail, and rz_crypto_t::user.
Definition at line 2940 of file crypto_cps2.c.
References NULL, RZ_NEWS0, rz_return_val_if_fail, and rz_crypto_t::user.
Definition at line 2908 of file crypto_cps2.c.
Definition at line 2410 of file crypto_cps2.c.
References BIT, bits(), and i.
Referenced by cps2_crypt().
Definition at line 2523 of file crypto_cps2.c.
References BIT, bits(), and i.
Referenced by cps2_crypt().
Definition at line 2637 of file crypto_cps2.c.
References BIT, bits(), and i.
Referenced by cps2_crypt().
|
inlinestatic |
Definition at line 2715 of file crypto_cps2.c.
References BIT, BITSWAP8, fn(), r, and val.
Referenced by cps2_crypt().
|
static |
Definition at line 2396 of file crypto_cps2.c.
References in, key, sbox1, sbox2, sbox3, and sbox4.
Referenced by feistel().
Definition at line 2903 of file crypto_cps2.c.
|
static |
Definition at line 2755 of file crypto_cps2.c.
References extract_inputs(), i, in, and out.
Referenced by cps2_crypt().
Definition at line 2888 of file crypto_cps2.c.
References rz_crypto_t::dir, if(), key, rz_read_be32(), rz_return_val_if_fail, and rz_crypto_t::user.
Definition at line 2912 of file crypto_cps2.c.
References cps2_crypt(), rz_crypto_t::dir, free(), i, input(), len, output, rz_crypto_append(), RZ_NEWS0, rz_read_at_le16(), rz_return_val_if_fail, rz_write_at_le16(), UPPER_LIMIT, and rz_crypto_t::user.
Definition at line 134 of file crypto_cps2.c.
Referenced by cps2_crypt().
Definition at line 135 of file crypto_cps2.c.
Referenced by cps2_crypt().
Definition at line 138 of file crypto_cps2.c.
Referenced by cps2_crypt().
Definition at line 138 of file crypto_cps2.c.
Referenced by cps2_crypt().
Definition at line 138 of file crypto_cps2.c.
Referenced by cps2_crypt().
Definition at line 138 of file crypto_cps2.c.
Referenced by cps2_crypt().
Definition at line 137 of file crypto_cps2.c.
Referenced by cps2_crypt().
Definition at line 138 of file crypto_cps2.c.
Referenced by cps2_crypt().
Definition at line 138 of file crypto_cps2.c.
Referenced by cps2_crypt().
Definition at line 138 of file crypto_cps2.c.
Referenced by cps2_crypt().
Definition at line 138 of file crypto_cps2.c.
Referenced by cps2_crypt().
Definition at line 138 of file crypto_cps2.c.
Referenced by cps2_crypt().
RZ_API RzLibStruct rizin_plugin |
Definition at line 2967 of file crypto_cps2.c.
RzCryptoPlugin rz_crypto_plugin_cps2 |
Definition at line 2954 of file crypto_cps2.c.