diff --git a/libr/crypto/crypto.c b/libr/crypto/crypto.c index 1801dfa63be5c..168533b0bce95 100644 --- a/libr/crypto/crypto.c +++ b/libr/crypto/crypto.c @@ -3,7 +3,7 @@ #include #include #include -#include "r_util/r_assert.h" +#include R_LIB_VERSION (r_crypto); @@ -188,10 +188,8 @@ R_API ut8 *r_crypto_job_get_output(RCryptoJob *cj, int *size) { static inline void print_plugin_verbose(RCryptoPlugin *cp, PrintfCallback cb_printf) { const char type = cp->type? cp->type: 'c'; - const char *license = cp->meta.license? cp->meta.license: "LGPL"; const char *desc = r_str_get (cp->meta.desc); - const char *author = r_str_get (cp->meta.author); - cb_printf ("%c %12s %5s %s %s\n", type, cp->meta.name, license, desc, author); + cb_printf ("%c %12s %s\n", type, cp->meta.name, desc); } R_API void r_crypto_list(RCrypto *cry, R_NULLABLE PrintfCallback cb_printf, int mode) { diff --git a/libr/crypto/p/crypto_aes.c b/libr/crypto/p/crypto_aes.c index d4ca5da88e90e..2284c40ac2ea8 100644 --- a/libr/crypto/p/crypto_aes.c +++ b/libr/crypto/p/crypto_aes.c @@ -80,6 +80,7 @@ RCryptoPlugin r_crypto_plugin_aes = { .type = R_CRYPTO_TYPE_ENCRYPT, .meta = { .name = "aes-ecb", + .desc = "Block Cipher Mode for Rijndael Encryption", .author = "pancake", .license = "MIT", }, diff --git a/libr/crypto/p/crypto_aes_cbc.c b/libr/crypto/p/crypto_aes_cbc.c index e9a624ac44bb8..12b5faa49c343 100644 --- a/libr/crypto/p/crypto_aes_cbc.c +++ b/libr/crypto/p/crypto_aes_cbc.c @@ -104,6 +104,7 @@ RCryptoPlugin r_crypto_plugin_aes_cbc = { .type = R_CRYPTO_TYPE_ENCRYPT, .meta = { .name = "aes-cbc", + .desc = "Cipher Block Chaining Mode for Rijndael Encryption", .author = "pancake", .license = "LGPL-3.0-only", }, diff --git a/libr/crypto/p/crypto_aes_wrap.c b/libr/crypto/p/crypto_aes_wrap.c index 9b33cf3e12343..840853264d24b 100644 --- a/libr/crypto/p/crypto_aes_wrap.c +++ b/libr/crypto/p/crypto_aes_wrap.c @@ -140,6 +140,7 @@ RCryptoPlugin r_crypto_plugin_aes_wrap = { .type = R_CRYPTO_TYPE_ENCRYPT, .meta = { .name = "aes-wrap", + .desc = "Advanced Encryption Standard", .author = "Sylvain Pelissier", .license = "LGPL-3.0-only", }, diff --git a/libr/crypto/p/crypto_base64.c b/libr/crypto/p/crypto_base64.c index 318aa1397c692..86705022a96f5 100644 --- a/libr/crypto/p/crypto_base64.c +++ b/libr/crypto/p/crypto_base64.c @@ -55,6 +55,7 @@ static bool end(RCryptoJob *cj, const ut8 *buf, int len) { RCryptoPlugin r_crypto_plugin_base64 = { .meta = { .name = "base64", + .desc = "Binary to text encoding scheme using 64 ascii characters", .author = "rakholiyajenish.07", .license = "LGPL-3.0-only" }, diff --git a/libr/crypto/p/crypto_base91.c b/libr/crypto/p/crypto_base91.c index bd42beb270da8..0c216ac47d7fd 100644 --- a/libr/crypto/p/crypto_base91.c +++ b/libr/crypto/p/crypto_base91.c @@ -42,6 +42,7 @@ static bool update(RCryptoJob *cj, const ut8 *buf, int len) { RCryptoPlugin r_crypto_plugin_base91 = { .meta = { + .desc = "Binary to text encoding scheme using 91 ascii characters", .name = "base91", .author = "rakholiyajenish.07", .license = "MIT", diff --git a/libr/crypto/p/crypto_blowfish.c b/libr/crypto/p/crypto_blowfish.c index 9719da9971f97..38414c811df19 100644 --- a/libr/crypto/p/crypto_blowfish.c +++ b/libr/crypto/p/crypto_blowfish.c @@ -341,7 +341,8 @@ RCryptoPlugin r_crypto_plugin_blowfish = { .meta = { .name = "blowfish", .license = "LGPL-3.0-only", - .author = "pancake" + .author = "pancake", + .desc = "Bruce Schneier's symetric-key block cipher", }, .implements = "blowfish", .set_key = blowfish_set_key, diff --git a/libr/crypto/p/crypto_cps2.c b/libr/crypto/p/crypto_cps2.c index 5fb75a7b797a6..dd00b51bfc23e 100644 --- a/libr/crypto/p/crypto_cps2.c +++ b/libr/crypto/p/crypto_cps2.c @@ -766,6 +766,7 @@ RCryptoPlugin r_crypto_plugin_cps2 = { .type = R_CRYPTO_TYPE_ENCRYPT, .meta = { .name = "cps2", + .desc = "Capcom Play System 2", .author = "pof,esanfelix", .license = "LGPL-3.0-only", }, diff --git a/libr/crypto/p/crypto_des.c b/libr/crypto/p/crypto_des.c index aa3c6c27ff806..5ed4b3e317d55 100644 --- a/libr/crypto/p/crypto_des.c +++ b/libr/crypto/p/crypto_des.c @@ -1,8 +1,6 @@ -/* radare - LGPL - Copyright 2017 - deroad */ +/* radare - LGPL - Copyright 2017-2024 - deroad */ -#include #include -#include struct des_state { ut32 keylo[16]; // round key low @@ -173,6 +171,7 @@ RCryptoPlugin r_crypto_plugin_des = { .meta = { .name = "des-ecb", .author = "deroad", + .desc = "Simplest and weakest Electronic Code Book for DES", .license = "LGPL-3.0-only", }, .set_key = des_set_key, diff --git a/libr/crypto/p/crypto_ed25519.c b/libr/crypto/p/crypto_ed25519.c index 841201f55fab9..4a97d4d8cc73b 100644 --- a/libr/crypto/p/crypto_ed25519.c +++ b/libr/crypto/p/crypto_ed25519.c @@ -99,6 +99,7 @@ RCryptoPlugin r_crypto_plugin_ed25519 = { .type = R_CRYPTO_TYPE_SIGNATURE, .meta = { .name = "ed25519", + .desc = "Elliptic curve pubkey cryptographic algorithm used for signing and verification", .author = "Sylvain Pelissier", .license = "Zlib", }, diff --git a/libr/crypto/p/crypto_entropy.c b/libr/crypto/p/crypto_entropy.c index c72b69b3e9802..d201c6d525f75 100644 --- a/libr/crypto/p/crypto_entropy.c +++ b/libr/crypto/p/crypto_entropy.c @@ -48,6 +48,7 @@ static bool end(RCryptoJob *cj, const ut8 *buf, int len) { RCryptoPlugin r_crypto_plugin_entropy = { .meta = { .name = "entropy", + .desc = "Collected randomness by a syustem", .author = "pancake", .license = "MIT", }, diff --git a/libr/crypto/p/crypto_punycode.c b/libr/crypto/p/crypto_punycode.c index 9685f2bb66cf6..1d4de9508da8a 100644 --- a/libr/crypto/p/crypto_punycode.c +++ b/libr/crypto/p/crypto_punycode.c @@ -35,6 +35,7 @@ static bool update(RCryptoJob *cj, const ut8 *buf, int len) { RCryptoPlugin r_crypto_plugin_punycode = { .meta = { .name = "punycode", + .desc = "Unicoded represented in plain ascii", .author = "pancake", .license = "LGPL-3.0-only", }, diff --git a/libr/crypto/p/crypto_rc2.c b/libr/crypto/p/crypto_rc2.c index d33a69c03e12e..392e95f7d94ab 100644 --- a/libr/crypto/p/crypto_rc2.c +++ b/libr/crypto/p/crypto_rc2.c @@ -245,6 +245,7 @@ RCryptoPlugin r_crypto_plugin_rc2 = { .type = R_CRYPTO_TYPE_ENCRYPT, .meta = { .name = "rc2", + .desc = "Ron Rivest's Code symmetric key encryption also known as ARC2", .author = "pancake", .license = "LGPL-3.0-only", }, diff --git a/libr/crypto/p/crypto_rc4.c b/libr/crypto/p/crypto_rc4.c index d09e857c9ef91..1022b068a1c45 100644 --- a/libr/crypto/p/crypto_rc4.c +++ b/libr/crypto/p/crypto_rc4.c @@ -108,6 +108,7 @@ RCryptoPlugin r_crypto_plugin_rc4 = { .name = "rc4", .license = "LGPL-3.0-only", .author = "pancake", + .desc = "Rivest Cipher 4", }, .implements = "rc4", .set_key = rc4_set_key, diff --git a/libr/crypto/p/crypto_rc6.c b/libr/crypto/p/crypto_rc6.c index 9d5bbb70c53f2..345e9a67ef4bf 100644 --- a/libr/crypto/p/crypto_rc6.c +++ b/libr/crypto/p/crypto_rc6.c @@ -1,6 +1,4 @@ -/* radare - LGPL - Copyright 2016-2022 - pancake */ - -// Implemented AES version of RC6. keylen = 16, 23, or 32 bytes; w = 32; and r = 20. +/* radare - LGPL - Copyright 2016-2024 - pancake */ #include @@ -205,6 +203,7 @@ RCryptoPlugin r_crypto_plugin_rc6 = { .type = R_CRYPTO_TYPE_ENCRYPT, .meta = { .name = "rc6", + .desc = "Rivest's Cipher 6", .author = "pancake", .license = "LGPL-3.0-only", }, diff --git a/libr/crypto/p/crypto_rol.c b/libr/crypto/p/crypto_rol.c index 905d666a813c1..ae35546654b6c 100644 --- a/libr/crypto/p/crypto_rol.c +++ b/libr/crypto/p/crypto_rol.c @@ -69,6 +69,7 @@ RCryptoPlugin r_crypto_plugin_rol = { .type = R_CRYPTO_TYPE_ENCODER, .meta = { .name = NAME, + .desc = "Rotate Left N bits", .author = "pancake", .license = "LGPL-3.0-only", }, diff --git a/libr/crypto/p/crypto_ror.c b/libr/crypto/p/crypto_ror.c index 0adbc9637ad39..38a2557d16635 100644 --- a/libr/crypto/p/crypto_ror.c +++ b/libr/crypto/p/crypto_ror.c @@ -73,6 +73,7 @@ RCryptoPlugin r_crypto_plugin_ror = { .type = R_CRYPTO_TYPE_ENCODER, .meta = { .name = NAME, + .desc = "Rotate Right N bits", .author = "pancake", .license = "LGPL-3.0-only", }, diff --git a/libr/crypto/p/crypto_xor.c b/libr/crypto/p/crypto_xor.c index b00cf5f082db1..29a6ff8993697 100644 --- a/libr/crypto/p/crypto_xor.c +++ b/libr/crypto/p/crypto_xor.c @@ -58,6 +58,7 @@ RCryptoPlugin r_crypto_plugin_xor = { .type = R_CRYPTO_TYPE_ENCRYPT, .meta = { .name = "xor", + .desc = "Byte level Exclusive Or Encryption", .author = "pancake", .license = "MIT", }, diff --git a/libr/main/rahash2.c b/libr/main/rahash2.c index 1e5b1c132ffbe..7e5476e73e2ae 100644 --- a/libr/main/rahash2.c +++ b/libr/main/rahash2.c @@ -23,7 +23,7 @@ typedef struct { } RahashOptions; static void compare_hashes(const RHash *ctx, RahashOptions *ro, const ut8 *compare, int length, int *ret, int rad) { - if (compare) { + if (R_LIKELY (compare)) { // algobit has only 1 bit set if (!memcmp (ctx->digest, compare, length)) { if (rad != 'q') { @@ -825,7 +825,6 @@ R_API int r_main_rahash2(int argc, const char **argv) { io = r_io_new (); for (_ret = 0, i = opt.ind; i < argc; i++) { file = argv[i]; - if (file && !*file) { R_LOG_ERROR ("Cannot open empty path"); ret (1);