[FFmpeg-devel] [PATCH] DES en-/decryption

Aurelien Jacobs aurel
Sun Oct 14 02:05:36 CEST 2007

On Sat, 13 Oct 2007 22:15:42 +0200
Reimar D?ffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:

> Hello,
> some DES implementation is needed for asf decryption support.
> This version, compared to the one contained in the previous asf patch,
> should be quite a bit faster (not benchmarked though).
> If you think this is not optimized well enough to belong in libavutil I
> tend to suggest to leave it in libavformat unless someone else is
> interested in improving it.

I would prefer seeing it in libavutil.

> I am interested in hearing your comments either way.
> Btw.: this code would allow for the S_boxes_P_shuffle table to be
> generated at compile time, which is an approach I would greatly prefer,
> but I don't know how to implement this in a non-messy way.
> If any of the "Makefile-guys" have some time, maybe you could see if you
> can come up with something? I'd expect this could be used in some other
> code as well (I hope others agree this would be nice).

I haven't really looked at the code, but isn't it possible to simply
generate this table in a des_init() function or something like that ?

> Index: libavutil/des.h
> ===================================================================
> --- libavutil/des.h	(revision 0)
> +++ libavutil/des.h	(revision 0)
> @@ -0,0 +1 @@
> +uint64_t ff_des_encdec(uint64_t in, uint64_t key, int decrypt);

I think you should add multiple inclusion protection.


More information about the ffmpeg-devel mailing list