Commit b21b9a5e authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Herbert Xu

crypto: rmd128 - remove RIPE-MD 128 hash algorithm

RIPE-MD 128 is never referenced anywhere in the kernel, and unlikely
to be depended upon by userspace via AF_ALG. So let's remove it.
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent c114cf7f
...@@ -817,19 +817,6 @@ config CRYPTO_MICHAEL_MIC ...@@ -817,19 +817,6 @@ config CRYPTO_MICHAEL_MIC
should not be used for other purposes because of the weakness should not be used for other purposes because of the weakness
of the algorithm. of the algorithm.
config CRYPTO_RMD128
tristate "RIPEMD-128 digest algorithm"
select CRYPTO_HASH
help
RIPEMD-128 (ISO/IEC 10118-3:2004).
RIPEMD-128 is a 128-bit cryptographic hash function. It should only
be used as a secure replacement for RIPEMD. For other use cases,
RIPEMD-160 should be used.
Developed by Hans Dobbertin, Antoon Bosselaers and Bart Preneel.
See <https://homes.esat.kuleuven.be/~bosselae/ripemd160.html>
config CRYPTO_RMD160 config CRYPTO_RMD160
tristate "RIPEMD-160 digest algorithm" tristate "RIPEMD-160 digest algorithm"
select CRYPTO_HASH select CRYPTO_HASH
......
...@@ -67,7 +67,6 @@ obj-$(CONFIG_CRYPTO_XCBC) += xcbc.o ...@@ -67,7 +67,6 @@ obj-$(CONFIG_CRYPTO_XCBC) += xcbc.o
obj-$(CONFIG_CRYPTO_NULL2) += crypto_null.o obj-$(CONFIG_CRYPTO_NULL2) += crypto_null.o
obj-$(CONFIG_CRYPTO_MD4) += md4.o obj-$(CONFIG_CRYPTO_MD4) += md4.o
obj-$(CONFIG_CRYPTO_MD5) += md5.o obj-$(CONFIG_CRYPTO_MD5) += md5.o
obj-$(CONFIG_CRYPTO_RMD128) += rmd128.o
obj-$(CONFIG_CRYPTO_RMD160) += rmd160.o obj-$(CONFIG_CRYPTO_RMD160) += rmd160.o
obj-$(CONFIG_CRYPTO_RMD256) += rmd256.o obj-$(CONFIG_CRYPTO_RMD256) += rmd256.o
obj-$(CONFIG_CRYPTO_RMD320) += rmd320.o obj-$(CONFIG_CRYPTO_RMD320) += rmd320.o
......
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
#ifndef _CRYPTO_RMD_H #ifndef _CRYPTO_RMD_H
#define _CRYPTO_RMD_H #define _CRYPTO_RMD_H
#define RMD128_DIGEST_SIZE 16
#define RMD128_BLOCK_SIZE 64
#define RMD160_DIGEST_SIZE 20 #define RMD160_DIGEST_SIZE 20
#define RMD160_BLOCK_SIZE 64 #define RMD160_BLOCK_SIZE 64
......
This diff is collapsed.
...@@ -71,7 +71,7 @@ static const char *check[] = { ...@@ -71,7 +71,7 @@ static const char *check[] = {
"blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes", "blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes",
"cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
"khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt", "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt",
"camellia", "seed", "salsa20", "rmd128", "rmd160", "rmd256", "rmd320", "camellia", "seed", "salsa20", "rmd160", "rmd256", "rmd320",
"lzo", "lzo-rle", "cts", "sha3-224", "sha3-256", "sha3-384", "lzo", "lzo-rle", "cts", "sha3-224", "sha3-256", "sha3-384",
"sha3-512", "streebog256", "streebog512", "sha3-512", "streebog256", "streebog512",
NULL NULL
...@@ -1867,10 +1867,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) ...@@ -1867,10 +1867,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
ret += tcrypt_test("cts(cbc(aes))"); ret += tcrypt_test("cts(cbc(aes))");
break; break;
case 39:
ret += tcrypt_test("rmd128");
break;
case 40: case 40:
ret += tcrypt_test("rmd160"); ret += tcrypt_test("rmd160");
break; break;
...@@ -1955,10 +1951,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) ...@@ -1955,10 +1951,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
ret += tcrypt_test("xcbc(aes)"); ret += tcrypt_test("xcbc(aes)");
break; break;
case 107:
ret += tcrypt_test("hmac(rmd128)");
break;
case 108: case 108:
ret += tcrypt_test("hmac(rmd160)"); ret += tcrypt_test("hmac(rmd160)");
break; break;
...@@ -2409,10 +2401,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) ...@@ -2409,10 +2401,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
test_hash_speed("sha224", sec, generic_hash_speed_template); test_hash_speed("sha224", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
fallthrough; fallthrough;
case 314:
test_hash_speed("rmd128", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break;
fallthrough;
case 315: case 315:
test_hash_speed("rmd160", sec, generic_hash_speed_template); test_hash_speed("rmd160", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
...@@ -2533,10 +2521,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) ...@@ -2533,10 +2521,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
test_ahash_speed("sha224", sec, generic_hash_speed_template); test_ahash_speed("sha224", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
fallthrough; fallthrough;
case 414:
test_ahash_speed("rmd128", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break;
fallthrough;
case 415: case 415:
test_ahash_speed("rmd160", sec, generic_hash_speed_template); test_ahash_speed("rmd160", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
......
...@@ -4957,12 +4957,6 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -4957,12 +4957,6 @@ static const struct alg_test_desc alg_test_descs[] = {
.suite = { .suite = {
.hash = __VECS(hmac_md5_tv_template) .hash = __VECS(hmac_md5_tv_template)
} }
}, {
.alg = "hmac(rmd128)",
.test = alg_test_hash,
.suite = {
.hash = __VECS(hmac_rmd128_tv_template)
}
}, { }, {
.alg = "hmac(rmd160)", .alg = "hmac(rmd160)",
.test = alg_test_hash, .test = alg_test_hash,
...@@ -5275,12 +5269,6 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -5275,12 +5269,6 @@ static const struct alg_test_desc alg_test_descs[] = {
.aad_iv = 1, .aad_iv = 1,
} }
} }
}, {
.alg = "rmd128",
.test = alg_test_hash,
.suite = {
.hash = __VECS(rmd128_tv_template)
}
}, { }, {
.alg = "rmd160", .alg = "rmd160",
.test = alg_test_hash, .test = alg_test_hash,
......
...@@ -3140,66 +3140,6 @@ static const struct hash_testvec md5_tv_template[] = { ...@@ -3140,66 +3140,6 @@ static const struct hash_testvec md5_tv_template[] = {
}; };
/*
* RIPEMD-128 test vectors from ISO/IEC 10118-3:2004(E)
*/
static const struct hash_testvec rmd128_tv_template[] = {
{
.digest = "\xcd\xf2\x62\x13\xa1\x50\xdc\x3e"
"\xcb\x61\x0f\x18\xf6\xb3\x8b\x46",
}, {
.plaintext = "a",
.psize = 1,
.digest = "\x86\xbe\x7a\xfa\x33\x9d\x0f\xc7"
"\xcf\xc7\x85\xe7\x2f\x57\x8d\x33",
}, {
.plaintext = "abc",
.psize = 3,
.digest = "\xc1\x4a\x12\x19\x9c\x66\xe4\xba"
"\x84\x63\x6b\x0f\x69\x14\x4c\x77",
}, {
.plaintext = "message digest",
.psize = 14,
.digest = "\x9e\x32\x7b\x3d\x6e\x52\x30\x62"
"\xaf\xc1\x13\x2d\x7d\xf9\xd1\xb8",
}, {
.plaintext = "abcdefghijklmnopqrstuvwxyz",
.psize = 26,
.digest = "\xfd\x2a\xa6\x07\xf7\x1d\xc8\xf5"
"\x10\x71\x49\x22\xb3\x71\x83\x4e",
}, {
.plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
"fghijklmnopqrstuvwxyz0123456789",
.psize = 62,
.digest = "\xd1\xe9\x59\xeb\x17\x9c\x91\x1f"
"\xae\xa4\x62\x4c\x60\xc5\xc7\x02",
}, {
.plaintext = "1234567890123456789012345678901234567890"
"1234567890123456789012345678901234567890",
.psize = 80,
.digest = "\x3f\x45\xef\x19\x47\x32\xc2\xdb"
"\xb2\xc4\xa2\xc7\x69\x79\x5f\xa3",
}, {
.plaintext = "abcdbcdecdefdefgefghfghighij"
"hijkijkljklmklmnlmnomnopnopq",
.psize = 56,
.digest = "\xa1\xaa\x06\x89\xd0\xfa\xfa\x2d"
"\xdc\x22\xe8\x8b\x49\x13\x3a\x06",
}, {
.plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
"jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqr"
"lmnopqrsmnopqrstnopqrstu",
.psize = 112,
.digest = "\xd4\xec\xc9\x13\xe1\xdf\x77\x6b"
"\xf4\x8d\xe9\xd5\x5b\x1f\x25\x46",
}, {
.plaintext = "abcdbcdecdefdefgefghfghighijhijk",
.psize = 32,
.digest = "\x13\xfc\x13\xe8\xef\xff\x34\x7d"
"\xe1\x93\xff\x46\xdb\xac\xcf\xd4",
}
};
/* /*
* RIPEMD-160 test vectors from ISO/IEC 10118-3:2004(E) * RIPEMD-160 test vectors from ISO/IEC 10118-3:2004(E)
*/ */
...@@ -5452,83 +5392,6 @@ static const struct hash_testvec hmac_md5_tv_template[] = ...@@ -5452,83 +5392,6 @@ static const struct hash_testvec hmac_md5_tv_template[] =
}, },
}; };
/*
* HMAC-RIPEMD128 test vectors from RFC2286
*/
static const struct hash_testvec hmac_rmd128_tv_template[] = {
{
.key = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
.ksize = 16,
.plaintext = "Hi There",
.psize = 8,
.digest = "\xfb\xf6\x1f\x94\x92\xaa\x4b\xbf"
"\x81\xc1\x72\xe8\x4e\x07\x34\xdb",
}, {
.key = "Jefe",
.ksize = 4,
.plaintext = "what do ya want for nothing?",
.psize = 28,
.digest = "\x87\x5f\x82\x88\x62\xb6\xb3\x34"
"\xb4\x27\xc5\x5f\x9f\x7f\xf0\x9b",
}, {
.key = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
.ksize = 16,
.plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
"\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
"\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
"\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
.psize = 50,
.digest = "\x09\xf0\xb2\x84\x6d\x2f\x54\x3d"
"\xa3\x63\xcb\xec\x8d\x62\xa3\x8d",
}, {
.key = "\x01\x02\x03\x04\x05\x06\x07\x08"
"\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
"\x11\x12\x13\x14\x15\x16\x17\x18\x19",
.ksize = 25,
.plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
"\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
"\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
"\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
.psize = 50,
.digest = "\xbd\xbb\xd7\xcf\x03\xe4\x4b\x5a"
"\xa6\x0a\xf8\x15\xbe\x4d\x22\x94",
}, {
.key = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
.ksize = 16,
.plaintext = "Test With Truncation",
.psize = 20,
.digest = "\xe7\x98\x08\xf2\x4b\x25\xfd\x03"
"\x1c\x15\x5f\x0d\x55\x1d\x9a\x3a",
}, {
.key = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
"\xaa\xaa",
.ksize = 80,
.plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
.psize = 54,
.digest = "\xdc\x73\x29\x28\xde\x98\x10\x4a"
"\x1f\x59\xd3\x73\xc1\x50\xac\xbb",
}, {
.key = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
"\xaa\xaa",
.ksize = 80,
.plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
"Block-Size Data",
.psize = 73,
.digest = "\x5c\x6b\xec\x96\x79\x3e\x16\xd4"
"\x06\x90\xc2\x37\x63\x5f\x30\xc5",
},
};
/* /*
* HMAC-RIPEMD160 test vectors from RFC2286 * HMAC-RIPEMD160 test vectors from RFC2286
*/ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment