Algorithm Class Reference

Interface for all crypto algorithms. More...

`#include <cryptlib.h>`

Inheritance diagram for Algorithm:

## Public Member Functions

| 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.

## Detailed Description

Interface for all crypto algorithms.

Definition at line 603 of file cryptlib.h.

## Constructor & Destructor Documentation

## ~Algorithm()

virtual Algorithm::~Algorithm | ( |  | ) |

inline virtual

Definition at line 606 of file cryptlib.h.

## Algorithm()

Algorithm::Algorithm | ( | bool | checkSelfTestStatus = true | ) |

Interface for all crypto algorithms.

Parameters

  checkSelfTestStatus | determines whether the object can proceed if the self tests have not been run or failed.

When FIPS 140-2 compliance is enabled and checkSelfTestStatus == true, this constructor throws SelfTestFailure if the self test hasn't been run or fails.

FIPS 140-2 compliance is disabled by default. It is only used by certain versions of the library when the library is built as a DLL on Windows. Also see CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 in config.h.

## Member Function Documentation

## AlgorithmName()

virtual std::string Algorithm::AlgorithmName | ( |  | ) | const

inline virtual

Provides the name of this algorithm.

Returns
  the standard algorithm name

The standard algorithm name can be a name like AES or AES/GCM. Some algorithms do not have standard names yet. For example, there is no standard algorithm name for Shoup's ECIES.

Note
  AlgorithmName is not universally implemented yet.

Reimplemented in Adler32, AlgorithmImpl< DL_DecryptorBase< SCHEME_OPTIONS::Element >, SCHEME_OPTIONS::AlgorithmInfo >, AlgorithmImpl< DL_EncryptorBase< SCHEME_OPTIONS::Element >, SCHEME_OPTIONS::AlgorithmInfo >, AlgorithmImpl< DL_SignerBase< SCHEME_OPTIONS::Element >, SCHEME_OPTIONS::AlgorithmInfo >, AlgorithmImpl< DL_VerifierBase< SCHEME_OPTIONS::Element >, SCHEME_OPTIONS::AlgorithmInfo >, AlgorithmImpl< IteratedHash< T_HashWordType, T_Endianness, T_BlockSize >, T_Transform >, AlgorithmImpl< IteratedHash< word32, BigEndian, T_BlockSize >, SHA1 >, AlgorithmImpl< IteratedHash< word32, BigEndian, T_BlockSize >, SHA224 >, AlgorithmImpl< IteratedHash< word32, BigEndian, T_BlockSize >, SHA256 >, AlgorithmImpl< IteratedHash< word32, BigEndian, T_BlockSize >, SM3 >, AlgorithmImpl< IteratedHash< word32, LittleEndian, T_BlockSize >, MD4 >, AlgorithmImpl< IteratedHash< word32, LittleEndian, T_BlockSize >, MD5 >, AlgorithmImpl< IteratedHash< word32, LittleEndian, T_BlockSize >, RIPEMD128 >, AlgorithmImpl< IteratedHash< word32, LittleEndian, T_BlockSize >, RIPEMD160 >, AlgorithmImpl< IteratedHash< word32, LittleEndian, T_BlockSize >, RIPEMD256 >, AlgorithmImpl< IteratedHash< word32, LittleEndian, T_BlockSize >, RIPEMD320 >, AlgorithmImpl< IteratedHash< word32, NativeByteOrder, 32 >, PanamaHash< LittleEndian > >, AlgorithmImpl< IteratedHash< word64, BigEndian, T_BlockSize >, SHA384 >, AlgorithmImpl< IteratedHash< word64, BigEndian, T_BlockSize >, SHA512 >, AlgorithmImpl< IteratedHash< word64, BigEndian, T_BlockSize >, Whirlpool >, AlgorithmImpl< IteratedHash< word64, LittleEndian, T_BlockSize >, Tiger >, AlgorithmImpl< SimpleKeyingInterfaceImpl< BlockCipher, BTEA_Info >, BTEA_Info >, AlgorithmImpl< SimpleKeyingInterfaceImpl< CBC_MAC_Base, CBC_MAC< T > >, CBC_MAC< T > >, AlgorithmImpl< SimpleKeyingInterfaceImpl< CMAC_Base, CMAC< T > >, CMAC< T > >, AlgorithmImpl< SimpleKeyingInterfaceImpl< CMAC_Base, CMAC< T_BlockCipher > >, CMAC< T_BlockCipher > >, AlgorithmImpl< SimpleKeyingInterfaceImpl< DMAC_Base< T >, DMAC_Base< T > >, DMAC_Base< T > >, AlgorithmImpl< SimpleKeyingInterfaceImpl< HMAC_Base, HMAC< H > >, HMAC< H > >, AlgorithmImpl< SimpleKeyingInterfaceImpl< HMAC_Base, HMAC< SHA256 > >, HMAC< SHA256 > >, AlgorithmImpl< SimpleKeyingInterfaceImpl< HMAC_Base, HMAC< T > >, HMAC< T > >, AlgorithmImpl< SimpleKeyingInterfaceImpl< Poly1305_Base< T >, Poly1305_Base< T > >, Poly1305_Base< T > >, AlgorithmImpl< SimpleKeyingInterfaceImpl< Poly1305TLS_Base, Poly1305TLS_Base >, Poly1305TLS_Base >, AlgorithmImpl< SimpleKeyingInterfaceImpl< TTMAC_Base, TTMAC_Base >, TTMAC_Base >, AlgorithmImpl< TF_DecryptorBase, SCHEME_OPTIONS::AlgorithmInfo >, AlgorithmImpl< TF_EncryptorBase, SCHEME_OPTIONS::AlgorithmInfo >, AlgorithmImpl< TF_SignerBase, SCHEME_OPTIONS::AlgorithmInfo >, AlgorithmImpl< TF_VerifierBase, SCHEME_OPTIONS::AlgorithmInfo >, AuthenticatedDecryptionFilter, AuthenticatedSymmetricCipher, BitBucket, BLAKE2b, BLAKE2s, CCM_Base, ChaCha20Poly1305_Base, CipherModeFinalTemplate_ExternalCipher< CBC_CTS_Decryption >, CipherModeFinalTemplate_ExternalCipher< CBC_CTS_Encryption >, CipherModeFinalTemplate_ExternalCipher< CBC_Decryption >, CipherModeFinalTemplate_ExternalCipher< CBC_Encryption >, CipherModeFinalTemplate_ExternalCipher< ECB_OneWay >, CRC32, CRC32C, DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >, DH_Domain< DL_GroupParameters_EC< EC >, COFACTOR_OPTION >, DH_Domain< DL_GroupParameters_GFP_DefaultSafePrime >, DH_Domain< DL_GroupParameters_LUC_DefaultSafePrime >, DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >, EAX_Base, GCM_Base, HashFilter, HashVerificationFilter, HKDF< T >, HMAC< T >, HMAC< H >, HMAC< SHA256 >, Keccak_Final< T_DigestSize >, Keccak_Final< 28 >, Keccak_Final< 32 >, Keccak_Final< 48 >, Keccak_Final< 64 >, KeyDerivationFunction, LSH224, LSH256, LSH384, LSH512, LSH512_256, PKCS12_PBKDF< T >, PKCS5_PBKDF1< T >, PKCS5_PBKDF2_HMAC< T >, Scrypt, SHA3_Final< T_DigestSize >, SHA3_Final< 28 >, SHA3_Final< 32 >, SHA3_Final< 48 >, SHA3_Final< 64 >, SHAKE_Final< T_Strength >, SHAKE_Final< 128 >, SHAKE_Final< 256 >, SignatureVerificationFilter, SignerFilter, StreamTransformationFilter, VMAC_Base, Weak::MD2, XChaCha20Poly1305_Base, and XTS_ModeBase.

Definition at line 624 of file cryptlib.h.

## AlgorithmProvider()

virtual std::string Algorithm::AlgorithmProvider | ( |  | ) | const

inline virtual

Retrieve the provider of this algorithm.

Returns
  the algorithm provider

The algorithm provider can be a name like "C++", "SSE", "NEON", "AESNI", "ARMv8" and "Power8". C++ is standard C++ code. Other labels, like SSE, usually indicate a specialized implementation using instructions from a higher instruction set architecture (ISA). Future labels may include external hardware like a hardware security module (HSM).

Generally speaking Wei Dai's original IA-32 ASM code falls under "SSE2". Labels like "SSSE3" and "SSE4.1" follow after Wei's code and use intrinsics instead of ASM.

Algorithms which combine different instructions or ISAs provide the dominant one. For example on x86 AES/GCM returns "AESNI" rather than "CLMUL" or "AES+SSE4.1" or "AES+CLMUL" or "AES+SSE4.1+CLMUL".

Note
  Provider is not universally implemented yet.

Since
  Crypto++ 8.0

Reimplemented in AdditiveCipherTemplate< BASE >, AuthenticatedSymmetricCipher, AutoSeededX917RNG< BLOCK_CIPHER >, BLAKE2b, BLAKE2s, CCM_Base, CFB_CipherTemplate< AbstractPolicyHolder< CFB_CipherAbstractPolicy, SymmetricCipher > >, ChaCha20Poly1305_Base, CipherModeBase, CMAC_Base, CRC32, CRC32C, DARN, DMAC_Base< T >, EAX_Base, EAX_Final< T_BlockCipher, T_IsEncryption >, EAX_Final< T_BlockCipher, false >, EAX_Final< T_BlockCipher, true >, GCM_Base, Hash_DRBG< HASH, STRENGTH, SEEDLENGTH >, HMAC< T >, HMAC< H >, HMAC< SHA256 >, HMAC_DRBG< HASH, STRENGTH, SEEDLENGTH >, IteratedHashBase< T_HashWordType, HashTransformation >, IteratedHashBase< word32, HashTransformation >, IteratedHashBase< word32, MessageAuthenticationCode >, IteratedHashBase< word64, HashTransformation >, IteratedHashBase< word64, MessageAuthenticationCode >, LSH256_Base, LSH512_Base, PadlockRNG, Poly1305_Base< T >, RDRAND, RDSEED, SHA1, SHA224, SHA256, SHA384, SHA512, Tiger, VMAC_Base, Weak::PanamaHash< B >, Weak::PanamaHash< LittleEndian >, Whirlpool, XChaCha20Poly1305_Base, and XTS_ModeBase.

Definition at line 641 of file cryptlib.h.

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

- cryptlib.h