Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | rz_crypto_t |
struct | rz_crypto_plugin_t |
Macros | |
#define | RZ_CRYPTO_NONE 0ULL |
#define | RZ_CRYPTO_RC2 1ULL |
#define | RZ_CRYPTO_RC4 1ULL << 1 |
#define | RZ_CRYPTO_RC6 1ULL << 2 |
#define | RZ_CRYPTO_AES_ECB 1ULL << 3 |
#define | RZ_CRYPTO_AES_CBC 1ULL << 4 |
#define | RZ_CRYPTO_ROR 1ULL << 5 |
#define | RZ_CRYPTO_ROL 1ULL << 6 |
#define | RZ_CRYPTO_ROT 1ULL << 7 |
#define | RZ_CRYPTO_BLOWFISH 1ULL << 8 |
#define | RZ_CRYPTO_CPS2 1ULL << 9 |
#define | RZ_CRYPTO_DES_ECB 1ULL << 10 |
#define | RZ_CRYPTO_XOR 1ULL << 11 |
#define | RZ_CRYPTO_SERPENT 1ULL << 12 |
#define | RZ_CRYPTO_ALL 0xFFFF |
#define | RZ_CODEC_NONE 0ULL |
#define | RZ_CODEC_B64 1ULL |
#define | RZ_CODEC_B91 1ULL << 1 |
#define | RZ_CODEC_PUNYCODE 1ULL << 2 |
#define | RZ_CODEC_ALL 0xFFFF |
Typedefs | |
typedef struct rz_crypto_t | RzCrypto |
typedef struct rz_crypto_plugin_t | RzCryptoPlugin |
typedef ut64 | RzCryptoSelector |
Enumerations | |
enum | { RZ_CRYPTO_MODE_ECB , RZ_CRYPTO_MODE_CBC , RZ_CRYPTO_MODE_OFB , RZ_CRYPTO_MODE_CFB } |
enum | { RZ_CRYPTO_DIR_ENCRYPT = 0 , RZ_CRYPTO_DIR_DECRYPT } |
Functions | |
RZ_LIB_VERSION_HEADER (rz_crypto) | |
RZ_API int | rz_crypto_add (RzCrypto *cry, RzCryptoPlugin *h) |
RZ_API RzCrypto * | rz_crypto_new (void) |
RZ_API void | rz_crypto_free (RzCrypto *cry) |
RZ_API bool | rz_crypto_use (RzCrypto *cry, const char *algo) |
RZ_API bool | rz_crypto_set_key (RzCrypto *cry, const ut8 *key, int keylen, int mode, int direction) |
RZ_API bool | rz_crypto_set_iv (RzCrypto *cry, const ut8 *iv, int ivlen) |
RZ_API int | rz_crypto_update (RzCrypto *cry, const ut8 *buf, int len) |
RZ_API int | rz_crypto_final (RzCrypto *cry, const ut8 *buf, int len) |
RZ_API int | rz_crypto_append (RzCrypto *cry, const ut8 *buf, int len) |
RZ_API const ut8 * | rz_crypto_get_output (RzCrypto *cry, int *size) |
RZ_API const char * | rz_crypto_name (const RzCryptoSelector bit) |
RZ_API const char * | rz_crypto_codec_name (const RzCryptoSelector bit) |
RZ_API const RzCryptoPlugin * | rz_crypto_plugin_by_index (size_t index) |
#define RZ_CODEC_ALL 0xFFFF |
Definition at line 110 of file rz_crypto.h.
#define RZ_CODEC_B64 1ULL |
Definition at line 107 of file rz_crypto.h.
#define RZ_CODEC_B91 1ULL << 1 |
Definition at line 108 of file rz_crypto.h.
#define RZ_CODEC_NONE 0ULL |
Definition at line 106 of file rz_crypto.h.
#define RZ_CODEC_PUNYCODE 1ULL << 2 |
Definition at line 109 of file rz_crypto.h.
#define RZ_CRYPTO_AES_CBC 1ULL << 4 |
Definition at line 95 of file rz_crypto.h.
#define RZ_CRYPTO_AES_ECB 1ULL << 3 |
Definition at line 94 of file rz_crypto.h.
#define RZ_CRYPTO_ALL 0xFFFF |
Definition at line 104 of file rz_crypto.h.
#define RZ_CRYPTO_BLOWFISH 1ULL << 8 |
Definition at line 99 of file rz_crypto.h.
#define RZ_CRYPTO_CPS2 1ULL << 9 |
Definition at line 100 of file rz_crypto.h.
#define RZ_CRYPTO_DES_ECB 1ULL << 10 |
Definition at line 101 of file rz_crypto.h.
#define RZ_CRYPTO_NONE 0ULL |
Definition at line 90 of file rz_crypto.h.
#define RZ_CRYPTO_RC2 1ULL |
Definition at line 91 of file rz_crypto.h.
#define RZ_CRYPTO_RC4 1ULL << 1 |
Definition at line 92 of file rz_crypto.h.
#define RZ_CRYPTO_RC6 1ULL << 2 |
Definition at line 93 of file rz_crypto.h.
#define RZ_CRYPTO_ROL 1ULL << 6 |
Definition at line 97 of file rz_crypto.h.
#define RZ_CRYPTO_ROR 1ULL << 5 |
Definition at line 96 of file rz_crypto.h.
#define RZ_CRYPTO_ROT 1ULL << 7 |
Definition at line 98 of file rz_crypto.h.
#define RZ_CRYPTO_SERPENT 1ULL << 12 |
Definition at line 103 of file rz_crypto.h.
#define RZ_CRYPTO_XOR 1ULL << 11 |
Definition at line 102 of file rz_crypto.h.
typedef struct rz_crypto_t RzCrypto |
typedef struct rz_crypto_plugin_t RzCryptoPlugin |
typedef ut64 RzCryptoSelector |
Definition at line 54 of file rz_crypto.h.
anonymous enum |
Enumerator | |
---|---|
RZ_CRYPTO_MODE_ECB | |
RZ_CRYPTO_MODE_CBC | |
RZ_CRYPTO_MODE_OFB | |
RZ_CRYPTO_MODE_CFB |
Definition at line 14 of file rz_crypto.h.
anonymous enum |
RZ_API int rz_crypto_add | ( | RzCrypto * | cry, |
RzCryptoPlugin * | h | ||
) |
Definition at line 72 of file crypto.c.
References h, rz_crypto_t::plugins, and rz_list_append().
Referenced by rz_crypto_new().
Definition at line 175 of file crypto.c.
References len, memcpy(), rz_crypto_t::output, rz_crypto_t::output_len, rz_crypto_t::output_size, realloc(), and rz_warn_if_reached.
Referenced by update().
RZ_API const char* rz_crypto_codec_name | ( | const RzCryptoSelector | bit | ) |
Definition at line 54 of file crypto.c.
References bit, codec_name_bytes, i, and RZ_ARRAY_SIZE.
Definition at line 170 of file crypto.c.
References rz_crypto_plugin_t::final, rz_crypto_t::h, and len.
Referenced by _decrypt(), _encrypt(), calculate_decrypt(), calculate_encrypt(), and encrypt_or_decrypt_block().
Definition at line 116 of file crypto.c.
References rz_crypto_plugin_t::fini, free(), rz_crypto_t::h, rz_crypto_t::iv, rz_crypto_t::key, rz_crypto_plugin_t::name, rz_crypto_t::output, rz_crypto_t::plugins, rz_list_free(), and RZ_LOG_ERROR.
Referenced by _decrypt(), _encrypt(), calculate_decrypt(), calculate_encrypt(), encrypt_or_decrypt_block(), and rz_crypto_new().
Definition at line 193 of file crypto.c.
References NULL, rz_crypto_t::output, rz_crypto_t::output_len, and rz_crypto_t::output_size.
Referenced by _decrypt(), _encrypt(), calculate_decrypt(), calculate_encrypt(), and encrypt_or_decrypt_block().
RZ_API const char* rz_crypto_name | ( | const RzCryptoSelector | bit | ) |
Definition at line 44 of file crypto.c.
References bit, crypto_name_bytes, i, and RZ_ARRAY_SIZE.
Definition at line 83 of file crypto.c.
References crypto_static_plugins, free(), i, malloc(), memcpy(), NULL, rz_crypto_t::output, rz_crypto_t::output_size, p, rz_crypto_t::plugins, RZ_ARRAY_SIZE, rz_crypto_add(), rz_crypto_free(), RZ_CRYPTO_OUTPUT_SIZE, rz_list_newf(), RZ_LOG_ERROR, and RZ_NEW0.
Referenced by _decrypt(), _encrypt(), calculate_decrypt(), calculate_encrypt(), and encrypt_or_decrypt_block().
RZ_API const RzCryptoPlugin* rz_crypto_plugin_by_index | ( | size_t | index | ) |
Definition at line 64 of file crypto.c.
References crypto_static_plugins, NULL, and RZ_ARRAY_SIZE.
Referenced by rz_hash_show_algorithms().
Definition at line 161 of file crypto.c.
References rz_crypto_t::h, and rz_crypto_plugin_t::set_iv.
Referenced by _decrypt(), _encrypt(), calculate_decrypt(), calculate_encrypt(), and encrypt_or_decrypt_block().
RZ_API bool rz_crypto_set_key | ( | RzCrypto * | cry, |
const ut8 * | key, | ||
int | keylen, | ||
int | mode, | ||
int | direction | ||
) |
Definition at line 151 of file crypto.c.
References rz_crypto_t::h, key, and rz_crypto_plugin_t::set_key.
Referenced by _decrypt(), _encrypt(), calculate_decrypt(), calculate_encrypt(), and encrypt_or_decrypt_block().
Definition at line 166 of file crypto.c.
References rz_crypto_t::h, len, and rz_crypto_plugin_t::update.
Referenced by calculate_decrypt(), calculate_encrypt(), and encrypt_or_decrypt_block().
Definition at line 130 of file crypto.c.
References rz_crypto_plugin_t::fini, rz_crypto_t::h, h, rz_crypto_plugin_t::name, rz_crypto_t::plugins, RZ_LOG_ERROR, and rz_warn_if_fail.
Referenced by _decrypt(), _encrypt(), calculate_decrypt(), calculate_encrypt(), and encrypt_or_decrypt_block().
RZ_LIB_VERSION_HEADER | ( | rz_crypto | ) |
|
extern |
Definition at line 161 of file crypto_aes.c.
|
extern |
Definition at line 188 of file crypto_aes_cbc.c.
|
extern |
Definition at line 60 of file crypto_base64.c.
|
extern |
Definition at line 53 of file crypto_base91.c.
|
extern |
Definition at line 348 of file crypto_blowfish.c.
|
extern |
Definition at line 2954 of file crypto_cps2.c.
|
extern |
Definition at line 183 of file crypto_des.c.
|
extern |
Definition at line 42 of file crypto_punycode.c.
|
extern |
Definition at line 257 of file crypto_rc2.c.
|
extern |
Definition at line 126 of file crypto_rc4.c.
|
extern |
Definition at line 219 of file crypto_rc6.c.
|
extern |
Definition at line 89 of file crypto_rol.c.
|
extern |
Definition at line 89 of file crypto_ror.c.
|
extern |
Definition at line 115 of file crypto_rot.c.
|
extern |
Definition at line 124 of file crypto_serpent.c.
|
extern |
Definition at line 90 of file crypto_xor.c.