On Tue, Jul 03, 2012 at 01:40:36PM +0200, Samuel Pitoiset wrote:
> --- /dev/null
> +++ b/libavutil/xtea.c
> @@ -0,0 +1,165 @@
> +
> +static const uint8_t xtea_test_key[XTEA_NUM_TESTS][16] = {
> + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
> + 0x0c, 0x0d, 0x0e, 0x0f },
> + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
> + 0x0c, 0x0d, 0x0e, 0x0f },
> + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
> + 0x0c, 0x0d, 0x0e, 0x0f },
> + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00 },
> + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00 },
> + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00 }
nit: This would look nicer with eight entries per line.
> --- /dev/null
> +++ b/libavutil/xtea.h
> @@ -0,0 +1,61 @@
> +
> +typedef struct AVXTEA {
> + uint32_t key[16];
> +} AVXTEA;
> +
> +/**
> + * @brief Initialize an AVXTEA context.
We usually skip the @brief.
> + * @param x an AVXTEA context
I think "ctx" would be a better variable name.
> + * @param key a key
All you can say is that it is "a key"?
> + */
> +void av_xtea_init(struct AVXTEA *x, const uint8_t key[16]);
> +
> +/**
> + * @brief Encrypt or decrypt a buffer using a previously initialized context.
ditto
> + * @param x an AVXTEA context
> + */
> +void av_xtea_crypt(struct AVXTEA *x, uint8_t *dst, const uint8_t *src,
> + int count, uint8_t *iv, int decrypt);
ditto
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel