aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-05-30 14:34:57 -0300
committerJames Almer <jamrial@gmail.com>2018-05-30 14:45:26 -0300
commite3734aa6a33be64c88e10a11fd9d51d23cf6ee6f (patch)
tree9442d5a931ff7b50ea7dfa28edefd1be2929ba68
parent5420c8f76e70f5b390c8df07ab70e8b1e6d7fb75 (diff)
downloadffmpeg-e3734aa6a33be64c88e10a11fd9d51d23cf6ee6f.tar.gz
tools/crypto_bench: add missing RC4 implementation from tomcrypt
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--tools/crypto_bench.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/crypto_bench.c b/tools/crypto_bench.c
index ecbe45f36a..aca8bbb1a8 100644
--- a/tools/crypto_bench.c
+++ b/tools/crypto_bench.c
@@ -528,6 +528,16 @@ static void run_tomcrypt_des(uint8_t *output,
des_ecb_encrypt(input + i, output + i, &des);
}
+static void run_tomcrypt_rc4(uint8_t *output,
+ const uint8_t *input, unsigned size)
+{
+ rc4_state rc4;
+
+ rc4_stream_setup(&rc4, hardcoded_key, 16);
+ rc4_stream_crypt(&rc4, input, size, output);
+ rc4_stream_done(&rc4);
+}
+
static void run_tomcrypt_twofish(uint8_t *output,
const uint8_t *input, unsigned size)
{
@@ -647,10 +657,7 @@ struct hash_impl implementations[] = {
IMPL(lavu, "TWOFISH", twofish, "crc:9edbd5c1")
IMPL(gcrypt, "TWOFISH", twofish, "crc:9edbd5c1")
IMPL(tomcrypt, "TWOFISH", twofish, "crc:9edbd5c1")
- IMPL(lavu, "RC4", rc4, "crc:538d37b2")
- IMPL(crypto, "RC4", rc4, "crc:538d37b2")
- IMPL(gcrypt, "RC4", rc4, "crc:538d37b2")
- IMPL(mbedcrypto, "RC4", rc4, "crc:538d37b2")
+ IMPL_ALL("RC4", rc4, "crc:538d37b2")
IMPL(lavu, "XTEA", xtea, "crc:931fc270")
IMPL(mbedcrypto, "XTEA", xtea, "crc:931fc270")
IMPL(tomcrypt, "XTEA", xtea, "crc:931fc270")