X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=tools%2Fcrypto_bench.c;h=0aff4ea784c29a93e070a09436c732f04b3473fc;hb=b8accd1175d20ab308de69dbd06bda06a02183e3;hp=aca8bbb1a85d6d2eda7875c1250afd18cdd1bc5f;hpb=5c1aafff2d844b177b0b20db4a38d8460992558b;p=ffmpeg diff --git a/tools/crypto_bench.c b/tools/crypto_bench.c index aca8bbb1a85..0aff4ea784c 100644 --- a/tools/crypto_bench.c +++ b/tools/crypto_bench.c @@ -19,7 +19,7 @@ */ /* Optional external libraries; can be enabled using: - * make VERSUS=crypto+gcrypt+tomcrypt tools/crypto_bench */ + * make VERSUS=crypto+gcrypt+tomcrypt+mbedcrypto tools/crypto_bench */ #define USE_crypto 0x01 /* OpenSSL's libcrypto */ #define USE_gcrypt 0x02 /* GnuTLS's libgcrypt */ #define USE_tomcrypt 0x04 /* LibTomCrypt */ @@ -665,8 +665,8 @@ struct hash_impl implementations[] = { int main(int argc, char **argv) { - uint8_t *input = av_malloc(MAX_INPUT_SIZE * 2); - uint8_t *output = input + MAX_INPUT_SIZE; + uint8_t *input; + uint8_t *output; unsigned i, impl, size; int opt; @@ -702,12 +702,14 @@ int main(int argc, char **argv) exit(opt != 'h'); } } - + input = av_malloc(MAX_INPUT_SIZE * 2); if (!input) fatal_error("out of memory"); for (i = 0; i < MAX_INPUT_SIZE; i += 4) AV_WB32(input + i, i); + output = input + MAX_INPUT_SIZE; + size = MAX_INPUT_SIZE; for (impl = 0; impl < FF_ARRAY_ELEMS(implementations); impl++) run_implementation(input, output, &implementations[impl], size);