diff options
Diffstat (limited to 'src/Crypto/Streebog.c')
-rw-r--r-- | src/Crypto/Streebog.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Crypto/Streebog.c b/src/Crypto/Streebog.c index 84991021..d223eef8 100644 --- a/src/Crypto/Streebog.c +++ b/src/Crypto/Streebog.c @@ -2226,74 +2226,74 @@ stage2(STREEBOG_CTX *CTX, const unsigned char *data) static void stage3(STREEBOG_CTX *CTX) { STREEBOG_ALIGN(16) unsigned long long buf[8]; memset(buf, 0x00, sizeof buf); memcpy(buf, (CTX->buffer), CTX->bufsize); memcpy((CTX->buffer), buf, 8 * sizeof (unsigned long long)); memset(buf, 0x00, sizeof buf); #ifndef __GOST3411_BIG_ENDIAN__ buf[0] = ((unsigned long long) CTX->bufsize) << 3; #else buf[0] = BSWAP64(((unsigned long long) CTX->bufsize) << 3); #endif pad(CTX); g((CTX->h), (CTX->N), (const unsigned char *) (CTX->buffer)); add512((CTX->N), buf, (CTX->N)); add512((CTX->Sigma), (const unsigned long long *) CTX->buffer, (CTX->Sigma)); g((CTX->h), buffer0, (const unsigned char *) (CTX->N)); g((CTX->h), buffer0, (const unsigned char *) (CTX->Sigma)); memcpy((CTX->hash), (CTX->h), 8 * sizeof(unsigned long long)); } -void STREEBOG_add(STREEBOG_CTX *CTX, const byte *data, size_t len) +void STREEBOG_add(STREEBOG_CTX *CTX, const uint8 *data, size_t len) { size_t chunksize; while (len > 63 && CTX->bufsize == 0) { stage2(CTX, data); data += 64; len -= 64; } while (len) { chunksize = 64 - CTX->bufsize; if (chunksize > len) chunksize = len; memcpy(&CTX->buffer[CTX->bufsize], data, chunksize); CTX->bufsize += chunksize; len -= chunksize; data += chunksize; if (CTX->bufsize == 64) { stage2(CTX, CTX->buffer); CTX->bufsize = 0; } } } -void STREEBOG_finalize(STREEBOG_CTX *CTX, byte *digest) +void STREEBOG_finalize(STREEBOG_CTX *CTX, uint8 *digest) { stage3(CTX); CTX->bufsize = 0; if (CTX->digest_size == 256) memcpy(digest, &(CTX->hash[4]), 32); else memcpy(digest, CTX->hash, 64); } |