vendor/libhydrogen/impl/hash.h in dualcone-0.0.1 vs vendor/libhydrogen/impl/hash.h in dualcone-1.0.0

- old
+ new

@@ -41,14 +41,14 @@ mem_zero(block + 14, sizeof block - 14); memcpy(block + 6, ctx, 8); if (key != NULL) { block[gimli_RATE] = (uint8_t) hydro_hash_KEYBYTES; memcpy(block + gimli_RATE + 1, key, hydro_hash_KEYBYTES); - p = (gimli_RATE + 1 + hydro_hash_KEYBYTES + (gimli_RATE - 1)) & ~(size_t)(gimli_RATE - 1); + p = (gimli_RATE + 1 + hydro_hash_KEYBYTES + (gimli_RATE - 1)) & ~(size_t) (gimli_RATE - 1); } else { block[gimli_RATE] = (uint8_t) 0; - p = (gimli_RATE + 1 + 0 + (gimli_RATE - 1)) & ~(size_t)(gimli_RATE - 1); + p = (gimli_RATE + 1 + 0 + (gimli_RATE - 1)) & ~(size_t) (gimli_RATE - 1); } mem_zero(state, sizeof *state); hydro_hash_update(state, block, p); return 0; @@ -69,14 +69,14 @@ mem_zero(block + 14, sizeof block - 14); memcpy(block + 6, ctx, 8); if (key != NULL) { block[gimli_RATE] = (uint8_t) hydro_hash_KEYBYTES; memcpy(block + gimli_RATE + 1, key, hydro_hash_KEYBYTES); - p = (gimli_RATE + 1 + hydro_hash_KEYBYTES + (gimli_RATE - 1)) & ~(size_t)(gimli_RATE - 1); + p = (gimli_RATE + 1 + hydro_hash_KEYBYTES + (gimli_RATE - 1)) & ~(size_t) (gimli_RATE - 1); } else { block[gimli_RATE] = (uint8_t) 0; - p = (gimli_RATE + 1 + 0 + (gimli_RATE - 1)) & ~(size_t)(gimli_RATE - 1); + p = (gimli_RATE + 1 + 0 + (gimli_RATE - 1)) & ~(size_t) (gimli_RATE - 1); } block[p] = (uint8_t) sizeof tweak; STORE64_LE(&block[p + 1], tweak); p += gimli_RATE; mem_zero(state, sizeof *state); @@ -97,12 +97,12 @@ if (out_len < hydro_hash_BYTES_MIN || out_len > hydro_hash_BYTES_MAX) { return -1; } COMPILER_ASSERT(hydro_hash_BYTES_MAX <= 0xffff); lc[1] = (uint8_t) out_len; - lc[2] = (uint8_t)(out_len >> 8); + lc[2] = (uint8_t) (out_len >> 8); lc[3] = 0; - lc_len = (size_t)(1 + (lc[2] != 0)); + lc_len = (size_t) (1 + (lc[2] != 0)); lc[0] = (uint8_t) lc_len; hydro_hash_update(state, lc, 1 + lc_len + 1); gimli_pad_u8(buf, state->buf_off, gimli_DOMAIN_XOF); for (i = 0; i < out_len / gimli_RATE; i++) { gimli_core_u8(buf, 0);