E-MailRelay

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

A class for objects that can perform a cryptographic hash. More...

`#include <gssl.h>`

## Public Member Functions
| Digester (std::unique_ptr< DigesterImpBase >)
| Constructor, used by the Library class. More...
std::size_t | blocksize () const
| Returns the hash function's block size in bytes. More...
std::size_t | valuesize () const
| Returns the hash function's value size in bytes. More...
std::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. More...
std::string | state ()
| Returns the intermediate state. More...
std::string | value ()
| Returns the hash value. More...

## Detailed Description

A class for objects that can perform a cryptographic hash.

Instances are created by the Library::digester() factory method and can then be copied around.

Use add() one or more times, then call either state() or value() and discard. The state() string can be passed in to the Library factory method to get the digest to start from the intermediate state. However, the statesize() method returns zero if intermediate state is not supported by the underlying library.

Definition at line 212 of file gssl.h.

## Constructor & Destructor Documentation

## ◆ Digester()

GSsl::Digester::Digester | ( | std::unique_ptr< DigesterImpBase > | p | ) |
| explicit

Constructor, used by the Library class.

Definition at line 220 of file gssl.cpp.

## Member Function Documentation

## ◆ add()

void GSsl::Digester::add | ( | const std::string & | s | ) |

Adds data of arbitrary size.

Definition at line 225 of file gssl.cpp.

## ◆ blocksize()

std::size_t GSsl::Digester::blocksize | ( |  | ) | const

Returns the hash function's block size in bytes.

Definition at line 240 of file gssl.cpp.

## ◆ state()

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 235 of file gssl.cpp.

## ◆ statesize()

std::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 250 of file gssl.cpp.

## ◆ value()

std::string GSsl::Digester::value | ( |  | ) |

Returns the hash value.

Definition at line 230 of file gssl.cpp.

## ◆ valuesize()

std::size_t GSsl::Digester::valuesize | ( |  | ) | const

Returns the hash function's value size in bytes.

Definition at line 245 of file gssl.cpp.

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

- /usr/src/slapt-src-x86_64/network/emailrelay/emailrelay-2.3/src/gssl/gssl.h
- /usr/src/slapt-src-x86_64/network/emailrelay/emailrelay-2.3/src/gssl/gssl.cpp