Fabcoin Core  0.16.2
P2P Digital Currency
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_STATIC_CONSTEXPR unsigned int StaticGetDefaultRounds (size_t keylength)
 The default number of rounds for the algorithm provided as a constant. More...
 

Protected Member Functions

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

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 66 of file seckey.h.

Member Function Documentation

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 110 of file seckey.h.

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 provided as a constant.

The minimum number of rounds for the algorithm provided as a constant. The maximum number of rounds for the algorithm provided as a constant. 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 79 of file seckey.h.

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 90 of file seckey.h.


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