|
Security Scol plugin
|
Discrete Log (DL) decryptor base implementation. More...
#include <pubkey.h>
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 ¶meters=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 BufferedTransformation * | CreateDecryptionFilter (RandomNumberGenerator &rng, BufferedTransformation *attachment=NULLPTR, const NameValuePairs ¶meters=g_nullNameValuePairs) const |
| Create a new decryption filter. | |
| DecodingResult | FixedLengthDecrypt (RandomNumberGenerator &rng, const byte *ciphertext, byte *plaintext, const NameValuePairs ¶meters=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 | |
| CryptoMaterial & | AccessMaterial () |
| Retrieves a reference to a Private Key. | |
| const CryptoMaterial & | GetMaterial () const |
| Retrieves a reference to a Private Key. | |
| virtual PrivateKey & | AccessPrivateKey ()=0 |
| Retrieves a reference to a Private Key. | |
| virtual const PrivateKey & | GetPrivateKey () 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 Clonable * | Clone () const |
| Copies this object. | |
Additional Inherited Members | |
Protected Types inherited from DL_Base< KI > | |
| typedef KI | KeyInterface |
| typedef KI::Element | Element |
Protected Member Functions inherited from DL_CryptoSystemBase< PK_Decryptor, DL_PrivateKey< T > > | |
| virtual const DL_KeyAgreementAlgorithm< Element > & | GetKeyAgreementAlgorithm () const=0 |
| virtual const DL_KeyDerivationAlgorithm< Element > & | GetKeyDerivationAlgorithm () const=0 |
| virtual const DL_SymmetricEncryptionAlgorithm & | GetSymmetricEncryptionAlgorithm () const=0 |
Protected Member Functions inherited from DL_Base< KI > | |
| const DL_GroupParameters< Element > & | GetAbstractGroupParameters () const |
| DL_GroupParameters< Element > & | AccessAbstractGroupParameters () |
| virtual KeyInterface & | AccessKeyInterface ()=0 |
| virtual const KeyInterface & | GetKeyInterface () const =0 |
Discrete Log (DL) decryptor base implementation.
| T | Field element type or class |
| typedef T DL_DecryptorBase< T >::Element |
|
inlinevirtual |
|
inlinevirtual |
Decrypt a byte string.
| rng | a RandomNumberGenerator derived class |
| ciphertext | the encrypted byte buffer |
| ciphertextLength | the size of the encrypted byte buffer |
| plaintext | a byte buffer to hold the decrypted string |
| parameters | a set of NameValuePairs to initialize this object |
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.
COUNTOF(plaintext) == MaxPlaintextLength(ciphertextLength) ensures the output byte buffer is large enough Implements PK_Decryptor.