[FFmpeg-devel] tools: crypto_bench: Added support for Twofish

Michael Niedermayer michaelni at gmx.at
Sat Feb 14 11:54:36 CET 2015


On Sat, Feb 14, 2015 at 02:03:23PM +0530, supraja reddy wrote:
> Hello,
> 
> I have added the necessary functions for twofish in crypto_bench.
> A note, there is no twofish implementation in openssl library but since the
> code demands that all the libraries have the impl, i have introduced a
> dummy function. Please let me know if anything has to be changed.
> 
> Thanks,
> Supraja

>  crypto_bench.c |   42 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
> ad53f4022b8d892e9790a7421b806ab16cd12443  cb.patch
> From 8b195ee7057d65d8cd2f81357af2a700317c993e Mon Sep 17 00:00:00 2001
> From: Supraja Meedinti <supraja0493 at gmail.com>
> Date: Sat, 14 Feb 2015 13:21:37 +0530
> Subject: [PATCH] tools: crypto_bench: added support for Twofish
> 
> Signed-off-by: Supraja Meedinti <supraja0493 at gmail.com>
> ---
>  tools/crypto_bench.c | 42 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
> 
> diff --git a/tools/crypto_bench.c b/tools/crypto_bench.c
> index 5e56d12..6b8a7e0 100644
> --- a/tools/crypto_bench.c
> +++ b/tools/crypto_bench.c
> @@ -77,6 +77,7 @@ struct hash_impl {
>  #include "libavutil/aes.h"
>  #include "libavutil/camellia.h"
>  #include "libavutil/cast5.h"
> +#include "libavutil/twofish.h"
>  
>  #define IMPL_USE_lavu IMPL_USE
>  
> @@ -133,6 +134,15 @@ static void run_lavu_cast128(uint8_t *output,
>      av_cast5_crypt(cast, output, input, size >> 3, 0);
>  }
>  
> +static void run_lavu_twofish(uint8_t *output,
> +                              const uint8_t *input, unsigned size)
> +{
> +    static struct AVTWOFISH *twofish;
> +    if (!twofish && !(twofish = av_twofish_alloc()))

the memory should be freed somewhere
otherwise memory debuggers would likely display a warning about a
memleak (which could make it harder to see real problems)

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150214/922dc5cf/attachment.asc>


More information about the ffmpeg-devel mailing list