diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2008-07-11 15:50:46 +0000 |
---|---|---|
committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2008-07-11 15:50:46 +0000 |
commit | 14c7f45cdae826f88dc539c8c38dd95caf305731 (patch) | |
tree | 832da054b7cfb2dc6fd63339af736625f31d21aa /utils/zenutils/libraries/beecrypt-4.1.2/beecrypt/blockmode.h | |
parent | 7c84ede3781c27db73403bd6302f320c76a58c8c (diff) | |
download | rockbox-14c7f45cdae826f88dc539c8c38dd95caf305731.tar.gz rockbox-14c7f45cdae826f88dc539c8c38dd95caf305731.zip |
Add zook's ZenUtils to SVN
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18010 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/zenutils/libraries/beecrypt-4.1.2/beecrypt/blockmode.h')
-rwxr-xr-x | utils/zenutils/libraries/beecrypt-4.1.2/beecrypt/blockmode.h | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/utils/zenutils/libraries/beecrypt-4.1.2/beecrypt/blockmode.h b/utils/zenutils/libraries/beecrypt-4.1.2/beecrypt/blockmode.h new file mode 100755 index 0000000000..4f21b81f65 --- /dev/null +++ b/utils/zenutils/libraries/beecrypt-4.1.2/beecrypt/blockmode.h | |||
@@ -0,0 +1,92 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2000, 2002 Virtual Unlimited B.V. | ||
3 | * | ||
4 | * This library is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU Lesser General Public | ||
6 | * License as published by the Free Software Foundation; either | ||
7 | * version 2.1 of the License, or (at your option) any later version. | ||
8 | * | ||
9 | * This library is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * Lesser General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public | ||
15 | * License along with this library; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | /*!\file blockmode.h | ||
21 | * \brief Blockcipher operation modes. | ||
22 | * \todo Additional modes, such as CFB and OFB. | ||
23 | * \author Bob Deblier <bob.deblier@pandora.be> | ||
24 | * \ingroup BC_m | ||
25 | */ | ||
26 | |||
27 | #ifndef _BLOCKMODE_H | ||
28 | #define _BLOCKMODE_H | ||
29 | |||
30 | #include "beecrypt/beecrypt.h" | ||
31 | |||
32 | #ifdef __cplusplus | ||
33 | extern "C" { | ||
34 | #endif | ||
35 | |||
36 | /*!\fn int blockEncryptECB(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks) | ||
37 | * \brief This function encrypts a number of data blocks in Electronic Code | ||
38 | * Book mode. | ||
39 | * \param bc The blockcipher. | ||
40 | * \param bp The cipher's parameter block. | ||
41 | * \param dst The ciphertext data; should be aligned on a 32-bit boundary. | ||
42 | * \param src The cleartext data; should be aligned on a 32-bit boundary. | ||
43 | * \param nblocks The number of blocks to be encrypted. | ||
44 | * \retval 0 on success. | ||
45 | */ | ||
46 | BEECRYPTAPI | ||
47 | int blockEncryptECB(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks); | ||
48 | |||
49 | /*!\fn int blockDecryptECB(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks) | ||
50 | * \brief This function decrypts a number of data blocks in Electronic Code | ||
51 | * Book mode. | ||
52 | * \param bc The blockcipher. | ||
53 | * \param bp The cipher's parameter block. | ||
54 | * \param dst The cleartext data; should be aligned on a 32-bit boundary. | ||
55 | * \param src The ciphertext data; should be aligned on a 32-bit boundary. | ||
56 | * \param nblocks The number of blocks to be decrypted. | ||
57 | * \retval 0 on success. | ||
58 | */ | ||
59 | BEECRYPTAPI | ||
60 | int blockDecryptECB(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks); | ||
61 | |||
62 | /*!\fn int blockEncryptCBC(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks) | ||
63 | * \brief This function encrypts a number of data blocks in Cipher Block | ||
64 | * Chaining mode. | ||
65 | * \param bc The blockcipher. | ||
66 | * \param bp The cipher's parameter block. | ||
67 | * \param dst The ciphertext data; should be aligned on a 32-bit boundary. | ||
68 | * \param src The cleartext data; should be aligned on a 32-bit boundary. | ||
69 | * \param nblocks The number of blocks to be encrypted. | ||
70 | * \retval 0 on success. | ||
71 | */ | ||
72 | BEECRYPTAPI | ||
73 | int blockEncryptCBC(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks); | ||
74 | |||
75 | /*!\fn int blockDecryptCBC(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks) | ||
76 | * \brief This function decrypts a number of data blocks in Cipher Block | ||
77 | * Chaining mode. | ||
78 | * \param bc The blockcipher. | ||
79 | * \param bp The cipher's parameter block. | ||
80 | * \param dst The cleartext data; should be aligned on a 32-bit boundary. | ||
81 | * \param src The ciphertext data; should be aligned on a 32-bit boundary. | ||
82 | * \param nblocks The number of blocks to be decrypted. | ||
83 | * \retval 0 on success. | ||
84 | */ | ||
85 | BEECRYPTAPI | ||
86 | int blockDecryptCBC(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks); | ||
87 | |||
88 | #ifdef __cplusplus | ||
89 | } | ||
90 | #endif | ||
91 | |||
92 | #endif | ||