Skip to content

Commit

Permalink
ji
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Oct 18, 2024
1 parent 4e66fd4 commit 7f444e0
Show file tree
Hide file tree
Showing 19 changed files with 23 additions and 13 deletions.
6 changes: 2 additions & 4 deletions libr/crypto/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <r_crypto.h>
#include <r_hash.h>
#include <config.h>
#include "r_util/r_assert.h"
#include <r_util/r_assert.h>

R_LIB_VERSION (r_crypto);

Expand Down Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions libr/crypto/p/crypto_aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
1 change: 1 addition & 0 deletions libr/crypto/p/crypto_aes_cbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
1 change: 1 addition & 0 deletions libr/crypto/p/crypto_aes_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
1 change: 1 addition & 0 deletions libr/crypto/p/crypto_base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
1 change: 1 addition & 0 deletions libr/crypto/p/crypto_base91.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion libr/crypto/p/crypto_blowfish.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions libr/crypto/p/crypto_cps2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
5 changes: 2 additions & 3 deletions libr/crypto/p/crypto_des.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/* radare - LGPL - Copyright 2017 - deroad */
/* radare - LGPL - Copyright 2017-2024 - deroad */

#include <r_lib.h>
#include <r_crypto.h>
#include <r_util.h>

struct des_state {
ut32 keylo[16]; // round key low
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions libr/crypto/p/crypto_ed25519.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
1 change: 1 addition & 0 deletions libr/crypto/p/crypto_entropy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
1 change: 1 addition & 0 deletions libr/crypto/p/crypto_punycode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
1 change: 1 addition & 0 deletions libr/crypto/p/crypto_rc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
1 change: 1 addition & 0 deletions libr/crypto/p/crypto_rc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 2 additions & 3 deletions libr/crypto/p/crypto_rc6.c
Original file line number Diff line number Diff line change
@@ -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 <r_crypto.h>

Expand Down Expand Up @@ -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",
},
Expand Down
1 change: 1 addition & 0 deletions libr/crypto/p/crypto_rol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
1 change: 1 addition & 0 deletions libr/crypto/p/crypto_ror.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
1 change: 1 addition & 0 deletions libr/crypto/p/crypto_xor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
3 changes: 1 addition & 2 deletions libr/main/rahash2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7f444e0

Please sign in to comment.