SameKeyLengthAs< T, IV_REQ, IV_L > Class Template Reference

Provides key lengths based on another class's key length. More...

List of all members.

Static Public Member Functions

static size_t StaticGetValidKeyLength (size_t keylength)
 Provides a valid key length for the cipher provided by a static function.

Static Public Attributes

static const int MIN_KEYLENGTH = T::MIN_KEYLENGTH
 The minimum key length used by the cipher provided as a constant.
static const int MAX_KEYLENGTH = T::MAX_KEYLENGTH
 The maximum key length used by the cipher provided as a constant.
static const int DEFAULT_KEYLENGTH = T::DEFAULT_KEYLENGTH
 The default key length used by the cipher provided as a constant.
static const int IV_REQUIREMENT = IV_REQ
 The default IV requirements for the cipher provided as a constant.
static const int IV_LENGTH = IV_L
 The default initialization vector length for the cipher provided as a constant.

Detailed Description

template<class T, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE, unsigned int IV_L = 0>
class SameKeyLengthAs< T, IV_REQ, IV_L >

Provides key lengths based on another class's key length.

Template Parameters:
T another FixedKeyLength or VariableKeyLength class
IV_REQ The IV requirements. See IV_Requirement in cryptlib.h for allowed values
IV_L Default IV length, in bytes

Definition at line 213 of file seckey.h.


Member Function Documentation

template<class T, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE, unsigned int IV_L = 0>
static size_t SameKeyLengthAs< T, IV_REQ, IV_L >::StaticGetValidKeyLength ( size_t  keylength  )  [inline, static]

Provides a valid key length for the cipher provided by a static function.

Parameters:
keylength the size of the key, in bytes

If keylength is less than MIN_KEYLENGTH, then the function returns MIN_KEYLENGTH. If keylength is greater than MAX_KEYLENGTH, then the function returns MAX_KEYLENGTH. If keylength is a multiple of KEYLENGTH_MULTIPLE, then keylength is returned. Otherwise, the function returns keylength rounded down to the next smaller multiple of KEYLENGTH_MULTIPLE.

keylength is provided in bytes, not bits.

Definition at line 240 of file seckey.h.

Referenced by SameKeyLengthAs< T >::StaticGetValidKeyLength().


Member Data Documentation

template<class T, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE, unsigned int IV_L = 0>
const int SameKeyLengthAs< T, IV_REQ, IV_L >::MIN_KEYLENGTH = T::MIN_KEYLENGTH [static]

The minimum key length used by the cipher provided as a constant.

MIN_KEYLENGTH is provided in bytes, not bits

Definition at line 218 of file seckey.h.

template<class T, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE, unsigned int IV_L = 0>
const int SameKeyLengthAs< T, IV_REQ, IV_L >::MAX_KEYLENGTH = T::MAX_KEYLENGTH [static]

The maximum key length used by the cipher provided as a constant.

MIN_KEYLENGTH is provided in bytes, not bits

Definition at line 221 of file seckey.h.

template<class T, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE, unsigned int IV_L = 0>
const int SameKeyLengthAs< T, IV_REQ, IV_L >::DEFAULT_KEYLENGTH = T::DEFAULT_KEYLENGTH [static]

The default key length used by the cipher provided as a constant.

MIN_KEYLENGTH is provided in bytes, not bits

Definition at line 224 of file seckey.h.

template<class T, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE, unsigned int IV_L = 0>
const int SameKeyLengthAs< T, IV_REQ, IV_L >::IV_REQUIREMENT = IV_REQ [static]

The default IV requirements for the cipher provided as a constant.

The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement in cryptlib.h for allowed values.

Definition at line 228 of file seckey.h.

template<class T, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE, unsigned int IV_L = 0>
const int SameKeyLengthAs< T, IV_REQ, IV_L >::IV_LENGTH = IV_L [static]

The default initialization vector length for the cipher provided as a constant.

IV_LENGTH is provided in bytes, not bits. The default implementation uses 0.

Definition at line 231 of file seckey.h.


The documentation for this class was generated from the following file:

Generated on 24 Mar 2016 for Crypto++ by  doxygen 1.6.1