Crypto++  5.6.3
Free C++ class library of cryptographic schemes
seckey.h
Go to the documentation of this file.
1 // seckey.h - written and placed in the public domain by Wei Dai
2 
3 //! \file
4 //! \brief Classes and functions for implementing secret key algorithms.
5 
6 #ifndef CRYPTOPP_SECKEY_H
7 #define CRYPTOPP_SECKEY_H
8 
9 #include "config.h"
10 
11 #if CRYPTOPP_MSC_VERSION
12 # pragma warning(push)
13 # pragma warning(disable: 4189)
14 #endif
15 
16 #include "cryptlib.h"
17 #include "misc.h"
18 #include "simple.h"
19 
20 NAMESPACE_BEGIN(CryptoPP)
21 
22 //! \brief Inverts the cipher's direction
23 //! \param dir the cipher's direction
24 //! \returns DECRYPTION if dir is ENCRYPTION, DECRYPTION otherwise
26 {
27  return (dir == ENCRYPTION) ? DECRYPTION : ENCRYPTION;
28 }
29 
30 //! \class FixedBlockSize
31 //! \brief Inherited by block ciphers with fixed block size
32 //! \tparam N the blocksize of the cipher
33 template <unsigned int N>
35 {
36 public:
37  //! \brief The block size of the cipher provided as a constant.
38  CRYPTOPP_CONSTANT(BLOCKSIZE = N)
39 };
40 
41 // ************** rounds ***************
42 
43 //! \class FixedRounds
44 //! \brief Inherited by ciphers with fixed number of rounds
45 //! \tparam R the number of rounds used by the cipher
46 template <unsigned int R>
48 {
49 public:
50  //! \brief The number of rounds for the cipher provided as a constant.
51  CRYPTOPP_CONSTANT(ROUNDS = R)
52 };
53 
54 //! \class VariableRounds
55 //! \brief Inherited by ciphers with variable number of rounds
56 //! \tparam D Default number of rounds
57 //! \tparam N Minimum number of rounds
58 //! \tparam D Maximum number of rounds
59 template <unsigned int D, unsigned int N=1, unsigned int M=INT_MAX> // use INT_MAX here because enums are treated as signed ints
61 {
62 public:
63  //! \brief The default number of rounds for the cipher provided as a constant.
64  CRYPTOPP_CONSTANT(DEFAULT_ROUNDS = D)
65  //! \brief The minimum number of rounds for the cipher provided as a constant.
66  CRYPTOPP_CONSTANT(MIN_ROUNDS = N)
67  //! \brief The maximum number of rounds for the cipher provided as a constant.
68  CRYPTOPP_CONSTANT(MAX_ROUNDS = M)
69  //! \brief The default number of rounds for the cipher based on key length
70  //! provided by a static function.
71  //! \param keylength the size of the key, in bytes
72  //! \details keylength is unused in the default implementation.
73  static unsigned int StaticGetDefaultRounds(size_t keylength)
74  {CRYPTOPP_UNUSED(keylength); return DEFAULT_ROUNDS;}
75 
76 protected:
77  //! \brief Validates the number of rounds for a cipher.
78  //! \param rounds the canddiate number of rounds
79  //! \param alg an Algorithm object used if the number of rounds are invalid
80  //! \throws InvalidRounds if the number of rounds are invalid
81  inline void ThrowIfInvalidRounds(int rounds, const Algorithm *alg)
82  {
83 #if (M==INT_MAX) // Coverity and result_independent_of_operands
84  if (rounds < MIN_ROUNDS)
85  throw InvalidRounds(alg ? alg->AlgorithmName() : "VariableRounds", rounds);
86 #else
87  if (rounds < MIN_ROUNDS || rounds > MAX_ROUNDS)
88  throw InvalidRounds(alg ? alg->AlgorithmName() : "VariableRounds", rounds);
89 #endif
90  }
91 
92  //! \brief Validates the number of rounds for a cipher
93  //! \param param the canddiate number of rounds
94  //! \param alg an Algorithm object used if the number of rounds are invalid
95  //! \returns the number of rounds for the cipher
96  //! \throws InvalidRounds if the number of rounds are invalid
97  inline unsigned int GetRoundsAndThrowIfInvalid(const NameValuePairs &param, const Algorithm *alg)
98  {
99  int rounds = param.GetIntValueWithDefault("Rounds", DEFAULT_ROUNDS);
100  ThrowIfInvalidRounds(rounds, alg);
101  return (unsigned int)rounds;
102  }
103 };
104 
105 // ************** key length ***************
106 
107 //! \class FixedKeyLength
108 //! \brief Inherited by keyed algorithms with fixed key length
109 //! \tparam N Default key length, in bytes
110 //! \tparam IV_REQ The IV requirements. See IV_Requirement in cryptlib.h for allowed values
111 //! \tparam IV_L Default IV length, in bytes
112 template <unsigned int N, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE, unsigned int IV_L = 0>
114 {
115 public:
116  //! \brief The default key length used by the cipher provided as a constant
117  //! \details KEYLENGTH is provided in bytes, not bits
118  CRYPTOPP_CONSTANT(KEYLENGTH=N)
119  //! \brief The minimum key length used by the cipher provided as a constant
120  //! \details MIN_KEYLENGTH is provided in bytes, not bits
121  CRYPTOPP_CONSTANT(MIN_KEYLENGTH=N)
122  //! \brief The maximum key length used by the cipher provided as a constant
123  //! \details MAX_KEYLENGTH is provided in bytes, not bits
124  CRYPTOPP_CONSTANT(MAX_KEYLENGTH=N)
125  //! \brief The default key length used by the cipher provided as a constant
126  //! \details DEFAULT_KEYLENGTH is provided in bytes, not bits
127  CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH=N)
128  //! \brief The default IV requirements for the cipher provided as a constant
129  //! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement
130  //! in cryptlib.h for allowed values.
131  CRYPTOPP_CONSTANT(IV_REQUIREMENT = IV_REQ)
132  //! \brief The default IV length used by the cipher provided as a constant
133  //! \details IV_LENGTH is provided in bytes, not bits. The default implementation uses 0.
134  CRYPTOPP_CONSTANT(IV_LENGTH = IV_L)
135  //! \brief The default key length for the cipher provided by a static function.
136  //! \param keylength the size of the key, in bytes
137  //! \details The default implementation returns KEYLENGTH. keylength is unused
138  //! in the default implementation.
139  static size_t CRYPTOPP_API StaticGetValidKeyLength(size_t keylength)
140  {CRYPTOPP_UNUSED(keylength); return KEYLENGTH;}
141 };
142 
143 //! \class VariableKeyLength
144 //! \brief Inherited by keyed algorithms with variable key length
145 //! \tparam D Default key length, in bytes
146 //! \tparam N Minimum key length, in bytes
147 //! \tparam M Maximum key length, in bytes
148 //! \tparam M Default key length multiple, in bytes. The default multiple is 1.
149 //! \tparam IV_REQ The IV requirements. See IV_Requirement in cryptlib.h for allowed values
150 //! \tparam IV_L Default IV length, in bytes. The default length is 0.
151 template <unsigned int D, unsigned int N, unsigned int M, unsigned int Q = 1, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE, unsigned int IV_L = 0>
153 {
154  // Make these private to avoid Doxygen documenting them in all derived classes
156  CRYPTOPP_COMPILE_ASSERT(N % Q == 0);
157  CRYPTOPP_COMPILE_ASSERT(M % Q == 0);
159  CRYPTOPP_COMPILE_ASSERT(D >= N);
160  CRYPTOPP_COMPILE_ASSERT(M >= D);
161 
162 public:
163  //! \brief The minimum key length used by the cipher provided as a constant
164  //! \details MIN_KEYLENGTH is provided in bytes, not bits
165  CRYPTOPP_CONSTANT(MIN_KEYLENGTH=N)
166  //! \brief The maximum key length used by the cipher provided as a constant
167  //! \details MAX_KEYLENGTH is provided in bytes, not bits
168  CRYPTOPP_CONSTANT(MAX_KEYLENGTH=M)
169  //! \brief The default key length used by the cipher provided as a constant
170  //! \details DEFAULT_KEYLENGTH is provided in bytes, not bits
171  CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH=D)
172  //! \brief The key length multiple used by the cipher provided as a constant
173  //! \details MAX_KEYLENGTH is provided in bytes, not bits
174  CRYPTOPP_CONSTANT(KEYLENGTH_MULTIPLE=Q)
175  //! \brief The default IV requirements for the cipher provided as a constant
176  //! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement
177  //! in cryptlib.h for allowed values.
178  CRYPTOPP_CONSTANT(IV_REQUIREMENT=IV_REQ)
179  //! \brief The default initialization vector length for the cipher provided as a constant
180  //! \details IV_LENGTH is provided in bytes, not bits. The default implementation uses 0.
181  CRYPTOPP_CONSTANT(IV_LENGTH=IV_L)
182  //! \brief Provides a valid key length for the cipher provided by a static function.
183  //! \param keylength the size of the key, in bytes
184  //! \details If keylength is less than MIN_KEYLENGTH, then the function returns
185  //! MIN_KEYLENGTH. If keylength is greater than MAX_KEYLENGTH, then the function
186  //! returns MAX_KEYLENGTH. If keylength is a multiple of KEYLENGTH_MULTIPLE,
187  //! then keylength is returned. Otherwise, the function returns keylength rounded
188  //! \a down to the next smaller multiple of KEYLENGTH_MULTIPLE.
189  //! \details keylength is provided in bytes, not bits.
190  static size_t CRYPTOPP_API StaticGetValidKeyLength(size_t keylength)
191  {
192 #if MIN_KEYLENGTH > 0
193  if (keylength < (size_t)MIN_KEYLENGTH)
194  return MIN_KEYLENGTH;
195  else
196 #endif
197  if (keylength > (size_t)MAX_KEYLENGTH)
198  return (size_t)MAX_KEYLENGTH;
199  else
200  {
201  keylength += KEYLENGTH_MULTIPLE-1;
202  return keylength - keylength%KEYLENGTH_MULTIPLE;
203  }
204  }
205 };
206 
207 //! \class SameKeyLengthAs
208 //! \brief Provides key lengths based on another class's key length
209 //! \tparam T another FixedKeyLength or VariableKeyLength class
210 //! \tparam IV_REQ The IV requirements. See IV_Requirement in cryptlib.h for allowed values
211 //! \tparam IV_L Default IV length, in bytes
212 template <class T, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE, unsigned int IV_L = 0>
214 {
215 public:
216  //! \brief The minimum key length used by the cipher provided as a constant
217  //! \details MIN_KEYLENGTH is provided in bytes, not bits
218  CRYPTOPP_CONSTANT(MIN_KEYLENGTH=T::MIN_KEYLENGTH)
219  //! \brief The maximum key length used by the cipher provided as a constant
220  //! \details MIN_KEYLENGTH is provided in bytes, not bits
221  CRYPTOPP_CONSTANT(MAX_KEYLENGTH=T::MAX_KEYLENGTH)
222  //! \brief The default key length used by the cipher provided as a constant
223  //! \details MIN_KEYLENGTH is provided in bytes, not bits
224  CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH=T::DEFAULT_KEYLENGTH)
225  //! \brief The default IV requirements for the cipher provided as a constant
226  //! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement
227  //! in cryptlib.h for allowed values.
228  CRYPTOPP_CONSTANT(IV_REQUIREMENT=IV_REQ)
229  //! \brief The default initialization vector length for the cipher provided as a constant
230  //! \details IV_LENGTH is provided in bytes, not bits. The default implementation uses 0.
231  CRYPTOPP_CONSTANT(IV_LENGTH=IV_L)
232  //! \brief Provides a valid key length for the cipher provided by a static function.
233  //! \param keylength the size of the key, in bytes
234  //! \details If keylength is less than MIN_KEYLENGTH, then the function returns
235  //! MIN_KEYLENGTH. If keylength is greater than MAX_KEYLENGTH, then the function
236  //! returns MAX_KEYLENGTH. If keylength is a multiple of KEYLENGTH_MULTIPLE,
237  //! then keylength is returned. Otherwise, the function returns keylength rounded
238  //! \a down to the next smaller multiple of KEYLENGTH_MULTIPLE.
239  //! \details keylength is provided in bytes, not bits.
240  static size_t CRYPTOPP_API StaticGetValidKeyLength(size_t keylength)
241  {return T::StaticGetValidKeyLength(keylength);}
242 };
243 
244 // ************** implementation helper for SimpleKeyed ***************
245 
246 //! \class SimpleKeyingInterfaceImpl
247 //! \brief Provides class member functions to access SimpleKeyingInterface constants
248 //! \tparam BASE a SimpleKeyingInterface derived class
249 //! \tparam INFO a SimpleKeyingInterface derived class
250 template <class BASE, class INFO = BASE>
251 class CRYPTOPP_NO_VTABLE SimpleKeyingInterfaceImpl : public BASE
252 {
253 public:
254  //! \brief The minimum key length used by the cipher
255  size_t MinKeyLength() const
256  {return INFO::MIN_KEYLENGTH;}
257 
258  //! \brief The maximum key length used by the cipher
259  size_t MaxKeyLength() const
260  {return (size_t)INFO::MAX_KEYLENGTH;}
261 
262  //! \brief The default key length used by the cipher
263  size_t DefaultKeyLength() const
264  {return INFO::DEFAULT_KEYLENGTH;}
265 
266  //! \brief Provides a valid key length for the cipher
267  //! \param keylength the size of the key, in bytes
268  //! \details keylength is provided in bytes, not bits. If keylength is less than MIN_KEYLENGTH,
269  //! then the function returns MIN_KEYLENGTH. If keylength is greater than MAX_KEYLENGTH,
270  //! then the function returns MAX_KEYLENGTH. if If keylength is a multiple of KEYLENGTH_MULTIPLE,
271  //! then keylength is returned. Otherwise, the function returns a \a lower multiple of
272  //! KEYLENGTH_MULTIPLE.
273  size_t GetValidKeyLength(size_t keylength) const {return INFO::StaticGetValidKeyLength(keylength);}
274 
275  //! \brief The default IV requirements for the cipher
276  //! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement
277  //! in cryptlib.h for allowed values.
279  {return (SimpleKeyingInterface::IV_Requirement)INFO::IV_REQUIREMENT;}
280 
281  //! \brief The default initialization vector length for the cipher
282  //! \details IVSize is provided in bytes, not bits. The default implementation uses IV_LENGTH, which is 0.
283  unsigned int IVSize() const
284  {return INFO::IV_LENGTH;}
285 };
286 
287 //! \class BlockCipherImpl
288 //! \brief Provides class member functions to access BlockCipher constants
289 //! \tparam INFO a SimpleKeyingInterface derived class
290 //! \tparam BASE a SimpleKeyingInterface derived class
291 template <class INFO, class BASE = BlockCipher>
292 class CRYPTOPP_NO_VTABLE BlockCipherImpl : public AlgorithmImpl<SimpleKeyingInterfaceImpl<TwoBases<BASE, INFO> > >
293 {
294 public:
295  //! Provides the block size of the cipher
296  //! \returns the block size of the cipher, in bytes
297  unsigned int BlockSize() const {return this->BLOCKSIZE;}
298 };
299 
300 //! \class BlockCipherFinal
301 //! \brief Provides class member functions to key a block cipher
302 //! \tparam DIR a CipherDir
303 //! \tparam BASE a BlockCipherImpl derived class
304 template <CipherDir DIR, class BASE>
305 class BlockCipherFinal : public ClonableImpl<BlockCipherFinal<DIR, BASE>, BASE>
306 {
307 public:
308  //! \brief Construct a default BlockCipherFinal
309  //! \details The cipher is not keyed.
311 
312  //! \brief Construct a BlockCipherFinal
313  //! \param key a byte array used to key the cipher
314  //! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls
315  //! SimpleKeyingInterface::SetKey.
316  BlockCipherFinal(const byte *key)
317  {this->SetKey(key, this->DEFAULT_KEYLENGTH);}
318 
319  //! \brief Construct a BlockCipherFinal
320  //! \param key a byte array used to key the cipher
321  //! \param length the length of the byte array
322  //! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls
323  //! SimpleKeyingInterface::SetKey.
324  BlockCipherFinal(const byte *key, size_t length)
325  {this->SetKey(key, length);}
326 
327  //! \brief Construct a BlockCipherFinal
328  //! \param key a byte array used to key the cipher
329  //! \param length the length of the byte array
330  //! \param rounds the number of rounds
331  //! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls
332  //! SimpleKeyingInterface::SetKeyWithRounds.
333  BlockCipherFinal(const byte *key, size_t length, unsigned int rounds)
334  {this->SetKeyWithRounds(key, length, rounds);}
335 
336  //! \brief Provides the direction of the cipher
337  //! \returns true if DIR is ENCRYPTION, false otherwise
338  //! \sa IsForwardTransformation(), IsPermutation(), GetCipherDirection()
339  bool IsForwardTransformation() const {return DIR == ENCRYPTION;}
340 };
341 
342 //! \class MessageAuthenticationCodeImpl
343 //! \brief Provides class member functions to access MessageAuthenticationCode constants
344 //! \tparam INFO a SimpleKeyingInterface derived class
345 //! \tparam BASE a SimpleKeyingInterface derived class
346 template <class BASE, class INFO = BASE>
347 class MessageAuthenticationCodeImpl : public AlgorithmImpl<SimpleKeyingInterfaceImpl<BASE, INFO>, INFO>
348 {
349 };
350 
351 //! \class MessageAuthenticationCodeFinal
352 //! \brief Provides class member functions to key a message authentication code
353 //! \tparam DIR a CipherDir
354 //! \tparam BASE a BlockCipherImpl derived class
355 template <class BASE>
356 class MessageAuthenticationCodeFinal : public ClonableImpl<MessageAuthenticationCodeFinal<BASE>, MessageAuthenticationCodeImpl<BASE> >
357 {
358 public:
359  //! \brief Construct a default MessageAuthenticationCodeFinal
360  //! \details The message authentication code is not keyed.
362  //! \brief Construct a BlockCipherFinal
363  //! \param key a byte array used to key the cipher
364  //! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls
365  //! SimpleKeyingInterface::SetKey.
367  {this->SetKey(key, this->DEFAULT_KEYLENGTH);}
368  //! \brief Construct a BlockCipherFinal
369  //! \param key a byte array used to key the cipher
370  //! \param length the length of the byte array
371  //! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls
372  //! SimpleKeyingInterface::SetKey.
373  MessageAuthenticationCodeFinal(const byte *key, size_t length)
374  {this->SetKey(key, length);}
375 };
376 
377 // ************** documentation ***************
378 
379 //! \class BlockCipherDocumentation
380 //! \brief Provides Encryption and Decryption typedefs used by derived classes to
381 //! implement a block cipher
382 //! \details These objects usually should not be used directly. See CipherModeDocumentation
383 //! instead. Each class derived from this one defines two types, Encryption and Decryption,
384 //! both of which implement the BlockCipher interface.
386 {
387  //! implements the BlockCipher interface
389  //! implements the BlockCipher interface
391 };
392 
393 //! \class SymmetricCipherDocumentation
394 //! \brief Provides Encryption and Decryption typedefs used by derived classes to
395 //! implement a symmetric cipher
396 //! \details Each class derived from this one defines two types, Encryption and Decryption,
397 //! both of which implement the SymmetricCipher interface. Two types of classes derive
398 //! from this class: stream ciphers and block cipher modes. Stream ciphers can be used
399 //! alone, cipher mode classes need to be used with a block cipher. See CipherModeDocumentation
400 //! for more for information about using cipher modes and block ciphers.
402 {
403  //! implements the SymmetricCipher interface
405  //! implements the SymmetricCipher interface
407 };
408 
409 //! \class AuthenticatedSymmetricCipherDocumentation
410 //! \brief Provides Encryption and Decryption typedefs used by derived classes to
411 //! implement an authenticated encryption cipher
412 //! \details Each class derived from this one defines two types, Encryption and Decryption,
413 //! both of which implement the AuthenticatedSymmetricCipher interface.
415 {
416  //! implements the AuthenticatedSymmetricCipher interface
418  //! implements the AuthenticatedSymmetricCipher interface
420 };
421 
422 NAMESPACE_END
423 
424 #if CRYPTOPP_MSC_VERSION
425 # pragma warning(pop)
426 #endif
427 
428 #endif
Inherited by keyed algorithms with fixed key length.
Definition: seckey.h:113
Classes providing simple keying interfaces.
Utility functions for the Crypto++ library.
Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher...
Definition: seckey.h:385
MessageAuthenticationCodeFinal(const byte *key, size_t length)
Construct a BlockCipherFinal.
Definition: seckey.h:373
Interface for one direction (encryption or decryption) of a stream cipher or block cipher mode with a...
Definition: cryptlib.h:1036
Base class for identifying alogorithm.
Definition: simple.h:26
Provides class member functions to access SimpleKeyingInterface constants.
Definition: seckey.h:251
CipherDir
Specifies a direction for a cipher to operate.
Definition: cryptlib.h:102
Abstract base classes that provide a uniform interface to this library.
unsigned int BlockSize() const
Provides the block size of the cipher.
Definition: seckey.h:297
Provides Encryption and Decryption typedefs used by derived classes to implement an authenticated enc...
Definition: seckey.h:414
Library configuration file.
Provides class member functions to key a message authentication code.
Definition: seckey.h:356
BlockCipherFinal(const byte *key)
Construct a BlockCipherFinal.
Definition: seckey.h:316
BlockCipher Decryption
implements the BlockCipher interface
Definition: seckey.h:390
Interface for one direction (encryption or decryption) of a block cipher.
Definition: cryptlib.h:1013
Inherited by block ciphers with fixed block size.
Definition: seckey.h:34
BlockCipher Encryption
implements the BlockCipher interface
Definition: seckey.h:388
Inherited by ciphers with variable number of rounds.
Definition: seckey.h:60
int GetIntValueWithDefault(const char *name, int defaultValue) const
Get a named value with type int, with default.
Definition: cryptlib.h:364
BlockCipherFinal()
Construct a default BlockCipherFinal.
Definition: seckey.h:310
Exception thrown when an invalid number of rounds is encountered.
Definition: simple.h:55
size_t DefaultKeyLength() const
The default key length used by the cipher.
Definition: seckey.h:263
#define CRYPTOPP_COMPILE_ASSERT(expr)
Compile time assertion.
Definition: misc.h:98
Interface for one direction (encryption or decryption) of a stream cipher or cipher mode...
Definition: cryptlib.h:1020
Provides class member functions to key a block cipher.
Definition: seckey.h:305
virtual std::string AlgorithmName() const
Provides the name of this algorithm.
Definition: cryptlib.h:488
Provides class member functions to access MessageAuthenticationCode constants.
Definition: seckey.h:347
MessageAuthenticationCodeFinal(const byte *key)
Construct a BlockCipherFinal.
Definition: seckey.h:366
bool IsForwardTransformation() const
Provides the direction of the cipher.
Definition: seckey.h:339
size_t GetValidKeyLength(size_t keylength) const
Provides a valid key length for the cipher.
Definition: seckey.h:273
Provides key lengths based on another class&#39;s key length.
Definition: seckey.h:213
Inherited by ciphers with fixed number of rounds.
Definition: seckey.h:47
CipherDir ReverseCipherDir(CipherDir dir)
Inverts the cipher&#39;s direction.
Definition: seckey.h:25
SymmetricCipher Decryption
implements the SymmetricCipher interface
Definition: seckey.h:406
Inherited by keyed algorithms with variable key length.
Definition: seckey.h:152
Interface for all crypto algorithms.
Definition: cryptlib.h:469
Provides Encryption and Decryption typedefs used by derived classes to implement a symmetric cipher...
Definition: seckey.h:401
AuthenticatedSymmetricCipher Encryption
implements the AuthenticatedSymmetricCipher interface
Definition: seckey.h:417
IV_Requirement
Provides IV requirements as an enumerated value.
Definition: cryptlib.h:555
BlockCipherFinal(const byte *key, size_t length, unsigned int rounds)
Construct a BlockCipherFinal.
Definition: seckey.h:333
Provides class member functions to access BlockCipher constants.
Definition: seckey.h:292
Crypto++ library namespace.
static const int BLOCKSIZE
The block size of the cipher provided as a constant.
Definition: seckey.h:38
AuthenticatedSymmetricCipher Decryption
implements the AuthenticatedSymmetricCipher interface
Definition: seckey.h:419
SimpleKeyingInterface::IV_Requirement IVRequirement() const
The default IV requirements for the cipher.
Definition: seckey.h:278
BlockCipherFinal(const byte *key, size_t length)
Construct a BlockCipherFinal.
Definition: seckey.h:324
unsigned int IVSize() const
The default initialization vector length for the cipher.
Definition: seckey.h:283
size_t MaxKeyLength() const
The maximum key length used by the cipher.
Definition: seckey.h:259
SymmetricCipher Encryption
implements the SymmetricCipher interface
Definition: seckey.h:404
size_t MinKeyLength() const
The minimum key length used by the cipher.
Definition: seckey.h:255
MessageAuthenticationCodeFinal()
Construct a default MessageAuthenticationCodeFinal.
Definition: seckey.h:361
Interface for retrieving values given their names.
Definition: cryptlib.h:261
Base class for identifying alogorithm.
Definition: simple.h:38