16
16
NAMESPACE_BEGIN (CryptoPP)
17
17
18
18
// ! \class CipherModeDocumentation
19
- // ! \brief Classes for operating block cipher modes of operation
20
- // ! \details Each class derived from this one defines two types, Encryption and Decryption,
19
+ // ! \brief Block cipher mode of operation information
20
+ // ! \details Each class derived from this one defines two types, Encryption and Decryption,
21
21
// ! both of which implement the SymmetricCipher interface.
22
22
// ! For each mode there are two classes, one of which is a template class,
23
23
// ! and the other one has a name that ends in "_ExternalCipher".
@@ -31,6 +31,8 @@ struct CipherModeDocumentation : public SymmetricCipherDocumentation
31
31
{
32
32
};
33
33
34
+ // ! \class CipherModeBase
35
+ // ! \brief Block cipher mode of operation information
34
36
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CipherModeBase : public SymmetricCipher
35
37
{
36
38
public:
@@ -70,7 +72,7 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CipherModeBase : public SymmetricCipher
70
72
if (!(feedbackSize == 0 || feedbackSize == BlockSize ()))
71
73
throw InvalidArgument (" CipherModeBase: feedback size cannot be specified for this cipher mode" );
72
74
}
73
-
75
+
74
76
// Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46
75
77
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
76
78
virtual void ResizeBuffers ();
@@ -85,6 +87,9 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CipherModeBase : public SymmetricCipher
85
87
AlignedSecByteBlock m_register;
86
88
};
87
89
90
+ // ! \class ModePolicyCommonTemplate
91
+ // ! \brief Block cipher mode of operation common operations
92
+ // ! \tparam POLICY_INTERFACE common operations
88
93
template <class POLICY_INTERFACE >
89
94
class CRYPTOPP_NO_VTABLE ModePolicyCommonTemplate : public CipherModeBase, public POLICY_INTERFACE
90
95
{
@@ -101,6 +106,8 @@ void ModePolicyCommonTemplate<POLICY_INTERFACE>::CipherSetKey(const NameValuePai
101
106
SetFeedbackSize (feedbackSize);
102
107
}
103
108
109
+ // ! \class CFB_ModePolicy
110
+ // ! \brief CFB block cipher mode of operation
104
111
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CFB_ModePolicy : public ModePolicyCommonTemplate<CFB_CipherAbstractPolicy>
105
112
{
106
113
public:
@@ -129,6 +136,8 @@ inline void CopyOrZero(void *dest, const void *src, size_t s)
129
136
memset (dest, 0 , s);
130
137
}
131
138
139
+ // ! \class OFB_ModePolicy
140
+ // ! \brief OFB block cipher mode of operation
132
141
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE OFB_ModePolicy : public ModePolicyCommonTemplate<AdditiveCipherAbstractPolicy>
133
142
{
134
143
public:
@@ -143,6 +152,8 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE OFB_ModePolicy : public ModePolicyCommonTe
143
152
void CipherResynchronize (byte *keystreamBuffer, const byte *iv, size_t length);
144
153
};
145
154
155
+ // ! \class CTR_ModePolicy
156
+ // ! \brief CTR block cipher mode of operation
146
157
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CTR_ModePolicy : public ModePolicyCommonTemplate<AdditiveCipherAbstractPolicy>
147
158
{
148
159
public:
@@ -166,6 +177,8 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CTR_ModePolicy : public ModePolicyCommonTe
166
177
AlignedSecByteBlock m_counterArray;
167
178
};
168
179
180
+ // ! \class BlockOrientedCipherModeBase
181
+ // ! \brief Block cipher mode of operation default implementation
169
182
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BlockOrientedCipherModeBase : public CipherModeBase
170
183
{
171
184
public:
@@ -178,7 +191,7 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BlockOrientedCipherModeBase : public Ciphe
178
191
179
192
protected:
180
193
bool RequireAlignedInput () const {return true ;}
181
-
194
+
182
195
// Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46
183
196
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
184
197
void ResizeBuffers ();
@@ -193,6 +206,8 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BlockOrientedCipherModeBase : public Ciphe
193
206
SecByteBlock m_buffer;
194
207
};
195
208
209
+ // ! \class ECB_OneWay
210
+ // ! \brief ECB block cipher mode of operation default implementation
196
211
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE ECB_OneWay : public BlockOrientedCipherModeBase
197
212
{
198
213
public:
@@ -204,6 +219,8 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE ECB_OneWay : public BlockOrientedCipherMod
204
219
static const char * CRYPTOPP_API StaticAlgorithmName () {return " ECB" ;}
205
220
};
206
221
222
+ // ! \class CBC_ModeBase
223
+ // ! \brief CBC block cipher mode of operation default implementation
207
224
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_ModeBase : public BlockOrientedCipherModeBase
208
225
{
209
226
public:
@@ -213,12 +230,16 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_ModeBase : public BlockOrientedCipherM
213
230
static const char * CRYPTOPP_API StaticAlgorithmName () {return " CBC" ;}
214
231
};
215
232
233
+ // ! \class CBC_Encryption
234
+ // ! \brief CBC block cipher mode of operation encryption operation
216
235
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_Encryption : public CBC_ModeBase
217
236
{
218
237
public:
219
238
void ProcessData (byte *outString, const byte *inString, size_t length);
220
239
};
221
240
241
+ // ! \class CBC_CTS_Encryption
242
+ // ! \brief CBC-CTS block cipher mode of operation encryption operation
222
243
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_CTS_Encryption : public CBC_Encryption
223
244
{
224
245
public:
@@ -237,13 +258,15 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_CTS_Encryption : public CBC_Encryption
237
258
byte *m_stolenIV;
238
259
};
239
260
261
+ // ! \class CBC_Decryption
262
+ // ! \brief CBC block cipher mode of operation decryption operation
240
263
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_Decryption : public CBC_ModeBase
241
264
{
242
265
public:
243
266
void ProcessData (byte *outString, const byte *inString, size_t length);
244
-
267
+
245
268
protected:
246
-
269
+
247
270
// Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46
248
271
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
249
272
void ResizeBuffers ();
@@ -258,14 +281,17 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_Decryption : public CBC_ModeBase
258
281
AlignedSecByteBlock m_temp;
259
282
};
260
283
284
+ // ! \class CBC_CTS_Decryption
285
+ // ! \brief CBC-CTS block cipher mode of operation decryption operation
261
286
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_CTS_Decryption : public CBC_Decryption
262
287
{
263
288
public:
264
289
unsigned int MinLastBlockSize () const {return BlockSize ()+1 ;}
265
290
void ProcessLastBlock (byte *outString, const byte *inString, size_t length);
266
291
};
267
292
268
- // ! _
293
+ // ! \class CipherModeFinalTemplate_CipherHolder
294
+ // ! \brief Block cipher mode of operation aggregate
269
295
template <class CIPHER , class BASE >
270
296
class CipherModeFinalTemplate_CipherHolder : protected ObjectHolder <CIPHER>, public AlgorithmImpl<BASE, CipherModeFinalTemplate_CipherHolder<CIPHER, BASE> >
271
297
{
@@ -296,8 +322,8 @@ class CipherModeFinalTemplate_CipherHolder : protected ObjectHolder<CIPHER>, pub
296
322
};
297
323
298
324
// ! \class CipherModeFinalTemplate_ExternalCipher
299
- // ! \tparam BASE CipherModeFinalTemplate_CipherHolder class
300
- // ! \brief OFB block cipher mode of operation.
325
+ // ! \tparam BASE CipherModeFinalTemplate_CipherHolder base class
326
+ // ! \details
301
327
template <class BASE >
302
328
class CipherModeFinalTemplate_ExternalCipher : public BASE
303
329
{
0 commit comments