PCL
pcl::CryptographicHash Class Referenceabstract

Abstract base class for cryptographic hashing algorithm implementations. More...

#include <Cryptography.h>

+ Inheritance diagram for pcl::CryptographicHash:

Public Member Functions

 CryptographicHash ()=default
 
 CryptographicHash (const CryptographicHash &)=delete
 
virtual ~CryptographicHash ()
 
virtual String AlgorithmName () const =0
 
ByteArray Finalize ()
 
template<class C >
ByteArray Hash (const C &data)
 
ByteArray Hash (const void *data, size_type length)
 
void Hash (uint8 *hash, const void *data, size_type length)
 
virtual size_type HashLength () const =0
 
virtual void Initialize ()=0
 
CryptographicHashoperator= (const CryptographicHash &)=delete
 
virtual void Update (const void *data, size_type length)=0
 
template<class C >
void UpdateWithContainer (const C &data)
 

Protected Member Functions

virtual void DoFinalize (void *hash)=0
 

Detailed Description

CryptographicHash defines a common interface for implementations of cryptographic hashing algorithms such as MD-5, SHA-1 or SHA-256.

See also
MD5, SHA1, SHA224, SHA256, SHA384, SHA512, CryptographicHashFactory

Definition at line 85 of file Cryptography.h.

Constructor & Destructor Documentation

◆ CryptographicHash() [1/2]

pcl::CryptographicHash::CryptographicHash ( )
default

Default constructor.

◆ ~CryptographicHash()

virtual pcl::CryptographicHash::~CryptographicHash ( )
inlinevirtual

Destroys a CryptographicHash object.

Definition at line 97 of file Cryptography.h.

◆ CryptographicHash() [2/2]

pcl::CryptographicHash::CryptographicHash ( const CryptographicHash )
delete

Copy constructor. This constructor is disabled because CryptographicHash objects are unique.

Member Function Documentation

◆ AlgorithmName()

virtual String pcl::CryptographicHash::AlgorithmName ( ) const
pure virtual

Returns the name of this cryptographic hashing algorithm.

Implemented in pcl::CryptographicHashFactory, pcl::SHA512, pcl::SHA384, pcl::SHA256, pcl::SHA224, pcl::SHA1, and pcl::MD5.

◆ DoFinalize()

virtual void pcl::CryptographicHash::DoFinalize ( void *  hash)
protectedpure virtual

Terminates hash generation and returns the computed message digest (hash value) stored in the specified hash array. The specified array must provide room for at least HashLength() bytes, that is, the length in bytes of the message digest produced by this hashing algorithm.

◆ Finalize()

ByteArray pcl::CryptographicHash::Finalize ( )
inline

Terminates hash generation and returns the computed message digest as a ByteArray instance.

Definition at line 154 of file Cryptography.h.

References pcl::Array< T, A >::Begin().

◆ Hash() [1/3]

template<class C >
ByteArray pcl::CryptographicHash::Hash ( const C &  data)
inline

Returns the hash sequence (message digest) corresponding to a container data with contiguous storage as a ByteArray instance.

The C template argument must be a class with PCL container semantics (the Begin() and Size() member functions are required). Typically the ByteArray class is used, although any array-like class with contiguous storage is appropriate, including Array, String, Vector and Matrix.

Definition at line 196 of file Cryptography.h.

◆ Hash() [2/3]

ByteArray pcl::CryptographicHash::Hash ( const void *  data,
size_type  length 
)
inline

Returns the hash sequence (message digest) corresponding to a data block of the specified length in bytes, as a ByteArray instance.

Definition at line 179 of file Cryptography.h.

References pcl::Array< T, A >::Begin().

◆ Hash() [3/3]

void pcl::CryptographicHash::Hash ( uint8 hash,
const void *  data,
size_type  length 
)
inline

Returns the hash sequence (message digest) corresponding to a data block of the specified length in bytes, stored in the specified hash array. The specified array must provide room for at least HashLength() bytes, that is, the length in bytes of the message digest produced by this hashing algorithm.

Definition at line 168 of file Cryptography.h.

Referenced by pcl::AES256::AES256().

◆ HashLength()

virtual size_type pcl::CryptographicHash::HashLength ( ) const
pure virtual

Returns the length in bytes of a hash sequence (or message digest) calculated with this cryptographic hashing algorithm.

Implemented in pcl::CryptographicHashFactory, pcl::SHA512, pcl::SHA384, pcl::SHA256, pcl::SHA224, pcl::SHA1, and pcl::MD5.

◆ Initialize()

virtual void pcl::CryptographicHash::Initialize ( )
pure virtual

Initializes this cryptographic hash generator.

Implemented in pcl::CryptographicHashFactory, pcl::SHA512, pcl::SHA384, pcl::SHA256, pcl::SHA224, pcl::SHA1, and pcl::MD5.

◆ operator=()

CryptographicHash& pcl::CryptographicHash::operator= ( const CryptographicHash )
delete

Copy assignment. This operator is disabled because CryptographicHash objects are unique.

◆ Update()

virtual void pcl::CryptographicHash::Update ( const void *  data,
size_type  length 
)
pure virtual

Updates the hash generator with a new data chunk of the specified length in bytes.

Implemented in pcl::CryptographicHashFactory, pcl::SHA512, pcl::SHA384, pcl::SHA256, pcl::SHA224, pcl::SHA1, and pcl::MD5.

◆ UpdateWithContainer()

template<class C >
void pcl::CryptographicHash::UpdateWithContainer ( const C &  data)
inline

Updates the hash generator with data from a container with contiguous storage.

The C template argument must be a class with PCL container semantics (the Begin() and Size() member functions are required). Typically the ByteArray class is used, although any array-like class with contiguous storage is appropriate, including String, IsoString, Vector and Matrix.

Definition at line 145 of file Cryptography.h.


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