ROSE 0.11.145.147
Public Member Functions | List of all members
Rose::Combinatorics::HasherGcrypt< hashAlgorithmId > Class Template Reference

Description

template<int hashAlgorithmId>
class Rose::Combinatorics::HasherGcrypt< hashAlgorithmId >

Hasher for any libgcrypt hash algorithm.

The hashAlgorithmId template parameter is one of the libgcrypt algorithm constants (type int) with a name starting with "GCRY_MD_". You can find a list here.

Definition at line 362 of file Combinatorics.h.

#include <roseSupport/Combinatorics.h>

Inheritance diagram for Rose::Combinatorics::HasherGcrypt< hashAlgorithmId >:
Inheritance graph
[legend]
Collaboration diagram for Rose::Combinatorics::HasherGcrypt< hashAlgorithmId >:
Collaboration graph
[legend]

Public Member Functions

 HasherGcrypt (const HasherGcrypt &other)
 
HasherGcryptoperator= (const HasherGcrypt &other)
 
void clear ()
 Reset the hasher to its initial state.
 
const Digestdigest ()
 Return the digest.
 
void append (const uint8_t *message, size_t messageSize)
 Insert data into the digest.
 
- Public Member Functions inherited from Rose::Combinatorics::Hasher
std::string toString ()
 String representation of the digest.
 
void print (std::ostream &)
 Print a hash to a stream.
 
void insert (const std::string &x)
 Insert data into the digest.
 
void insert (uint64_t x)
 Insert data into the digest.
 
void insert (const uint8_t *x, size_t size)
 Insert data into the digest.
 
void insert (const std::vector< uint8_t > &v)
 Insert data into the digest.
 
void insert (std::istream &stream)
 Insert data into the digest.
 
uint64_t make64Bits ()
 Returns the hash as a 64 bit int.
 
uint64_t make64Bits (const Digest &)
 Returns the hash as a 64 bit int.
 

Additional Inherited Members

- Public Types inherited from Rose::Combinatorics::Hasher
typedef std::vector< uint8_t > Digest
 The digest of the input message.
 
- Static Public Member Functions inherited from Rose::Combinatorics::Hasher
static std::string toString (const Digest &)
 Convert a digest to a hexadecimal string.
 
- Protected Attributes inherited from Rose::Combinatorics::Hasher
Digest digest_
 

Constructor & Destructor Documentation

◆ HasherGcrypt() [1/2]

template<int hashAlgorithmId>
Rose::Combinatorics::HasherGcrypt< hashAlgorithmId >::HasherGcrypt ( )
inline

Definition at line 368 of file Combinatorics.h.

◆ HasherGcrypt() [2/2]

template<int hashAlgorithmId>
Rose::Combinatorics::HasherGcrypt< hashAlgorithmId >::HasherGcrypt ( const HasherGcrypt< hashAlgorithmId > &  other)
inline

Definition at line 377 of file Combinatorics.h.

◆ ~HasherGcrypt()

template<int hashAlgorithmId>
Rose::Combinatorics::HasherGcrypt< hashAlgorithmId >::~HasherGcrypt ( )
inline

Definition at line 387 of file Combinatorics.h.

Member Function Documentation

◆ operator=()

template<int hashAlgorithmId>
HasherGcrypt & Rose::Combinatorics::HasherGcrypt< hashAlgorithmId >::operator= ( const HasherGcrypt< hashAlgorithmId > &  other)
inline

Definition at line 393 of file Combinatorics.h.

◆ clear()

template<int hashAlgorithmId>
void Rose::Combinatorics::HasherGcrypt< hashAlgorithmId >::clear ( )
inlinevirtual

Reset the hasher to its initial state.

Reimplemented from Rose::Combinatorics::Hasher.

Definition at line 404 of file Combinatorics.h.

References Rose::Combinatorics::Hasher::clear().

◆ digest()

template<int hashAlgorithmId>
const Digest & Rose::Combinatorics::HasherGcrypt< hashAlgorithmId >::digest ( )
inlinevirtual

Return the digest.

Finalizes the hash function and returns the digest for all the input. Additional input should not be inserted after this function is called since some hash functions don't support this.

Reimplemented from Rose::Combinatorics::Hasher.

Definition at line 411 of file Combinatorics.h.

References Rose::Combinatorics::Hasher::digest().

◆ append()

template<int hashAlgorithmId>
void Rose::Combinatorics::HasherGcrypt< hashAlgorithmId >::append ( const uint8_t *  message,
size_t  messageSize 
)
inlinevirtual

Insert data into the digest.

This is the lowest level method of inserting new message content into the digest. This can be called as often as desired, building a digest incrementally.

Implements Rose::Combinatorics::Hasher.

Definition at line 426 of file Combinatorics.h.


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