hcrypto: Fix UB

This commit is contained in:
Nicolas Williams
2022-10-26 01:54:02 -05:00
parent e4311f3a82
commit 5b1c69b424
3 changed files with 31 additions and 30 deletions

View File

@@ -344,14 +344,14 @@ load(const unsigned char *b, uint32_t v[2])
static void
store(const uint32_t v[2], unsigned char *b)
{
b[0] = (v[0] >> 24) & 0xff;
b[1] = (v[0] >> 16) & 0xff;
b[2] = (v[0] >> 8) & 0xff;
b[3] = (v[0] >> 0) & 0xff;
b[4] = (v[1] >> 24) & 0xff;
b[5] = (v[1] >> 16) & 0xff;
b[6] = (v[1] >> 8) & 0xff;
b[7] = (v[1] >> 0) & 0xff;
b[0] = (v[0] >> 24) & 0xffU;
b[1] = (v[0] >> 16) & 0xffU;
b[2] = (v[0] >> 8) & 0xffU;
b[3] = (v[0] >> 0) & 0xffU;
b[4] = (v[1] >> 24) & 0xffU;
b[5] = (v[1] >> 16) & 0xffU;
b[6] = (v[1] >> 8) & 0xffU;
b[7] = (v[1] >> 0) & 0xffU;
}
/**