Security Scol plugin
Public Member Functions | Protected Member Functions | List of all members
VariableRounds< D, N, M > Class Template Reference

Inherited by algorithms with variable number of rounds. More...

#include <seckey.h>

Public Member Functions

 CRYPTOPP_CONSTANT (DEFAULT_ROUNDS=D)
 The default number of rounds for the algorithm provided as a constant.
 
 CRYPTOPP_CONSTANT (MIN_ROUNDS=N)
 The minimum number of rounds for the algorithm provided as a constant.
 
 CRYPTOPP_CONSTANT (MAX_ROUNDS=M)
 The maximum number of rounds for the algorithm provided as a constant.
 
CRYPTOPP_STATIC_CONSTEXPR unsigned int StaticGetDefaultRounds (size_t keylength)
 The default number of rounds for the algorithm based on key length provided by a static function.
 

Protected Member Functions

void ThrowIfInvalidRounds (int rounds, const Algorithm *alg)
 Validates the number of rounds for an algorithm.
 
unsigned int GetRoundsAndThrowIfInvalid (const NameValuePairs &param, const Algorithm *alg)
 Validates the number of rounds for an algorithm.
 

Detailed Description

template<unsigned int D, unsigned int N = 1, unsigned int M = INT_MAX>
class VariableRounds< D, N, M >

Inherited by algorithms with variable number of rounds.

Template Parameters
DDefault number of rounds
NMinimum number of rounds
MMaximum number of rounds

Definition at line 64 of file seckey.h.

Member Function Documentation

◆ GetRoundsAndThrowIfInvalid()

template<unsigned int D, unsigned int N = 1, unsigned int M = INT_MAX>
unsigned int VariableRounds< D, N, M >::GetRoundsAndThrowIfInvalid ( const NameValuePairs param,
const Algorithm alg 
)
inlineprotected

Validates the number of rounds for an algorithm.

Parameters
paramthe candidate number of rounds
algan Algorithm object used if the number of rounds are invalid
Returns
the number of rounds for the algorithm
Exceptions
InvalidRoundsif the number of rounds are invalid

GetRoundsAndThrowIfInvalid() validates the number of rounds and throws if invalid.

Definition at line 108 of file seckey.h.

◆ StaticGetDefaultRounds()

template<unsigned int D, unsigned int N = 1, unsigned int M = INT_MAX>
CRYPTOPP_STATIC_CONSTEXPR unsigned int VariableRounds< D, N, M >::StaticGetDefaultRounds ( size_t  keylength)
inline

The default number of rounds for the algorithm based on key length provided by a static function.

Parameters
keylengththe size of the key, in bytes

keylength is unused in the default implementation.

Definition at line 77 of file seckey.h.

◆ ThrowIfInvalidRounds()

template<unsigned int D, unsigned int N = 1, unsigned int M = INT_MAX>
void VariableRounds< D, N, M >::ThrowIfInvalidRounds ( int  rounds,
const Algorithm alg 
)
inlineprotected

Validates the number of rounds for an algorithm.

Parameters
roundsthe candidate number of rounds
algan Algorithm object used if the number of rounds are invalid
Exceptions
InvalidRoundsif the number of rounds are invalid

ThrowIfInvalidRounds() validates the number of rounds and throws if invalid.

Definition at line 88 of file seckey.h.


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