[FFmpeg-devel] [PATCH] install aes.h, des.h and rc4.h

Michael Niedermayer michaelni
Fri Feb 6 21:17:58 CET 2009


On Wed, Feb 04, 2009 at 07:12:40PM +0100, Reimar D?ffinger wrote:
> Hello,
> those headers are not currently installed.
> If I understood the plans right, they should be since they are supposed
> to provide a public API now.
> In order to improve consistency, the struct AVAES structure would be
> made public as well, and av_aes_size removed at the next version bump.
> Any comments/opinions?

installing the 3 headers and making AVAES public are 2 seperate things and
should be in 2 seperate patches

well anyway i can of course review its like it is as well


> 
> Greetings,
> Reimar D?ffinger

> Index: libavutil/aes.c
> ===================================================================
> --- libavutil/aes.c	(revision 16989)
> +++ libavutil/aes.c	(working copy)
> @@ -20,18 +20,15 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> +#include "avutil.h"
>  #include "common.h"
>  #include "aes.h"
>  
> -typedef struct AVAES{
> -    // Note: round_key[16] is accessed in the init code, but this only
> -    // overwrites state, which does not matter (see also r7471).
> -    uint8_t round_key[15][4][4];
> -    uint8_t state[2][4][4];
> -    int rounds;
> -}AVAES;
> +typedef struct AVAES AVAES;
>  
> +#if LIBAVUTIL_VERSION_MAJOR < 50
>  const int av_aes_size= sizeof(AVAES);
> +#endif
>  
>  static const uint8_t rcon[10] = {
>    0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36
> Index: libavutil/aes.h
> ===================================================================
> --- libavutil/aes.h	(revision 16989)
> +++ libavutil/aes.h	(working copy)
> @@ -23,10 +23,14 @@
>  
>  #include <stdint.h>
>  
> -extern const int av_aes_size;
> +struct AVAES{
> +    // Note: round_key[16] is accessed in the init code, but this only
> +    // overwrites state, which does not matter (see also r7471).
> +    uint8_t round_key[15][4][4];
> +    uint8_t state[2][4][4];
> +    int rounds;
> +};
>  
> -struct AVAES;
> -
>  /**
>   * Initializes an AVAES context.
>   * @param key_bits 128, 192 or 256

i dont like casting AVAES in stone, the inconvenience from a
single alloca() is not worth it
so not ok


> Index: libavutil/Makefile
> ===================================================================
> --- libavutil/Makefile	(revision 16989)
> +++ libavutil/Makefile	(working copy)
> @@ -3,11 +3,13 @@
>  NAME = avutil
>  
>  HEADERS = adler32.h                                                     \
> +          aes.h                                                         \
>            avstring.h                                                    \
>            avutil.h                                                      \
>            base64.h                                                      \
>            common.h                                                      \
>            crc.h                                                         \
> +          des.h                                                         \
>            fifo.h                                                        \
>            intfloat_readwrite.h                                          \
>            log.h                                                         \
> @@ -17,6 +19,7 @@
>            mem.h                                                         \
>            random.h                                                      \
>            rational.h                                                    \
> +          rc4.h                                                         \
>            sha1.h
>  
>  OBJS = adler32.o                                                        \

ok if you are sure that you do not want to change the API of rc4/des
and are sure you want the struct public.


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090206/cabd3662/attachment.pgp>



More information about the ffmpeg-devel mailing list