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

Applies the trapdoor function. More...

#include <pubkey.h>

Inheritance diagram for TrapdoorFunction:
[legend]
Collaboration diagram for TrapdoorFunction:
[legend]

Public Member Functions

virtual ~TrapdoorFunction ()
 
Integer ApplyRandomizedFunction (RandomNumberGenerator &rng, const Integer &x) const
 Applies the trapdoor function. More...
 
bool IsRandomized () const
 Determines if the encryption algorithm is randomized. More...
 
virtual Integer ApplyFunction (const Integer &x) const =0
 Applies the trapdoor. More...
 
- Public Member Functions inherited from RandomizedTrapdoorFunction
virtual ~RandomizedTrapdoorFunction ()
 
- Public Member Functions inherited from TrapdoorFunctionBounds
virtual ~TrapdoorFunctionBounds ()
 
virtual Integer PreimageBound () const =0
 Returns the maximum size of a message before the trapdoor function is applied. More...
 
virtual Integer ImageBound () const =0
 Returns the maximum size of a message after the trapdoor function is applied. More...
 
virtual Integer MaxPreimage () const
 Returns the maximum size of a message before the trapdoor function is applied bound to a public key. More...
 
virtual Integer MaxImage () const
 Returns the maximum size of a message after the trapdoor function is applied bound to a public key. More...
 

Detailed Description

Applies the trapdoor function.

ApplyFunction() is the foundation for encrypting a message under a public key. Derived classes will override it at some point.

See also
TrapdoorFunctionBounds(), RandomizedTrapdoorFunction(), TrapdoorFunction(), RandomizedTrapdoorFunctionInverse() and TrapdoorFunctionInverse()

Definition at line 128 of file pubkey.h.

Constructor & Destructor Documentation

virtual TrapdoorFunction::~TrapdoorFunction ( )
inlinevirtual

Definition at line 131 of file pubkey.h.

Member Function Documentation

virtual Integer TrapdoorFunction::ApplyFunction ( const Integer x) const
pure virtual

Applies the trapdoor.

Parameters
xthe message on which the encryption function is applied
Returns
the message x encrypted under the public key

ApplyFunction is a generalization of encryption under a public key cryptosystem. Derived classes must implement it.

Implemented in RSAFunction_ISO, LUCFunction, RSAFunction, ESIGNFunction, RWFunction, and RabinFunction.

Integer TrapdoorFunction::ApplyRandomizedFunction ( RandomNumberGenerator rng,
const Integer x 
) const
inlinevirtual

Applies the trapdoor function.

Parameters
rnga RandomNumberGenerator derived class
xthe message on which the encryption function is applied

ApplyRandomizedFunction is a generalization of encryption under a public key cryptosystem. The RandomNumberGenerator may (or may not) be required.

Internally, ApplyRandomizedFunction() calls ApplyFunction() without the RandomNumberGenerator.

Implements RandomizedTrapdoorFunction.

Definition at line 140 of file pubkey.h.

bool TrapdoorFunction::IsRandomized ( ) const
inlinevirtual

Determines if the encryption algorithm is randomized.

Returns
true if the encryption algorithm is randomized, false otherwise

If IsRandomized() returns false, then NullRNG() can be used.

Reimplemented from RandomizedTrapdoorFunction.

Definition at line 142 of file pubkey.h.


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