Skip to content

Commit

Permalink
crypto: tgr192 - remove Tiger 128/160/192 hash algorithms
Browse files Browse the repository at this point in the history
Tiger 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: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
ardbiesheuvel authored and herbertx committed Jan 29, 2021
1 parent 93f6420 commit 87cd723
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 876 deletions.
13 changes: 0 additions & 13 deletions crypto/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1009,19 +1009,6 @@ config CRYPTO_STREEBOG
https://tc26.ru/upload/iblock/fed/feddbb4d26b685903faa2ba11aea43f6.pdf
https://tools.ietf.org/html/rfc6986

config CRYPTO_TGR192
tristate "Tiger digest algorithms"
select CRYPTO_HASH
help
Tiger hash algorithm 192, 160 and 128-bit hashes

Tiger is a hash function optimized for 64-bit processors while
still having decent performance on 32-bit processors.
Tiger was developed by Ross Anderson and Eli Biham.

See also:
<https://www.cs.technion.ac.il/~biham/Reports/Tiger/>.

config CRYPTO_WP512
tristate "Whirlpool digest algorithms"
select CRYPTO_HASH
Expand Down
1 change: 0 additions & 1 deletion crypto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ obj-$(CONFIG_CRYPTO_SM3) += sm3_generic.o
obj-$(CONFIG_CRYPTO_STREEBOG) += streebog_generic.o
obj-$(CONFIG_CRYPTO_WP512) += wp512.o
CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149
obj-$(CONFIG_CRYPTO_TGR192) += tgr192.o
obj-$(CONFIG_CRYPTO_BLAKE2B) += blake2b_generic.o
obj-$(CONFIG_CRYPTO_BLAKE2S) += blake2s_generic.o
obj-$(CONFIG_CRYPTO_GF128MUL) += gf128mul.o
Expand Down
36 changes: 0 additions & 36 deletions crypto/tcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1815,18 +1815,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
ret += tcrypt_test("cbc(anubis)");
break;

case 27:
ret += tcrypt_test("tgr192");
break;

case 28:
ret += tcrypt_test("tgr160");
break;

case 29:
ret += tcrypt_test("tgr128");
break;

case 30:
ret += tcrypt_test("ecb(xeta)");
break;
Expand Down Expand Up @@ -2377,18 +2365,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
test_hash_speed("wp512", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break;
fallthrough;
case 310:
test_hash_speed("tgr128", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break;
fallthrough;
case 311:
test_hash_speed("tgr160", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break;
fallthrough;
case 312:
test_hash_speed("tgr192", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break;
fallthrough;
case 313:
test_hash_speed("sha224", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break;
Expand Down Expand Up @@ -2489,18 +2465,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
test_ahash_speed("wp512", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break;
fallthrough;
case 410:
test_ahash_speed("tgr128", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break;
fallthrough;
case 411:
test_ahash_speed("tgr160", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break;
fallthrough;
case 412:
test_ahash_speed("tgr192", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break;
fallthrough;
case 413:
test_ahash_speed("sha224", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break;
Expand Down
18 changes: 0 additions & 18 deletions crypto/testmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -5375,24 +5375,6 @@ static const struct alg_test_desc alg_test_descs[] = {
.suite = {
.hash = __VECS(streebog512_tv_template)
}
}, {
.alg = "tgr128",
.test = alg_test_hash,
.suite = {
.hash = __VECS(tgr128_tv_template)
}
}, {
.alg = "tgr160",
.test = alg_test_hash,
.suite = {
.hash = __VECS(tgr160_tv_template)
}
}, {
.alg = "tgr192",
.test = alg_test_hash,
.suite = {
.hash = __VECS(tgr192_tv_template)
}
}, {
.alg = "vmac64(aes)",
.test = alg_test_hash,
Expand Down
126 changes: 0 additions & 126 deletions crypto/testmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -4950,132 +4950,6 @@ static const struct hash_testvec wp256_tv_template[] = {
},
};

/*
* TIGER test vectors from Tiger website
*/
static const struct hash_testvec tgr192_tv_template[] = {
{
.plaintext = "",
.psize = 0,
.digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
"\x16\x16\x6e\x76\xb1\xbb\x92\x5f"
"\xf3\x73\xde\x2d\x49\x58\x4e\x7a",
}, {
.plaintext = "abc",
.psize = 3,
.digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
"\x52\x7a\xb5\x41\xff\xc5\xb8\xbf"
"\x93\x5f\x7b\x95\x1c\x13\x29\x51",
}, {
.plaintext = "Tiger",
.psize = 5,
.digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
"\x27\x6a\xbb\x38\xc8\xeb\x6d\xec"
"\x37\x79\x0c\x11\x6f\x9d\x2b\xdf",
}, {
.plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
.psize = 64,
.digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
"\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e"
"\xb5\x86\x44\x50\x34\xa5\xa3\x86",
}, {
.plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
.psize = 64,
.digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
"\x8d\xf1\xcd\x12\x61\x65\x5d\xe9"
"\x57\x89\x65\x65\x97\x5f\x91\x97",
}, {
.plaintext = "Tiger - A Fast New Hash Function, "
"by Ross Anderson and Eli Biham, "
"proceedings of Fast Software Encryption 3, "
"Cambridge, 1996.",
.psize = 125,
.digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
"\x57\xb2\x77\x4d\xfd\x6d\x5b\x24"
"\xdd\x68\x15\x1d\x50\x39\x74\xfc",
},
};

static const struct hash_testvec tgr160_tv_template[] = {
{
.plaintext = "",
.psize = 0,
.digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
"\x16\x16\x6e\x76\xb1\xbb\x92\x5f"
"\xf3\x73\xde\x2d",
}, {
.plaintext = "abc",
.psize = 3,
.digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
"\x52\x7a\xb5\x41\xff\xc5\xb8\xbf"
"\x93\x5f\x7b\x95",
}, {
.plaintext = "Tiger",
.psize = 5,
.digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
"\x27\x6a\xbb\x38\xc8\xeb\x6d\xec"
"\x37\x79\x0c\x11",
}, {
.plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
.psize = 64,
.digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
"\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e"
"\xb5\x86\x44\x50",
}, {
.plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
.psize = 64,
.digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
"\x8d\xf1\xcd\x12\x61\x65\x5d\xe9"
"\x57\x89\x65\x65",
}, {
.plaintext = "Tiger - A Fast New Hash Function, "
"by Ross Anderson and Eli Biham, "
"proceedings of Fast Software Encryption 3, "
"Cambridge, 1996.",
.psize = 125,
.digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
"\x57\xb2\x77\x4d\xfd\x6d\x5b\x24"
"\xdd\x68\x15\x1d",
},
};

static const struct hash_testvec tgr128_tv_template[] = {
{
.plaintext = "",
.psize = 0,
.digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
"\x16\x16\x6e\x76\xb1\xbb\x92\x5f",
}, {
.plaintext = "abc",
.psize = 3,
.digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
"\x52\x7a\xb5\x41\xff\xc5\xb8\xbf",
}, {
.plaintext = "Tiger",
.psize = 5,
.digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
"\x27\x6a\xbb\x38\xc8\xeb\x6d\xec",
}, {
.plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
.psize = 64,
.digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
"\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e",
}, {
.plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
.psize = 64,
.digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
"\x8d\xf1\xcd\x12\x61\x65\x5d\xe9",
}, {
.plaintext = "Tiger - A Fast New Hash Function, "
"by Ross Anderson and Eli Biham, "
"proceedings of Fast Software Encryption 3, "
"Cambridge, 1996.",
.psize = 125,
.digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
"\x57\xb2\x77\x4d\xfd\x6d\x5b\x24",
},
};

static const struct hash_testvec ghash_tv_template[] =
{
{
Expand Down
Loading

0 comments on commit 87cd723

Please sign in to comment.