annotate des.h @ 713:2f9c4e9ae095 libavutil

Use a wildcard match instead of a list to remove test programs. This is robust against renames and also removes test programs not (yet) hooked up in the main Makefiles.
author diego
date Thu, 26 Mar 2009 10:12:21 +0000
parents ed614f42a5d6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
393
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
1 /*
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
2 * DES encryption/decryption
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
3 * Copyright (c) 2007 Reimar Doeffinger
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
4 *
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
5 * This file is part of FFmpeg.
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
6 *
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
11 *
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
15 * Lesser General Public License for more details.
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
16 *
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
20 */
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
21
567
bd4052d9050c Globally rename the header inclusion guard names.
stefano
parents: 485
diff changeset
22 #ifndef AVUTIL_DES_H
bd4052d9050c Globally rename the header inclusion guard names.
stefano
parents: 485
diff changeset
23 #define AVUTIL_DES_H
393
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
24
458
676e2c142383 This header just needs stdint.h, not inttypes.h, which is a superset of
diego
parents: 405
diff changeset
25 #include <stdint.h>
647
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
26
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
27 struct AVDES {
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
28 uint64_t round_keys[3][16];
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
29 int triple_des;
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
30 };
405
bc871e7ac0dc Add missing #includes to fix 'make checkheaders'.
diego
parents: 396
diff changeset
31
396
ba659469f48f Document ff_des_encdec
reimar
parents: 394
diff changeset
32 /**
647
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
33 * \brief Initializes an AVDES context.
396
ba659469f48f Document ff_des_encdec
reimar
parents: 394
diff changeset
34 *
648
ed614f42a5d6 Add support for 3DES to DES module
reimar
parents: 647
diff changeset
35 * \param key_bits must be 64 or 192
647
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
36 * \param decrypt 0 for encryption, 1 for decryption
396
ba659469f48f Document ff_des_encdec
reimar
parents: 394
diff changeset
37 */
647
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
38 int av_des_init(struct AVDES *d, const uint8_t *key, int key_bits, int decrypt);
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
39
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
40 /**
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
41 * \brief Encrypts / decrypts using the DES algorithm.
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
42 *
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
43 * \param count number of 8 byte blocks
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
44 * \param dst destination array, can be equal to src, must be 8-byte aligned
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
45 * \param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
46 * \param iv initialization vector for CBC mode, if NULL then ECB will be used,
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
47 * must be 8-byte aligned
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
48 * \param decrypt 0 for encryption, 1 for decryption
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
49 */
67fb0b442dd2 Add and use a public API for RC4 and DES, analogous to the AES API.
reimar
parents: 637
diff changeset
50 void av_des_crypt(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
393
df047574d017 Add support for DES en- and decryption.
reimar
parents:
diff changeset
51
567
bd4052d9050c Globally rename the header inclusion guard names.
stefano
parents: 485
diff changeset
52 #endif /* AVUTIL_DES_H */