[FFmpeg-devel] [RFC] Public API for RC4 and DES

Reimar Döffinger Reimar.Doeffinger
Mon Feb 2 18:53:55 CET 2009

On Wed, Jan 28, 2009 at 03:17:27PM +0100, Reimar D?ffinger wrote:
> attached patch makes them use an API similar to AES.
> Differences:
> - src is const
> - alignment requirements of src and dst documented
> - src == NULL is allowed for easier use as PRNG
> - RC4 does not implement CBC (what would be the IV length for RC4?
>   Would a one-byte IV even be useful?)
> - block size, relative to which count is given, is 16 bytes for AES,
>   8 bytes for DES and 1 byte for RC4
> The disadvantage for the only user asfcrypt is that it adds two
> malloc/frees per ASF block, at least with the current design.

An unpdated version: the structs themselves are now public,
ff_des_encdec is kept exported (but not part of the public API) so newer
libavutil versions will work with older libavcodec,
and av_des_init now actually makes a sense: it generates the round keys
(sorry, I forgot this could be extracted - it was actually discussed
during the review when this code was added).

Reimar D?ffinger
-------------- next part --------------
A non-text attachment was scrubbed...
Name: des_rc4_api.diff
Type: text/x-diff
Size: 7974 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090202/3e253f44/attachment.diff>

More information about the ffmpeg-devel mailing list