tlx
Loading...
Searching...
No Matches

SHA-512 processor without external dependencies. More...

#include <sha512.hpp>

Public Member Functions

 SHA512 ()
 construct empty object.
 
 SHA512 (const void *data, uint32_t size)
 construct context and process data range
 
 SHA512 (const std::string &str)
 construct context and process string
 
void process (const void *data, uint32_t size)
 process more data
 
void process (const std::string &str)
 process more data
 
void finalize (void *digest)
 finalize computation and output 64 byte (512 bit) digest
 
std::string digest ()
 finalize computation and return 64 byte (512 bit) digest
 
std::string digest_hex ()
 finalize computation and return 64 byte (512 bit) digest hex encoded
 
std::string digest_hex_uc ()
 finalize computation and return 64 byte (512 bit) digest upper-case hex
 

Static Public Attributes

static constexpr size_t kDigestLength
 digest length in bytes
 

Private Attributes

uint64_t length_
 
uint64_t state_ [8]
 
uint32_t curlen_
 
uint8_t buf_ [128]
 

Detailed Description

SHA-512 processor without external dependencies.

Definition at line 28 of file sha512.hpp.

Constructor & Destructor Documentation

◆ SHA512() [1/3]

SHA512 ( )

construct empty object.

Definition at line 146 of file sha512.cpp.

◆ SHA512() [2/3]

SHA512 ( const void *  data,
uint32_t  size 
)

construct context and process data range

Definition at line 159 of file sha512.cpp.

◆ SHA512() [3/3]

SHA512 ( const std::string &  str)
explicit

construct context and process string

Definition at line 163 of file sha512.cpp.

Member Function Documentation

◆ digest()

std::string digest ( )

finalize computation and return 64 byte (512 bit) digest

Definition at line 239 of file sha512.cpp.

◆ digest_hex()

std::string digest_hex ( )

finalize computation and return 64 byte (512 bit) digest hex encoded

Definition at line 245 of file sha512.cpp.

◆ digest_hex_uc()

std::string digest_hex_uc ( )

finalize computation and return 64 byte (512 bit) digest upper-case hex

Definition at line 251 of file sha512.cpp.

◆ finalize()

void finalize ( void *  digest)

finalize computation and output 64 byte (512 bit) digest

Definition at line 205 of file sha512.cpp.

◆ process() [1/2]

void process ( const std::string &  str)

process more data

Definition at line 201 of file sha512.cpp.

◆ process() [2/2]

void process ( const void *  data,
uint32_t  size 
)

process more data

Definition at line 167 of file sha512.cpp.

Member Data Documentation

◆ buf_

uint8_t buf_[128]
private

Definition at line 60 of file sha512.hpp.

◆ curlen_

uint32_t curlen_
private

Definition at line 59 of file sha512.hpp.

◆ kDigestLength

constexpr size_t kDigestLength
staticconstexpr

digest length in bytes

Definition at line 44 of file sha512.hpp.

◆ length_

uint64_t length_
private

Definition at line 57 of file sha512.hpp.

◆ state_

uint64_t state_[8]
private

Definition at line 58 of file sha512.hpp.


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