summaryrefslogtreecommitdiff
path: root/utils/zenutils/libraries/beecrypt-4.1.2/beecrypt/blockmode.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/zenutils/libraries/beecrypt-4.1.2/beecrypt/blockmode.h')
-rwxr-xr-xutils/zenutils/libraries/beecrypt-4.1.2/beecrypt/blockmode.h92
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
33extern "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 */
46BEECRYPTAPI
47int 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 */
59BEECRYPTAPI
60int 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 */
72BEECRYPTAPI
73int 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 */
85BEECRYPTAPI
86int 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