From 92d107a17127c29036b71e53315a2c702960819a Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Wed, 11 Nov 2015 22:09:41 +0200 Subject: xtea: Add functions for little endian mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavutil/xtea.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'libavutil/xtea.h') diff --git a/libavutil/xtea.h b/libavutil/xtea.h index ad76955db4..78b1f378db 100644 --- a/libavutil/xtea.h +++ b/libavutil/xtea.h @@ -54,6 +54,15 @@ AVXTEA *av_xtea_alloc(void); */ void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]); +/** + * Initialize an AVXTEA context. + * + * @param ctx an AVXTEA context + * @param key a key of 16 bytes used for encryption/decryption, + * interpreted as little endian 32 bit numbers + */ +void av_xtea_le_init(struct AVXTEA *ctx, const uint8_t key[16]); + /** * Encrypt or decrypt a buffer using a previously initialized context, * in big endian format. @@ -68,6 +77,20 @@ void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]); void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); +/** + * Encrypt or decrypt a buffer using a previously initialized context, + * in little endian format. + * + * @param ctx an AVXTEA context + * @param dst destination array, can be equal to src + * @param src source array, can be equal to dst + * @param count number of 8 byte blocks + * @param iv initialization vector for CBC mode, if NULL then ECB will be used + * @param decrypt 0 for encryption, 1 for decryption + */ +void av_xtea_le_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src, + int count, uint8_t *iv, int decrypt); + /** * @} */ -- cgit v1.2.3