[FFmpeg-devel] libavutil: optimize twofish cipher

Michael Niedermayer michaelni at gmx.at
Mon Feb 16 12:40:21 CET 2015

On Mon, Feb 16, 2015 at 03:11:08PM +0530, supraja reddy wrote:
> Hello,
> I have attached a patch with optimization for twofish. Please let me know
> if any further changes required.
> Following are the results for crypto_bench after optimization.

> lavu       TWOFISH      size: 1048576  runs:   1024  time:   18.799 +- 0.132
> gcrypt     TWOFISH      size: 1048576  runs:   1024  time:   25.643 +- 0.096
> tomcrypt   TWOFISH      size: 1048576  runs:   1024  time:   18.372 +- 0.082

please put these into the commit message, also add a
"before" value for lavu       TWOFISH so it can be seen by how much
this commit makes the code faster

> +static uint32_t MDS[4][256];

doesnt thiis depend on the key(size) ?
static variables must not change because code could be called from
different threads at the same time and the static array would be shared
so it could only be correct for one of the 2 threads, the other would
produce a wrong result

also it seems theres no fate test for twofish yet, such test should
be usefull for testing / detecting regressions as its automatically
run on many different platforms


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle
-------------- 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/20150216/17303c37/attachment.asc>

More information about the ffmpeg-devel mailing list