Fabcoin Core  0.16.2
P2P Digital Currency
Public Member Functions | List of all members
PasswordBasedKeyDerivationFunction Class Referenceabstract

Abstract base class for password based key derivation function. More...

#include <pwdbased.h>

Inheritance diagram for PasswordBasedKeyDerivationFunction:
[legend]

Public Member Functions

virtual ~PasswordBasedKeyDerivationFunction ()
 
virtual size_t MaxDerivedKeyLength () const =0
 Provides the maximum derived key length. More...
 
virtual bool UsesPurposeByte () const =0
 Determines if the derivation function uses the purpose byte. More...
 
virtual unsigned int DeriveKey (byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds=0) const =0
 Derive key from the password. More...
 

Detailed Description

Abstract base class for password based key derivation function.

Definition at line 17 of file pwdbased.h.

Constructor & Destructor Documentation

virtual PasswordBasedKeyDerivationFunction::~PasswordBasedKeyDerivationFunction ( )
inlinevirtual

Definition at line 20 of file pwdbased.h.

Member Function Documentation

virtual unsigned int PasswordBasedKeyDerivationFunction::DeriveKey ( byte derived,
size_t  derivedLen,
byte  purpose,
const byte password,
size_t  passwordLen,
const byte salt,
size_t  saltLen,
unsigned int  iterations,
double  timeInSeconds = 0 
) const
pure virtual

Derive key from the password.

Parameters
derivedthe byte buffer to receive the derived password
derivedLenthe size of the byte buffer to receive the derived password
purposean octet indicating the purpose of the derivation
passwordthe byte buffer with the password
passwordLenthe size of the password, in bytes
saltthe byte buffer with the salt
saltLenthe size of the salt, in bytes
iterationsthe number of iterations to attempt
timeInSecondsthe length of time the derivation function should execute
Returns
iteration count achieved

DeriveKey returns the actual iteration count achieved. If timeInSeconds == 0, then the complete number of iterations will be obtained. If timeInSeconds != 0, then DeriveKey will iterate until time elapsed, as measured by ThreadUserTimer.

Implemented in PKCS12_PBKDF< T >, PKCS5_PBKDF2_HMAC< T >, and PKCS5_PBKDF1< T >.

Here is the caller graph for this function:

virtual size_t PasswordBasedKeyDerivationFunction::MaxDerivedKeyLength ( ) const
pure virtual

Provides the maximum derived key length.

Returns
maximum derived key length, in bytes

Implemented in PKCS12_PBKDF< T >, PKCS5_PBKDF2_HMAC< T >, and PKCS5_PBKDF1< T >.

virtual bool PasswordBasedKeyDerivationFunction::UsesPurposeByte ( ) const
pure virtual

Determines if the derivation function uses the purpose byte.

Returns
true if the derivation function uses the purpose byte, false otherwise

Implemented in PKCS12_PBKDF< T >, PKCS5_PBKDF2_HMAC< T >, and PKCS5_PBKDF1< T >.


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