sha1: style and whitespace
This commit is contained in:
parent
5a7ff4d20a
commit
ca9db30ab4
@ -58,6 +58,7 @@ f_60 (uint32_t B, uint32_t C, uint32_t D)
|
|||||||
{ return B ^ C ^ D; }
|
{ return B ^ C ^ D; }
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
// Constant words for sequence of rounds
|
// Constant words for sequence of rounds
|
||||||
static const uint32_t K_00 = 0x5A827999;
|
static const uint32_t K_00 = 0x5A827999;
|
||||||
static const uint32_t K_20 = 0x6ED9EBA1;
|
static const uint32_t K_20 = 0x6ED9EBA1;
|
||||||
@ -76,6 +77,8 @@ static const uint32_t DEFAULT_H[] = {
|
|||||||
static const size_t BLOCK_WORDS = 16;
|
static const size_t BLOCK_WORDS = 16;
|
||||||
static const size_t BLOCK_BYTES = BLOCK_WORDS * sizeof (uint32_t);
|
static const size_t BLOCK_BYTES = BLOCK_WORDS * sizeof (uint32_t);
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
SHA1::SHA1()
|
SHA1::SHA1()
|
||||||
{
|
{
|
||||||
reset ();
|
reset ();
|
||||||
@ -91,6 +94,7 @@ SHA1::reset (void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
void
|
void
|
||||||
SHA1::update (const uint8_t *data, size_t size) {
|
SHA1::update (const uint8_t *data, size_t size) {
|
||||||
CHECK_EQ (state, READY);
|
CHECK_EQ (state, READY);
|
||||||
@ -115,6 +119,7 @@ SHA1::update (const uint8_t *data, size_t size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
void
|
void
|
||||||
SHA1::process (void) {
|
SHA1::process (void) {
|
||||||
CHECK_EQ (total % BLOCK_BYTES, 0);
|
CHECK_EQ (total % BLOCK_BYTES, 0);
|
||||||
@ -161,6 +166,7 @@ SHA1::process (void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
void
|
void
|
||||||
SHA1::finish (void) {
|
SHA1::finish (void) {
|
||||||
size_t offset = total % BLOCK_BYTES;
|
size_t offset = total % BLOCK_BYTES;
|
||||||
@ -200,6 +206,7 @@ SHA1::finish (void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
SHA1::digest_t
|
SHA1::digest_t
|
||||||
SHA1::digest (void) const {
|
SHA1::digest (void) const {
|
||||||
CHECK_EQ (state, FINISHED);
|
CHECK_EQ (state, FINISHED);
|
||||||
|
Loading…
Reference in New Issue
Block a user