Fix all warnings from -Wcast-align

This commit is contained in:
Matt Kelly
2016-06-28 00:34:37 -04:00
parent d777f9d1dc
commit e187f4cbf4
22 changed files with 44 additions and 43 deletions
+2 -2
View File
@@ -48,13 +48,13 @@ int pmac_process(pmac_state *pmac, const unsigned char *in, unsigned long inlen)
for (x = 0; x < (inlen - 16); x += 16) {
pmac_shift_xor(pmac);
for (y = 0; y < 16; y += sizeof(LTC_FAST_TYPE)) {
*((LTC_FAST_TYPE*)(&Z[y])) = *((LTC_FAST_TYPE*)(&in[y])) ^ *((LTC_FAST_TYPE*)(&pmac->Li[y]));
*(LTC_FAST_TYPE_PTR_CAST(&Z[y])) = *(LTC_FAST_TYPE_PTR_CAST(&in[y])) ^ *(LTC_FAST_TYPE_PTR_CAST(&pmac->Li[y]));
}
if ((err = cipher_descriptor[pmac->cipher_idx].ecb_encrypt(Z, Z, &pmac->key)) != CRYPT_OK) {
return err;
}
for (y = 0; y < 16; y += sizeof(LTC_FAST_TYPE)) {
*((LTC_FAST_TYPE*)(&pmac->checksum[y])) ^= *((LTC_FAST_TYPE*)(&Z[y]));
*(LTC_FAST_TYPE_PTR_CAST(&pmac->checksum[y])) ^= *(LTC_FAST_TYPE_PTR_CAST(&Z[y]));
}
in += 16;
}
+2 -2
View File
@@ -27,8 +27,8 @@ void pmac_shift_xor(pmac_state *pmac)
y = pmac_ntz(pmac->block_index++);
#ifdef LTC_FAST
for (x = 0; x < pmac->block_len; x += sizeof(LTC_FAST_TYPE)) {
*((LTC_FAST_TYPE*)((unsigned char *)pmac->Li + x)) ^=
*((LTC_FAST_TYPE*)((unsigned char *)pmac->Ls[y] + x));
*(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pmac->Li + x)) ^=
*(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pmac->Ls[y] + x));
}
#else
for (x = 0; x < pmac->block_len; x++) {