From 53582571fe817aaf954c375c94f35e4c7c2856c4 Mon Sep 17 00:00:00 2001 From: Sylvain Pelissier Date: Sun, 10 Nov 2024 21:23:53 +0100 Subject: [PATCH] Update cipher plugin descriptions ##crypto --- libr/crypto/hash/sip.c | 7 +++++++ libr/crypto/p/crypto_aes.c | 2 +- libr/crypto/p/crypto_aes_cbc.c | 2 +- libr/crypto/p/crypto_aes_wrap.c | 2 +- libr/crypto/p/crypto_des.c | 2 +- libr/crypto/p/crypto_serpent.c | 2 +- libr/crypto/p/crypto_sip.c | 2 +- libr/crypto/p/crypto_sm4.c | 2 +- libr/crypto/p/crypto_xor.c | 2 +- test/db/cmd/hash | 2 +- test/db/tools/rahash2 | 16 ++++++++-------- 11 files changed, 24 insertions(+), 17 deletions(-) diff --git a/libr/crypto/hash/sip.c b/libr/crypto/hash/sip.c index 4f5cd274a444d..a51b437c9447c 100644 --- a/libr/crypto/hash/sip.c +++ b/libr/crypto/hash/sip.c @@ -19,10 +19,17 @@ } while (0) R_API ut64 r_hash_sip(const ut8 *in, ut64 inlen) { + /* SipHash-2-4 using the key: + 0xb5d4c9eb79104a796fec8b1b428781d4 (big-endian) + */ const ut8 *end; + // v0 = k0 ^ 0x736f6d6570736575 ut64 v0 = 0x0a257d1c9bbab1c0ULL; + // v1 = k1 ^ 0x646f72616e646f6d ut64 v1 = 0xb0eef52375ef8302ULL; + // v2 = k0 ^ 0x6c7967656e657261 ut64 v2 = 0x1533771c85aca6d4ULL; + // v3 = k1 ^ 0x7465646279746573 ut64 v3 = 0xa0e4e32062ff891cULL; for (end = in + (inlen & ~7ULL); in != end; in += 8) { ut64 m = ((ut64)in[7] << 56) diff --git a/libr/crypto/p/crypto_aes.c b/libr/crypto/p/crypto_aes.c index 2284c40ac2ea8..e198a43897b6b 100644 --- a/libr/crypto/p/crypto_aes.c +++ b/libr/crypto/p/crypto_aes.c @@ -80,7 +80,7 @@ RCryptoPlugin r_crypto_plugin_aes = { .type = R_CRYPTO_TYPE_ENCRYPT, .meta = { .name = "aes-ecb", - .desc = "Block Cipher Mode for Rijndael Encryption", + .desc = "Rijndael block cipher with Electronic Code Book mode", .author = "pancake", .license = "MIT", }, diff --git a/libr/crypto/p/crypto_aes_cbc.c b/libr/crypto/p/crypto_aes_cbc.c index 12b5faa49c343..0699cf5fbcab7 100644 --- a/libr/crypto/p/crypto_aes_cbc.c +++ b/libr/crypto/p/crypto_aes_cbc.c @@ -104,7 +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", + .desc = "Rijndael block cipher with Cipher Block Chaining mode", .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 85a198ab39da3..16e75d81c8e70 100644 --- a/libr/crypto/p/crypto_aes_wrap.c +++ b/libr/crypto/p/crypto_aes_wrap.c @@ -140,7 +140,7 @@ RCryptoPlugin r_crypto_plugin_aes_wrap = { .type = R_CRYPTO_TYPE_ENCRYPT, .meta = { .name = "aes-wrap", - .desc = "Advanced Encryption Standard Key Wrap Algorithm (RFC 3394)", + .desc = "Rijndael block cipher with Key Wrap Algorithm (RFC 3394)", .author = "Sylvain Pelissier", .license = "LGPL-3.0-only", }, diff --git a/libr/crypto/p/crypto_des.c b/libr/crypto/p/crypto_des.c index 5ed4b3e317d55..f199e3e451ff6 100644 --- a/libr/crypto/p/crypto_des.c +++ b/libr/crypto/p/crypto_des.c @@ -171,7 +171,7 @@ RCryptoPlugin r_crypto_plugin_des = { .meta = { .name = "des-ecb", .author = "deroad", - .desc = "Simplest and weakest Electronic Code Book for DES", + .desc = "DES with with Electronic Code Book mode", .license = "LGPL-3.0-only", }, .set_key = des_set_key, diff --git a/libr/crypto/p/crypto_serpent.c b/libr/crypto/p/crypto_serpent.c index fe267122cffc6..23767e2019d35 100644 --- a/libr/crypto/p/crypto_serpent.c +++ b/libr/crypto/p/crypto_serpent.c @@ -115,7 +115,7 @@ RCryptoPlugin r_crypto_plugin_serpent = { .type = R_CRYPTO_TYPE_ENCRYPT, .meta = { .name = "serpent-ecb", - .desc = "Bouncy Castle Cryptography", + .desc = "Serpent block cipher with Electronic Code Book mode", .license = "LGPL-3.0-only", .author = "pancake", }, diff --git a/libr/crypto/p/crypto_sip.c b/libr/crypto/p/crypto_sip.c index e64591b56cd1a..718346e50ccd9 100644 --- a/libr/crypto/p/crypto_sip.c +++ b/libr/crypto/p/crypto_sip.c @@ -15,7 +15,7 @@ static bool update(RCryptoJob *cj, const ut8 *buf, int len) { RCryptoPlugin r_crypto_plugin_sip = { .meta = { .name = "sip", - .desc = "SipHash", + .desc = "SipHash-2-4", .author = "pancake", .license = "MIT", }, diff --git a/libr/crypto/p/crypto_sm4.c b/libr/crypto/p/crypto_sm4.c index 25e5366385e58..fa52d9e2b7742 100644 --- a/libr/crypto/p/crypto_sm4.c +++ b/libr/crypto/p/crypto_sm4.c @@ -46,7 +46,7 @@ RCryptoPlugin r_crypto_plugin_sm4 = { .type = R_CRYPTO_TYPE_ENCRYPT, .meta = { .name = "sm4-ecb", - .desc = "ShāngMì4 block cipher", + .desc = "ShāngMì4 block cipher with Electronic Code Book mode", .author = "Sylvain Pelissier", .license = "LGPL-3.0-only", }, diff --git a/libr/crypto/p/crypto_xor.c b/libr/crypto/p/crypto_xor.c index 29a6ff8993697..ac79179b29768 100644 --- a/libr/crypto/p/crypto_xor.c +++ b/libr/crypto/p/crypto_xor.c @@ -58,7 +58,7 @@ RCryptoPlugin r_crypto_plugin_xor = { .type = R_CRYPTO_TYPE_ENCRYPT, .meta = { .name = "xor", - .desc = "Byte level Exclusive Or Encryption", + .desc = "Byte level Exclusive Or", .author = "pancake", .license = "MIT", }, diff --git a/test/db/cmd/hash b/test/db/cmd/hash index 9a3061b847ef1..3f9b618266727 100644 --- a/test/db/cmd/hash +++ b/test/db/cmd/hash @@ -140,6 +140,6 @@ CMDS=<