libxcks  0.1.0.1
libxcks::LibgcryptHash Class Referenceabstract

Computes a hash from a byte stream. More...

#include <libgcrypthash.hpp>

Inheritance diagram for libxcks::LibgcryptHash:
Collaboration diagram for libxcks::LibgcryptHash:

Public Member Functions

void reset () override=0
 Resets the checksum to initial value. More...
 
- Public Member Functions inherited from libxcks::ChecksumEx
std::string toString (const bool hexInUpperCase=false) const override
 Returns the hash value has a string. More...
 
- Public Member Functions inherited from libxcks::Checksum
virtual ~Checksum ()
 Destructor. More...
 
virtual uint8_t * getValue (uint8_t *buffer) const =0
 Returns the checksum value in the first bytes of the given address. More...
 
virtual size_t getSize () const =0
 Returns the minimal size to allocate in memory to store the checksum with the getValue(buffer) method. More...
 
virtual void update (const uint8_t *buf, size_t len)=0
 Updates the checksum with specified array of bytes. More...
 
virtual std::string getName () const =0
 Returns the name of the checksum or the hash algorithm. More...
 
virtual ArrayString getAltNames () const
 Returns the alternative name(s) of the checksum or the hash algorithm. More...
 
virtual ChecksumAlgoId getID () const =0
 Returns an unique identifier for the checksum or the hash algorithm. More...
 

Static Protected Member Functions

static uint32_t rol (uint32_t x, int n)
 Rotate the 32 bit unsigned integer x by n bits left. More...
 
static uint32_t ror (uint32_t x, int n)
 Rotate the 32 bit unsigned integer x by n bits right. More...
 
- Static Protected Member Functions inherited from libxcks::ChecksumEx
static uint32_t swapOnLE (const uint32_t value)
 Swaps bytes on little endian architectures. More...
 
static uint32_t swapOnBE (const uint32_t value)
 Swaps bytes on big endian architectures. More...
 
static uint64_t swapOnLE (const uint64_t value)
 Swaps bytes on little endian architectures. More...
 
static uint64_t swapOnBE (const uint64_t value)
 Swaps bytes on big endian architectures. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from libxcks::Checksum
static ArrayString getAlternativeNames ()
 Returns the alternative name(s) of the checksum or the hash algorithm. More...
 

Detailed Description

Computes a hash from a byte stream.

Adds some utilities to the ChecksumEx class for hashes which come from the Libgcrypt.

Definition at line 40 of file libgcrypthash.hpp.

Member Function Documentation

◆ reset()

void libxcks::LibgcryptHash::reset ( )
overridepure virtual

◆ rol()

static uint32_t libxcks::LibgcryptHash::rol ( uint32_t  x,
int  n 
)
inlinestaticprotected

Rotate the 32 bit unsigned integer x by n bits left.

Parameters
xThe 32 bit unsigned integer to rotate to the left.
nThe number of byte to rotate.

Definition at line 50 of file libgcrypthash.hpp.

◆ ror()

static uint32_t libxcks::LibgcryptHash::ror ( uint32_t  x,
int  n 
)
inlinestaticprotected

Rotate the 32 bit unsigned integer x by n bits right.

Parameters
xThe 32 bit unsigned integer to rotate to the right.
nThe number of byte to rotate.

Definition at line 62 of file libgcrypthash.hpp.


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