E-MailRelay
Public Member Functions | List of all members
GSsl::Digester Class Reference

Returns an object that can perform a cryptographic hash. More...

#include <gssl.h>

Public Member Functions

 Digester (DigesterImpBase *)
 Constructor, used by the Library class.
 
size_t blocksize () const
 Returns the hash function's block size in bytes.
 
size_t valuesize () const
 Returns the hash function's value size in bytes.
 
size_t statesize () const
 Returns the size of the state() string in bytes, or zero if state() is not implemented. More...
 
void add (const std::string &)
 Adds data of arbitrary size.
 
std::string state ()
 Returns the intermediate state. More...
 
std::string value ()
 Returns the hash value.
 

Detailed Description

Returns an object that can perform a cryptographic hash.

Use add() one or more times, then call either state() or value() and discard. The state() string can be passed to the Library factory method to restart the digest from the intermediate state.

Definition at line 194 of file gssl.h.

Member Function Documentation

std::string GSsl::Digester::state ( )

Returns the intermediate state.

The state string can be persisted and reused across different implementations, so it is standardised as some number of 32-bit little-endian values making up valuesize() bytes, followed by one 32-bit little-endian value holding the total add()ed size.

Definition at line 233 of file gssl.cpp.

size_t GSsl::Digester::statesize ( ) const

Returns the size of the state() string in bytes, or zero if state() is not implemented.

Definition at line 248 of file gssl.cpp.


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