#include <sha1.h>
|
static std::string | from_file (const std::string &filename) |
|
Definition at line 28 of file sha1.h.
void SHA1::buffer_to_block |
( |
const std::string & |
buffer, |
|
|
uint32_t |
block[BLOCK_INTS] |
|
) |
| |
|
staticprivate |
Definition at line 246 of file sha1.cpp.
251 block[i] = (
buffer[4*i+3] & 0xff)
252 | (
buffer[4*i+2] & 0xff)<<8
253 | (
buffer[4*i+1] & 0xff)<<16
254 | (
buffer[4*i+0] & 0xff)<<24;
static const unsigned int BLOCK_INTS
std::string SHA1::final |
( |
| ) |
|
Definition at line 69 of file sha1.cpp.
76 unsigned int orig_size =
buffer.size();
88 for (
unsigned int i = 0; i <
BLOCK_INTS - 2; i++)
100 std::ostringstream result;
103 result << std::hex << std::setfill(
'0') << std::setw(8);
104 result << (
digest[i] & 0xffffffff);
void transform(uint32_t block[BLOCK_BYTES])
uint32_t digest[DIGEST_INTS]
static const unsigned int BLOCK_INTS
static const unsigned int DIGEST_INTS
static const unsigned int BLOCK_BYTES
static void buffer_to_block(const std::string &buffer, uint32_t block[BLOCK_INTS])
std::string SHA1::from_file |
( |
const std::string & |
filename | ) |
|
|
static |
Definition at line 114 of file sha1.cpp.
116 std::ifstream stream(filename.c_str(), std::ios::binary);
119 return checksum.final();
void update(const std::string &s)
void SHA1::read |
( |
std::istream & |
is, |
|
|
std::string & |
s, |
|
|
size_t |
max |
|
) |
| |
|
staticprivate |
Definition at line 259 of file sha1.cpp.
261 char* sbuf =
new char[max];
264 s.assign(sbuf, is.gcount());
Definition at line 123 of file sha1.cpp.
uint32_t digest[DIGEST_INTS]
void SHA1::transform |
( |
uint32_t |
block[BLOCK_BYTES] | ) |
|
|
private |
Definition at line 142 of file sha1.cpp.
#define SHA1_R4(v, w, x, y, z, i)
uint32_t digest[DIGEST_INTS]
#define SHA1_R1(v, w, x, y, z, i)
#define SHA1_R0(v, w, x, y, z, i)
#define SHA1_R2(v, w, x, y, z, i)
#define SHA1_R3(v, w, x, y, z, i)
void SHA1::update |
( |
const std::string & |
s | ) |
|
Definition at line 42 of file sha1.cpp.
44 std::istringstream is(s);
void update(const std::string &s)
void SHA1::update |
( |
std::istream & |
is | ) |
|
Definition at line 49 of file sha1.cpp.
51 std::string rest_of_buffer;
void transform(uint32_t block[BLOCK_BYTES])
static void read(std::istream &is, std::string &s, size_t max)
static const unsigned int BLOCK_INTS
static const unsigned int BLOCK_BYTES
static void buffer_to_block(const std::string &buffer, uint32_t block[BLOCK_INTS])
const unsigned int SHA1::BLOCK_BYTES = BLOCK_INTS * 4 |
|
staticprivate |
const unsigned int SHA1::BLOCK_INTS = 16 |
|
staticprivate |
const unsigned int SHA1::DIGEST_INTS = 5 |
|
staticprivate |
uint64_t SHA1::transforms |
|
private |
The documentation for this class was generated from the following files: