Crypto++  5.6.3
Free C++ class library of cryptographic schemes
modes.h
Go to the documentation of this file.
1 // modes.h - written and placed in the public domain by Wei Dai
2 
3 //! \file modes.h
4 //! \brief Class file for modes of operation.
5 
6 #ifndef CRYPTOPP_MODES_H
7 #define CRYPTOPP_MODES_H
8 
9 #include "cryptlib.h"
10 #include "secblock.h"
11 #include "misc.h"
12 #include "strciphr.h"
13 #include "argnames.h"
14 #include "algparam.h"
15 
16 NAMESPACE_BEGIN(CryptoPP)
17 
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,
21 //! both of which implement the SymmetricCipher interface.
22 //! For each mode there are two classes, one of which is a template class,
23 //! and the other one has a name that ends in "_ExternalCipher".
24 //! The "external cipher" mode objects hold a reference to the underlying block cipher,
25 //! instead of holding an instance of it. The reference must be passed in to the constructor.
26 //! For the "cipher holder" classes, the CIPHER template parameter should be a class
27 //! derived from BlockCipherDocumentation, for example DES or AES.
28 //! \details See NIST SP 800-38A for definitions of these modes. See
29 //! AuthenticatedSymmetricCipherDocumentation for authenticated encryption modes.
31 {
32 };
33 
34 class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CipherModeBase : public SymmetricCipher
35 {
36 public:
37  size_t MinKeyLength() const {return m_cipher->MinKeyLength();}
38  size_t MaxKeyLength() const {return m_cipher->MaxKeyLength();}
39  size_t DefaultKeyLength() const {return m_cipher->DefaultKeyLength();}
40  size_t GetValidKeyLength(size_t n) const {return m_cipher->GetValidKeyLength(n);}
41  bool IsValidKeyLength(size_t n) const {return m_cipher->IsValidKeyLength(n);}
42 
43  unsigned int OptimalDataAlignment() const {return m_cipher->OptimalDataAlignment();}
44 
45  unsigned int IVSize() const {return BlockSize();}
46  virtual IV_Requirement IVRequirement() const =0;
47 
48  void SetCipher(BlockCipher &cipher)
49  {
50  this->ThrowIfResynchronizable();
51  this->m_cipher = &cipher;
52  this->ResizeBuffers();
53  }
54 
55  void SetCipherWithIV(BlockCipher &cipher, const byte *iv, int feedbackSize = 0)
56  {
57  this->ThrowIfInvalidIV(iv);
58  this->m_cipher = &cipher;
59  this->ResizeBuffers();
60  this->SetFeedbackSize(feedbackSize);
61  if (this->IsResynchronizable())
62  this->Resynchronize(iv);
63  }
64 
65 protected:
66  CipherModeBase() : m_cipher(NULL) {}
67  inline unsigned int BlockSize() const {assert(m_register.size() > 0); return (unsigned int)m_register.size();}
68  virtual void SetFeedbackSize(unsigned int feedbackSize)
69  {
70  if (!(feedbackSize == 0 || feedbackSize == BlockSize()))
71  throw InvalidArgument("CipherModeBase: feedback size cannot be specified for this cipher mode");
72  }
73 
74 // Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46
75 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
76  virtual void ResizeBuffers();
77 #else
78  virtual void ResizeBuffers()
79  {
80  m_register.New(m_cipher->BlockSize());
81  }
82 #endif
83 
84  BlockCipher *m_cipher;
85  AlignedSecByteBlock m_register;
86 };
87 
88 template <class POLICY_INTERFACE>
89 class CRYPTOPP_NO_VTABLE ModePolicyCommonTemplate : public CipherModeBase, public POLICY_INTERFACE
90 {
91  unsigned int GetAlignment() const {return m_cipher->OptimalDataAlignment();}
92  void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length);
93 };
94 
95 template <class POLICY_INTERFACE>
96 void ModePolicyCommonTemplate<POLICY_INTERFACE>::CipherSetKey(const NameValuePairs &params, const byte *key, size_t length)
97 {
98  m_cipher->SetKey(key, length, params);
99  ResizeBuffers();
100  int feedbackSize = params.GetIntValueWithDefault(Name::FeedbackSize(), 0);
101  SetFeedbackSize(feedbackSize);
102 }
103 
104 class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CFB_ModePolicy : public ModePolicyCommonTemplate<CFB_CipherAbstractPolicy>
105 {
106 public:
108  static const char * CRYPTOPP_API StaticAlgorithmName() {return "CFB";}
109 
110 protected:
111  unsigned int GetBytesPerIteration() const {return m_feedbackSize;}
112  byte * GetRegisterBegin() {return m_register + BlockSize() - m_feedbackSize;}
113  bool CanIterate() const {return m_feedbackSize == BlockSize();}
114  void Iterate(byte *output, const byte *input, CipherDir dir, size_t iterationCount);
115  void TransformRegister();
116  void CipherResynchronize(const byte *iv, size_t length);
117  void SetFeedbackSize(unsigned int feedbackSize);
118  void ResizeBuffers();
119 
120  SecByteBlock m_temp;
121  unsigned int m_feedbackSize;
122 };
123 
124 inline void CopyOrZero(void *dest, const void *src, size_t s)
125 {
126  if (src)
127  memcpy_s(dest, s, src, s);
128  else
129  memset(dest, 0, s);
130 }
131 
132 class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE OFB_ModePolicy : public ModePolicyCommonTemplate<AdditiveCipherAbstractPolicy>
133 {
134 public:
135  bool CipherIsRandomAccess() const {return false;}
137  static const char * CRYPTOPP_API StaticAlgorithmName() {return "OFB";}
138 
139 private:
140  unsigned int GetBytesPerIteration() const {return BlockSize();}
141  unsigned int GetIterationsToBuffer() const {return m_cipher->OptimalNumberOfParallelBlocks();}
142  void WriteKeystream(byte *keystreamBuffer, size_t iterationCount);
143  void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length);
144 };
145 
146 class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CTR_ModePolicy : public ModePolicyCommonTemplate<AdditiveCipherAbstractPolicy>
147 {
148 public:
149  bool CipherIsRandomAccess() const {return true;}
151  static const char * CRYPTOPP_API StaticAlgorithmName() {return "CTR";}
152 
153 protected:
154  virtual void IncrementCounterBy256();
155 
156  unsigned int GetAlignment() const {return m_cipher->OptimalDataAlignment();}
157  unsigned int GetBytesPerIteration() const {return BlockSize();}
158  unsigned int GetIterationsToBuffer() const {return m_cipher->OptimalNumberOfParallelBlocks();}
159  void WriteKeystream(byte *buffer, size_t iterationCount)
160  {OperateKeystream(WRITE_KEYSTREAM, buffer, NULL, iterationCount);}
161  bool CanOperateKeystream() const {return true;}
162  void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
163  void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length);
164  void SeekToIteration(lword iterationCount);
165 
166  AlignedSecByteBlock m_counterArray;
167 };
168 
169 class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BlockOrientedCipherModeBase : public CipherModeBase
170 {
171 public:
172  void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params);
173  unsigned int MandatoryBlockSize() const {return BlockSize();}
174  bool IsRandomAccess() const {return false;}
175  bool IsSelfInverting() const {return false;}
176  bool IsForwardTransformation() const {return m_cipher->IsForwardTransformation();}
177  void Resynchronize(const byte *iv, int length=-1) {memcpy_s(m_register, m_register.size(), iv, ThrowIfInvalidIVLength(length));}
178 
179 protected:
180  bool RequireAlignedInput() const {return true;}
181 
182  // Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46
183 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
184  void ResizeBuffers();
185 #else
186  void ResizeBuffers()
187  {
188  CipherModeBase::ResizeBuffers();
189  m_buffer.New(BlockSize());
190  }
191 #endif
192 
193  SecByteBlock m_buffer;
194 };
195 
196 class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE ECB_OneWay : public BlockOrientedCipherModeBase
197 {
198 public:
199  void SetKey(const byte *key, size_t length, const NameValuePairs &params = g_nullNameValuePairs)
200  {m_cipher->SetKey(key, length, params); BlockOrientedCipherModeBase::ResizeBuffers();}
202  unsigned int OptimalBlockSize() const {return BlockSize() * m_cipher->OptimalNumberOfParallelBlocks();}
203  void ProcessData(byte *outString, const byte *inString, size_t length);
204  static const char * CRYPTOPP_API StaticAlgorithmName() {return "ECB";}
205 };
206 
207 class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_ModeBase : public BlockOrientedCipherModeBase
208 {
209 public:
211  bool RequireAlignedInput() const {return false;}
212  unsigned int MinLastBlockSize() const {return 0;}
213  static const char * CRYPTOPP_API StaticAlgorithmName() {return "CBC";}
214 };
215 
216 class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_Encryption : public CBC_ModeBase
217 {
218 public:
219  void ProcessData(byte *outString, const byte *inString, size_t length);
220 };
221 
222 class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_CTS_Encryption : public CBC_Encryption
223 {
224 public:
225  void SetStolenIV(byte *iv) {m_stolenIV = iv;}
226  unsigned int MinLastBlockSize() const {return BlockSize()+1;}
227  void ProcessLastBlock(byte *outString, const byte *inString, size_t length);
228  static const char * CRYPTOPP_API StaticAlgorithmName() {return "CBC/CTS";}
229 
230 protected:
231  void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params)
232  {
233  CBC_Encryption::UncheckedSetKey(key, length, params);
234  m_stolenIV = params.GetValueWithDefault(Name::StolenIV(), (byte *)NULL);
235  }
236 
237  byte *m_stolenIV;
238 };
239 
240 class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_Decryption : public CBC_ModeBase
241 {
242 public:
243  void ProcessData(byte *outString, const byte *inString, size_t length);
244 
245 protected:
246 
247  // Thanks to Zireael, http://github.com/weidai11/cryptopp/pull/46
248 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
249  void ResizeBuffers();
250 #else
251  void ResizeBuffers()
252  {
253  BlockOrientedCipherModeBase::ResizeBuffers();
254  m_temp.New(BlockSize());
255  }
256 #endif
257 
258  AlignedSecByteBlock m_temp;
259 };
260 
261 class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_CTS_Decryption : public CBC_Decryption
262 {
263 public:
264  unsigned int MinLastBlockSize() const {return BlockSize()+1;}
265  void ProcessLastBlock(byte *outString, const byte *inString, size_t length);
266 };
267 
268 //! _
269 template <class CIPHER, class BASE>
270 class CipherModeFinalTemplate_CipherHolder : protected ObjectHolder<CIPHER>, public AlgorithmImpl<BASE, CipherModeFinalTemplate_CipherHolder<CIPHER, BASE> >
271 {
272 public:
274  {
275  this->m_cipher = &this->m_object;
276  this->ResizeBuffers();
277  }
278  CipherModeFinalTemplate_CipherHolder(const byte *key, size_t length)
279  {
280  this->m_cipher = &this->m_object;
281  this->SetKey(key, length);
282  }
283  CipherModeFinalTemplate_CipherHolder(const byte *key, size_t length, const byte *iv)
284  {
285  this->m_cipher = &this->m_object;
286  this->SetKey(key, length, MakeParameters(Name::IV(), ConstByteArrayParameter(iv, this->m_cipher->BlockSize())));
287  }
288  CipherModeFinalTemplate_CipherHolder(const byte *key, size_t length, const byte *iv, int feedbackSize)
289  {
290  this->m_cipher = &this->m_object;
291  this->SetKey(key, length, MakeParameters(Name::IV(), ConstByteArrayParameter(iv, this->m_cipher->BlockSize()))(Name::FeedbackSize(), feedbackSize));
292  }
293 
294  static std::string CRYPTOPP_API StaticAlgorithmName()
295  {return CIPHER::StaticAlgorithmName() + "/" + BASE::StaticAlgorithmName();}
296 };
297 
298 //! \class CipherModeFinalTemplate_ExternalCipher
299 //! \tparam BASE CipherModeFinalTemplate_CipherHolder class
300 //! \brief OFB block cipher mode of operation.
301 template <class BASE>
303 {
304 public:
307  {this->SetCipher(cipher);}
308  CipherModeFinalTemplate_ExternalCipher(BlockCipher &cipher, const byte *iv, int feedbackSize = 0)
309  {this->SetCipherWithIV(cipher, iv, feedbackSize);}
310 
311  std::string AlgorithmName() const
312  {return (this->m_cipher ? this->m_cipher->AlgorithmName() + "/" : std::string("")) + BASE::StaticAlgorithmName();}
313 };
314 
318 
319 //! \class CFB_Mode
320 //! \brief CFB block cipher mode of operation.
321 template <class CIPHER>
323 {
326 };
327 
328 //! \class CFB_Mode_ExternalCipher
329 //! \brief CFB mode, external cipher.
331 {
334 };
335 
336 //! \class CFB_FIPS_Mode
337 //! \brief CFB block cipher mode of operation providing FIPS validated cryptography.
338 //! \details Requires full block plaintext according to FIPS 800-38A
339 template <class CIPHER>
341 {
344 };
345 
346 //! \class CFB_FIPS_Mode_ExternalCipher
347 //! \brief CFB mode, external cipher, providing FIPS validated cryptography.
348 //! \details Requires full block plaintext according to FIPS 800-38A
350 {
353 };
354 
356 
357 //! \class OFB_Mode
358 //! \brief OFB block cipher mode of operation.
359 template <class CIPHER>
361 {
363  typedef Encryption Decryption;
364 };
365 
366 //! \class OFB_Mode_ExternalCipher
367 //! \brief OFB mode, external cipher.
369 {
371  typedef Encryption Decryption;
372 };
373 
376 
377 //! \class CTR_Mode
378 //! \brief CTR block cipher mode of operation.
379 template <class CIPHER>
381 {
383  typedef Encryption Decryption;
384 };
385 
386 //! \class CTR_Mode_ExternalCipher
387 //! \brief CTR mode, external cipher.
389 {
390  typedef CipherModeFinalTemplate_ExternalCipher<ConcretePolicyHolder<Empty, AdditiveCipherTemplate<AbstractPolicyHolder<AdditiveCipherAbstractPolicy, CTR_ModePolicy> > > > Encryption;
391  typedef Encryption Decryption;
392 };
393 
394 //! \class ECB_Mode
395 //! \brief ECB block cipher mode of operation.
396 template <class CIPHER>
398 {
401 };
402 
403 CRYPTOPP_DLL_TEMPLATE_CLASS CipherModeFinalTemplate_ExternalCipher<ECB_OneWay>;
404 
405 //! \class ECB_Mode_ExternalCipher
406 //! \brief ECB mode, external cipher.
408 {
409  typedef CipherModeFinalTemplate_ExternalCipher<ECB_OneWay> Encryption;
410  typedef Encryption Decryption;
411 };
412 
413 //! CBC mode
414 template <class CIPHER>
416 {
419 };
420 
423 
424 //! CBC mode, external cipher
426 {
427  typedef CipherModeFinalTemplate_ExternalCipher<CBC_Encryption> Encryption;
428  typedef CipherModeFinalTemplate_ExternalCipher<CBC_Decryption> Decryption;
429 };
430 
431 //! CBC mode with ciphertext stealing
432 template <class CIPHER>
434 {
437 };
438 
441 
442 //! \class CBC_CTS_Mode_ExternalCipher
443 //! \brief CBC mode with ciphertext stealing, external cipher
445 {
446  typedef CipherModeFinalTemplate_ExternalCipher<CBC_CTS_Encryption> Encryption;
447  typedef CipherModeFinalTemplate_ExternalCipher<CBC_CTS_Decryption> Decryption;
448 };
449 
450 #ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
451 typedef CFB_Mode_ExternalCipher::Encryption CFBEncryption;
452 typedef CFB_Mode_ExternalCipher::Decryption CFBDecryption;
454 typedef CTR_Mode_ExternalCipher::Encryption CounterMode;
455 #endif
456 
457 NAMESPACE_END
458 
459 #endif
bool IsSelfInverting() const
Determines whether the cipher is self-inverting.
Definition: modes.h:175
virtual void ProcessLastBlock(byte *outString, const byte *inString, size_t length)
Encrypt or decrypt the last block of data.
Definition: cryptlib.cpp:248
Used to pass byte array input as part of a NameValuePairs object.
Definition: algparam.h:29
OFB block cipher mode of operation.
Definition: modes.h:302
Standard names for retrieving values by name when working with NameValuePairs.
An invalid argument was detected.
Definition: cryptlib.h:182
const char * FeedbackSize()
int
Definition: argnames.h:24
void Resynchronize(const byte *iv, int length=-1)
Resynchronize with an IV.
Definition: modes.h:177
Classes for working with NameValuePairs.
size_t GetValidKeyLength(size_t n) const
Definition: modes.h:40
virtual void ProcessData(byte *outString, const byte *inString, size_t length)=0
Encrypt or decrypt an array of bytes.
Utility functions for the Crypto++ library.
virtual void SetKey(const byte *key, size_t length, const NameValuePairs &params=g_nullNameValuePairs)
Sets or reset the key of this object.
Definition: cryptlib.cpp:101
CFB mode, external cipher, providing FIPS validated cryptography.
Definition: modes.h:349
IV_Requirement IVRequirement() const
Minimal requirement for secure IVs.
Definition: modes.h:107
T GetValueWithDefault(const char *name, T defaultValue) const
Get a named value.
Definition: cryptlib.h:348
bool IsRandomAccess() const
Determines whether the cipher supports random access.
Definition: modes.h:174
CipherDir
Specifies a direction for a cipher to operate.
Definition: cryptlib.h:103
size_t MinKeyLength() const
Returns smallest valid key length in bytes.
Definition: modes.h:37
Abstract base classes that provide a uniform interface to this library.
void memcpy_s(void *dest, size_t sizeInBytes, const void *src, size_t count)
Bounds checking replacement for memcpy()
Definition: misc.h:356
Base class for feedback based stream ciphers with SymmetricCipher interface.
Definition: strciphr.h:487
The object does not use an IV.
Definition: cryptlib.h:600
Wirte the keystream to the output buffer, input is NULL.
Definition: strciphr.h:94
SecBlock typedef.
Definition: secblock.h:728
CBC mode with ciphertext stealing.
Definition: modes.h:433
CTR block cipher mode of operation.
Definition: modes.h:380
IV_Requirement IVRequirement() const
Minimal requirement for secure IVs.
Definition: modes.h:150
Interface for one direction (encryption or decryption) of a block cipher.
Definition: cryptlib.h:1091
const char * StolenIV()
byte *
Definition: argnames.h:22
Classes and functions for secure memory allocations.
ECB block cipher mode of operation.
Definition: modes.h:397
bool IsForwardTransformation() const
Determines if the cipher is being operated in its forward direction.
Definition: modes.h:176
IV_Requirement IVRequirement() const
Minimal requirement for secure IVs.
Definition: modes.h:136
Base class for feedback based stream ciphers in the reverse direction with SymmetricCipher interface...
Definition: strciphr.h:560
Uses encapsulation to hide an object in derived classes.
Definition: misc.h:198
unsigned int IVSize() const
Returns length of the IV accepted by this object.
Definition: modes.h:45
int GetIntValueWithDefault(const char *name, int defaultValue) const
Get a named value with type int, with default.
Definition: cryptlib.h:380
AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed=true)
Create an object that implements NameValuePairs.
Definition: algparam.h:554
CFB mode, external cipher.
Definition: modes.h:330
bool IsResynchronizable() const
Determines if the object can be resynchronized.
Definition: cryptlib.h:611
unsigned int OptimalDataAlignment() const
Provides input and output data alignment for optimal performance.
Definition: modes.h:43
virtual void Resynchronize(const byte *iv, int ivLength=-1)
Resynchronize with an IV.
Definition: cryptlib.h:653
size_t DefaultKeyLength() const
Returns default (recommended) key length in bytes.
Definition: modes.h:39
void SetKey(const byte *key, size_t length, const NameValuePairs &params=g_nullNameValuePairs)
Sets or reset the key of this object.
Definition: modes.h:199
Classes for operating block cipher modes of operation.
Definition: modes.h:30
Interface for one direction (encryption or decryption) of a stream cipher or cipher mode...
Definition: cryptlib.h:1099
ECB mode, external cipher.
Definition: modes.h:407
const NameValuePairs & g_nullNameValuePairs
An empty set of name-value pairs.
Definition: cryptlib.cpp:80
unsigned int MinLastBlockSize() const
returns the minimum size of the last block, 0 indicating the last block is not special ...
Definition: modes.h:226
SecBlock using AllocatorWithCleanup typedef.
Definition: secblock.h:734
unsigned int OptimalBlockSize() const
Provides the input block size most efficient for this cipher.
Definition: modes.h:202
Base class for feedback based stream ciphers in the forward direction with SymmetricCipher interface...
Definition: strciphr.h:550
OFB block cipher mode of operation.
Definition: modes.h:360
size_t MaxKeyLength() const
Returns largest valid key length in bytes.
Definition: modes.h:38
CBC mode, external cipher.
Definition: modes.h:425
const char * BlockSize()
int, in bytes
Definition: argnames.h:26
CFB block cipher mode of operation.
Definition: modes.h:322
bool IsValidKeyLength(size_t n) const
Returns whether keylength is a valid key length.
Definition: modes.h:41
OFB mode, external cipher.
Definition: modes.h:368
virtual IV_Requirement IVRequirement() const =0
Minimal requirement for secure IVs.
const char * IV()
ConstByteArrayParameter, also accepts const byte * for backwards compatibility.
Definition: argnames.h:21
Classes for implementing stream ciphers.
Provides Encryption and Decryption typedefs used by derived classes to implement a symmetric cipher...
Definition: seckey.h:412
IV_Requirement
Secure IVs requirements as enumerated values.
Definition: cryptlib.h:590
bool CipherIsRandomAccess() const
Flag indicating random access.
Definition: modes.h:149
CTR mode, external cipher.
Definition: modes.h:388
unsigned int MinLastBlockSize() const
returns the minimum size of the last block, 0 indicating the last block is not special ...
Definition: modes.h:264
void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params)
Sets the key for this object without performing parameter validation.
Definition: modes.cpp:154
IV_Requirement IVRequirement() const
Minimal requirement for secure IVs.
Definition: modes.h:210
KeystreamOperation
Keystream operation flags.
Definition: strciphr.h:92
Crypto++ library namespace.
bool CipherIsRandomAccess() const
Flag indicating random access.
Definition: modes.h:135
unsigned int MandatoryBlockSize() const
Provides the mandatory block size of the cipher.
Definition: modes.h:173
The IV must be random and unpredictable.
Definition: cryptlib.h:596
unsigned int MinLastBlockSize() const
returns the minimum size of the last block, 0 indicating the last block is not special ...
Definition: modes.h:212
IV_Requirement IVRequirement() const
Minimal requirement for secure IVs.
Definition: modes.h:201
Base class for additive stream ciphers with SymmetricCipher interface.
Definition: strciphr.h:269
CFB block cipher mode of operation providing FIPS validated cryptography.
Definition: modes.h:340
The IV must be unique.
Definition: cryptlib.h:592
Interface for retrieving values given their names.
Definition: cryptlib.h:277
The IV must be random and possibly predictable.
Definition: cryptlib.h:594
CBC mode.
Definition: modes.h:415
CBC mode with ciphertext stealing, external cipher.
Definition: modes.h:444
Base class for identifying alogorithm.
Definition: simple.h:38