Ark Server API (ASE) - Wiki
|
#include <DigestEngine.h>
Public Types | |
using | Digest = std::vector<unsigned char> |
Public Member Functions | |
DigestEngine () | |
virtual | ~DigestEngine () |
void | update (const void *data, std::size_t length) |
void | update (char data) |
void | update (const std::string &data) |
virtual std::size_t | digestLength () const =0 |
Updates the digest with the given data. | |
virtual void | reset ()=0 |
Returns the length of the digest in bytes. | |
virtual const Digest & | digest ()=0 |
Static Public Member Functions | |
static std::string | digestToHex (const Digest &bytes) |
static Digest | digestFromHex (const std::string &digest) |
Converts a message digest into a string of hexadecimal numbers. | |
static bool | constantTimeEquals (const Digest &d1, const Digest &d2) |
Converts a string created by digestToHex back to its Digest presentation. | |
Protected Member Functions | |
virtual void | updateImpl (const void *data, std::size_t length)=0 |
Private Member Functions | |
DigestEngine (const DigestEngine &) | |
DigestEngine & | operator= (const DigestEngine &) |
This class is an abstract base class for all classes implementing a message digest algorithm, like MD5Engine and SHA1Engine. Call update() repeatedly with data to compute the digest from. When done, call digest() to obtain the message digest.
Definition at line 28 of file DigestEngine.h.
using Poco::DigestEngine::Digest = std::vector<unsigned char> |
Definition at line 39 of file DigestEngine.h.
Poco::DigestEngine::DigestEngine | ( | ) |
|
virtual |
|
private |
Updates the digest with the given data. Must be implemented by subclasses.
Converts a string created by digestToHex back to its Digest presentation.
|
pure virtual |
Resets the engine so that a new digest can be computed.
|
static |
Converts a message digest into a string of hexadecimal numbers.
|
pure virtual |
Updates the digest with the given data.
|
static |
Finishes the computation of the digest and returns the message digest. Resets the engine and can thus only be called once for every digest. The returned reference is valid until the next time digest() is called, or the engine object is destroyed.
|
private |
|
pure virtual |
Returns the length of the digest in bytes.
|
inline |
|
inline |
|
inline |
|
protectedpure virtual |
Compares two Digest values using a constant-time comparison algorithm. This can be used to prevent timing attacks (as discussed in https://codahale.com/a-lesson-in-timing-attacks/).