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

Interface for public-key encryptors and decryptors. More...

#include <cryptlib.h>

Inheritance diagram for PK_CryptoSystem:
[legend]

Public Member Functions

virtual ~PK_CryptoSystem ()
 
virtual size_t MaxPlaintextLength (size_t ciphertextLength) const =0
 Provides the maximum length of plaintext for a given ciphertext length. More...
 
virtual size_t CiphertextLength (size_t plaintextLength) const =0
 Calculate the length of ciphertext given length of plaintext. More...
 
virtual bool ParameterSupported (const char *name) const =0
 Determines whether this object supports the use of a named parameter. More...
 
virtual size_t FixedCiphertextLength () const
 Provides the fixed ciphertext length, if one exists. More...
 
virtual size_t FixedMaxPlaintextLength () const
 Provides the maximum plaintext length given a fixed ciphertext length. More...
 

Detailed Description

Interface for public-key encryptors and decryptors.

This class provides an interface common to encryptors and decryptors for querying their plaintext and ciphertext lengths.

Definition at line 2293 of file cryptlib.h.

Constructor & Destructor Documentation

virtual PK_CryptoSystem::~PK_CryptoSystem ( )
inlinevirtual

Definition at line 2296 of file cryptlib.h.

Member Function Documentation

virtual size_t PK_CryptoSystem::CiphertextLength ( size_t  plaintextLength) const
pure virtual

Calculate the length of ciphertext given length of plaintext.

Returns
the maximum size of the ciphertext, in bytes

This function returns 0 if plaintextLength is not valid (too long).

Implemented in DL_CryptoSystemBase< PK_Decryptor, DL_PrivateKey< SCHEME_OPTIONS::Element > >, DL_CryptoSystemBase< PK_Decryptor, DL_PrivateKey< T > >, DL_CryptoSystemBase< PK_Encryptor, DL_PublicKey< SCHEME_OPTIONS::Element > >, DL_CryptoSystemBase< PK_Encryptor, DL_PublicKey< T > >, PK_FixedLengthCryptoSystemImpl< PK_Encryptor >, and PK_FixedLengthCryptoSystemImpl< PK_Decryptor >.

Here is the caller graph for this function:

virtual size_t PK_CryptoSystem::FixedCiphertextLength ( ) const
inlinevirtual

Provides the fixed ciphertext length, if one exists.

Returns
the fixed ciphertext length if one exists, otherwise 0

"Fixed" here means length of ciphertext does not depend on length of plaintext. In this case, it usually does depend on the key length.

Reimplemented in TF_CryptoSystemBase< PK_Decryptor, TF_Base< TrapdoorFunctionInverse, PK_EncryptionMessageEncodingMethod > >, TF_CryptoSystemBase< PK_Encryptor, TF_Base< RandomizedTrapdoorFunction, PK_EncryptionMessageEncodingMethod > >, PK_FixedLengthCryptoSystemImpl< PK_Encryptor >, and PK_FixedLengthCryptoSystemImpl< PK_Decryptor >.

Definition at line 2319 of file cryptlib.h.

virtual size_t PK_CryptoSystem::FixedMaxPlaintextLength ( ) const
inlinevirtual

Provides the maximum plaintext length given a fixed ciphertext length.

Returns
maximum plaintext length given the fixed ciphertext length, if one exists, otherwise return 0.

FixedMaxPlaintextLength(0 returns the maximum plaintext length given the fixed ciphertext length, if one exists, otherwise return 0.

Reimplemented in TF_CryptoSystemBase< PK_Decryptor, TF_Base< TrapdoorFunctionInverse, PK_EncryptionMessageEncodingMethod > >, TF_CryptoSystemBase< PK_Encryptor, TF_Base< RandomizedTrapdoorFunction, PK_EncryptionMessageEncodingMethod > >, PK_FixedLengthCryptoSystemImpl< PK_Encryptor >, and PK_FixedLengthCryptoSystemImpl< PK_Decryptor >.

Definition at line 2326 of file cryptlib.h.

virtual size_t PK_CryptoSystem::MaxPlaintextLength ( size_t  ciphertextLength) const
pure virtual

Provides the maximum length of plaintext for a given ciphertext length.

Returns
the maximum size of the plaintext, in bytes

This function returns 0 if ciphertextLength is not valid (too long or too short).

Implemented in DL_CryptoSystemBase< PK_Decryptor, DL_PrivateKey< SCHEME_OPTIONS::Element > >, DL_CryptoSystemBase< PK_Decryptor, DL_PrivateKey< T > >, DL_CryptoSystemBase< PK_Encryptor, DL_PublicKey< SCHEME_OPTIONS::Element > >, DL_CryptoSystemBase< PK_Encryptor, DL_PublicKey< T > >, PK_FixedLengthCryptoSystemImpl< PK_Encryptor >, and PK_FixedLengthCryptoSystemImpl< PK_Decryptor >.

Here is the caller graph for this function:

virtual bool PK_CryptoSystem::ParameterSupported ( const char *  name) const
pure virtual

Determines whether this object supports the use of a named parameter.

Parameters
namethe name of the parameter
Returns
true if the parameter name is supported, false otherwise

Some possible parameter names: EncodingParameters(), KeyDerivationParameters() and others Parameters listed in argnames.h

Implemented in DL_CryptoSystemBase< PK_Decryptor, DL_PrivateKey< SCHEME_OPTIONS::Element > >, DL_CryptoSystemBase< PK_Decryptor, DL_PrivateKey< T > >, DL_CryptoSystemBase< PK_Encryptor, DL_PublicKey< SCHEME_OPTIONS::Element > >, DL_CryptoSystemBase< PK_Encryptor, DL_PublicKey< T > >, TF_CryptoSystemBase< PK_Decryptor, TF_Base< TrapdoorFunctionInverse, PK_EncryptionMessageEncodingMethod > >, and TF_CryptoSystemBase< PK_Encryptor, TF_Base< RandomizedTrapdoorFunction, PK_EncryptionMessageEncodingMethod > >.


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