sha1: give state enum a print operator
This commit is contained in:
parent
ca9db30ab4
commit
a9bffcff08
@ -37,6 +37,19 @@ using std::begin;
|
||||
using std::end;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
std::ostream&
|
||||
operator<< (std::ostream &os, SHA1::state_t t) {
|
||||
switch (t) {
|
||||
case SHA1::READY: os << "READY"; return os;
|
||||
case SHA1::FINISHED: os << "FINISHED"; return os;
|
||||
default:
|
||||
unreachable ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Logical function for sequence of rounds
|
||||
static inline uint32_t
|
||||
f_00 (uint32_t B, uint32_t C, uint32_t D)
|
||||
|
@ -40,13 +40,15 @@ namespace util {
|
||||
digest_t digest (void) const;
|
||||
void reset (void);
|
||||
|
||||
enum state_t {
|
||||
READY,
|
||||
FINISHED
|
||||
};
|
||||
|
||||
protected:
|
||||
void process (void);
|
||||
|
||||
enum {
|
||||
READY,
|
||||
FINISHED
|
||||
} state;
|
||||
state_t state;
|
||||
|
||||
uint64_t total;
|
||||
uint32_t H[5];
|
||||
|
Loading…
Reference in New Issue
Block a user