annotate lib/libavutil/xtea.h @ 2219:e6771956e74a

for mouse
author Ritor1
date Mon, 17 Feb 2014 17:28:06 +0600
parents 992d2e6f907d
children
rev   line source
2134
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2 * A 32-bit implementation of the XTEA algorithm
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3 * Copyright (c) 2012 Samuel Pitoiset
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
5 * This file is part of FFmpeg.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
6 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
11 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
15 * Lesser General Public License for more details.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
16 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
20 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
21
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
22 #ifndef AVUTIL_XTEA_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
23 #define AVUTIL_XTEA_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
24
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
25 #include <stdint.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
26
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
27 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
28 * @defgroup lavu_xtea XTEA
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
29 * @ingroup lavu_crypto
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
30 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
31 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
32
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
33 typedef struct AVXTEA {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
34 uint32_t key[16];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
35 } AVXTEA;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
36
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
37 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
38 * Initialize an AVXTEA context.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
39 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
40 * @param ctx an AVXTEA context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
41 * @param key a key of 16 bytes used for encryption/decryption
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
42 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
43 void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
44
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
45 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
46 * Encrypt or decrypt a buffer using a previously initialized context.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
47 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
48 * @param ctx an AVXTEA context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
49 * @param dst destination array, can be equal to src
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
50 * @param src source array, can be equal to dst
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
51 * @param count number of 8 byte blocks
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
52 * @param iv initialization vector for CBC mode, if NULL then ECB will be used
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
53 * @param decrypt 0 for encryption, 1 for decryption
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
54 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
55 void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
56 int count, uint8_t *iv, int decrypt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
57
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
58 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
59 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
60 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
61
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
62 #endif /* AVUTIL_XTEA_H */