Use uint instead of uint64_t for SHA* padding

Workaround for a clang bug
This commit is contained in:
Frank Denis 2017-10-24 21:57:30 +02:00
parent 58fa4172a5
commit 5935cf7a7e
2 changed files with 6 additions and 6 deletions

View File

@ -153,10 +153,10 @@ static const uint8_t PAD[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
static void
SHA256_Pad(crypto_hash_sha256_state *state, uint32_t tmp32[64 + 8])
{
uint64_t r;
uint64_t i;
unsigned int r;
unsigned int i;
r = (state->count >> 3) & 0x3f;
r = (unsigned int) ((state->count >> 3) & 0x3f);
if (r < 56) {
for (i = 0; i < 56 - r; i++) {
state->buf[r + i] = PAD[i];

View File

@ -172,10 +172,10 @@ static const uint8_t PAD[128] = {
static void
SHA512_Pad(crypto_hash_sha512_state *state, uint64_t tmp64[80 + 8])
{
uint64_t r;
uint64_t i;
unsigned int r;
unsigned int i;
r = (state->count[1] >> 3) & 0x7f;
r = (unsigned int) ((state->count[1] >> 3) & 0x7f);
if (r < 112) {
for (i = 0; i < 112 - r; i++) {
state->buf[r + i] = PAD[i];