Thrill
0.1
|
#include <sha1.hpp>
Public Member Functions | |
SHA1 () | |
construct empty object. More... | |
SHA1 (const void *data, uint32_t size) | |
construct context and process data range More... | |
SHA1 (const std::string &str) | |
construct context and process string More... | |
std::string | digest () |
finalize computation and return 20 byte (160 bit) digest More... | |
std::string | digest_hex () |
finalize computation and return 20 byte (160 bit) digest hex encoded More... | |
std::string | digest_hex_uc () |
finalize computation and return 20 byte (160 bit) digest upper-case hex More... | |
void | finalize (void *digest) |
finalize computation and output 20 byte (160 bit) digest More... | |
void | process (const void *data, uint32_t size) |
process more data More... | |
void | process (const std::string &str) |
process more data More... | |
Static Public Attributes | |
static constexpr size_t | kDigestLength = 20 |
digest length in bytes More... | |
Private Attributes | |
uint8_t | buf_ [64] |
uint32_t | curlen_ |
uint64_t | length_ |
uint32_t | state_ [5] |
SHA1 | ( | ) |
construct empty object.
Definition at line 118 of file sha1.cpp.
Referenced by tlx::sha1_hex(), and tlx::sha1_hex_uc().
SHA1 | ( | const void * | data, |
uint32_t | size | ||
) |
construct context and process data range
Definition at line 128 of file sha1.cpp.
References SHA1::process().
|
explicit |
construct context and process string
Definition at line 132 of file sha1.cpp.
References SHA1::process().
std::string digest | ( | ) |
finalize computation and return 20 byte (160 bit) digest
Definition at line 204 of file sha1.cpp.
References SHA1::finalize(), and SHA1::kDigestLength.
Referenced by SHA1::digest_hex(), and SHA1::digest_hex_uc().
std::string digest_hex | ( | ) |
finalize computation and return 20 byte (160 bit) digest hex encoded
Definition at line 210 of file sha1.cpp.
References SHA1::digest(), SHA1::finalize(), tlx::hexdump_lc(), and SHA1::kDigestLength.
std::string digest_hex_uc | ( | ) |
finalize computation and return 20 byte (160 bit) digest upper-case hex
Definition at line 216 of file sha1.cpp.
References SHA1::digest(), SHA1::finalize(), tlx::hexdump(), and SHA1::kDigestLength.
void finalize | ( | void * | digest | ) |
finalize computation and output 20 byte (160 bit) digest
Definition at line 174 of file sha1.cpp.
References SHA1::buf_, SHA1::curlen_, SHA1::length_, tlx::digest_detail::sha1_compress(), SHA1::state_, tlx::digest_detail::store32h(), and tlx::digest_detail::store64h().
Referenced by SHA1::digest(), SHA1::digest_hex(), and SHA1::digest_hex_uc().
void process | ( | const void * | data, |
uint32_t | size | ||
) |
process more data
Definition at line 136 of file sha1.cpp.
References SHA1::buf_, SHA1::curlen_, SHA1::length_, tlx::digest_detail::min(), tlx::digest_detail::sha1_compress(), and SHA1::state_.
Referenced by SHA1::process(), and SHA1::SHA1().
void process | ( | const std::string & | str | ) |
|
private |
Definition at line 60 of file sha1.hpp.
Referenced by SHA1::finalize(), and SHA1::process().
|
private |
Definition at line 59 of file sha1.hpp.
Referenced by SHA1::finalize(), and SHA1::process().
|
static |
digest length in bytes
Definition at line 44 of file sha1.hpp.
Referenced by SHA1::digest(), SHA1::digest_hex(), and SHA1::digest_hex_uc().
|
private |
Definition at line 57 of file sha1.hpp.
Referenced by SHA1::finalize(), and SHA1::process().
|
private |
Definition at line 58 of file sha1.hpp.
Referenced by SHA1::finalize(), and SHA1::process().