Crypto++ 8.9
Free C++ class library of cryptographic schemes
Public Types | Public Member Functions | List of all members
DL_DecryptorBase< T > Class Template Reference

Discrete Log (DL) decryptor base implementation. More...

#include <pubkey.h>

+ Inheritance diagram for DL_DecryptorBase< T >:

Public Types

typedef T Element
 
- Public Types inherited from DL_CryptoSystemBase< PK_Decryptor, DL_PrivateKey< T > >
typedef DL_Base< DL_PrivateKey< T > >::Element Element
 

Public Member Functions

DecodingResult Decrypt (RandomNumberGenerator &rng, const byte *ciphertext, size_t ciphertextLength, byte *plaintext, const NameValuePairs &parameters=g_nullNameValuePairs) const
 Decrypt a byte string.
 
- Public Member Functions inherited from DL_CryptoSystemBase< PK_Decryptor, DL_PrivateKey< T > >
size_t MaxPlaintextLength (size_t ciphertextLength) const
 
size_t CiphertextLength (size_t plaintextLength) const
 
bool ParameterSupported (const char *name) const
 
- Public Member Functions inherited from PK_Decryptor
virtual BufferedTransformationCreateDecryptionFilter (RandomNumberGenerator &rng, BufferedTransformation *attachment=NULL, const NameValuePairs &parameters=g_nullNameValuePairs) const
 Create a new decryption filter.
 
DecodingResult FixedLengthDecrypt (RandomNumberGenerator &rng, const byte *ciphertext, byte *plaintext, const NameValuePairs &parameters=g_nullNameValuePairs) const
 Decrypt a fixed size ciphertext.
 
- Public Member Functions inherited from PK_CryptoSystem
virtual size_t FixedCiphertextLength () const
 Provides the fixed ciphertext length, if one exists.
 
virtual size_t FixedMaxPlaintextLength () const
 Provides the maximum plaintext length given a fixed ciphertext length.
 
- Public Member Functions inherited from PrivateKeyAlgorithm
CryptoMaterialAccessMaterial ()
 Retrieves a reference to a Private Key.
 
const CryptoMaterialGetMaterial () const
 Retrieves a reference to a Private Key.
 
virtual PrivateKeyAccessPrivateKey ()=0
 Retrieves a reference to a Private Key.
 
virtual const PrivateKeyGetPrivateKey () const
 Retrieves a reference to a Private Key.
 
- Public Member Functions inherited from Algorithm
 Algorithm (bool checkSelfTestStatus=true)
 Interface for all crypto algorithms.
 
virtual std::string AlgorithmName () const
 Provides the name of this algorithm.
 
virtual std::string AlgorithmProvider () const
 Retrieve the provider of this algorithm.
 
- Public Member Functions inherited from Clonable
virtual ClonableClone () const
 Copies this object.
 

Detailed Description

template<class T>
class DL_DecryptorBase< T >

Discrete Log (DL) decryptor base implementation.

Template Parameters
TField element type or class

Field element T can be Integer, ECP or EC2N.

Definition at line 1830 of file pubkey.h.

Member Typedef Documentation

◆ Element

template<class T >
typedef T DL_DecryptorBase< T >::Element

Definition at line 1833 of file pubkey.h.

Constructor & Destructor Documentation

◆ ~DL_DecryptorBase()

template<class T >
virtual DL_DecryptorBase< T >::~DL_DecryptorBase ( )
inlinevirtual

Definition at line 1835 of file pubkey.h.

Member Function Documentation

◆ Decrypt()

template<class T >
DecodingResult DL_DecryptorBase< T >::Decrypt ( RandomNumberGenerator & rng,
const byte * ciphertext,
size_t ciphertextLength,
byte * plaintext,
const NameValuePairs & parameters = g_nullNameValuePairs ) const
inlinevirtual

Decrypt a byte string.

Parameters
rnga RandomNumberGenerator derived class
ciphertextthe encrypted byte buffer
ciphertextLengththe size of the encrypted byte buffer
plaintexta byte buffer to hold the decrypted string
parametersa set of NameValuePairs to initialize this object
Returns
the result of the decryption operation

If DecodingResult::isValidCoding is true, then DecodingResult::messageLength is valid and holds the actual length of the plaintext recovered. The result is undefined if decryption failed. If DecodingResult::isValidCoding is false, then DecodingResult::messageLength is undefined.

Precondition
COUNTOF(plaintext) == MaxPlaintextLength(ciphertextLength) ensures the output byte buffer is large enough
See also
PK_Encryptor

Implements PK_Decryptor.

Definition at line 1837 of file pubkey.h.


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