diff --git a/gcm.cpp b/gcm.cpp index b36e6c9e..4e3e2845 100644 --- a/gcm.cpp +++ b/gcm.cpp @@ -367,8 +367,8 @@ void GCM_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const if (HasPMULL()) { const uint64x2_t r = s_clmulConstants[0]; - const uint64x2_t t = vld1q_u64((const uint64_t *)hashKey); - const uint64x2_t h0 = vrev64q_u8(vextq_u64(t, t, 1)); + const uint64x2_t t = vreinterpretq_u64_u8(vrev64q_u8(vld1q_u8(hashKey))); + const uint64x2_t h0 = vextq_u64(t, t, 1); uint64x2_t h = h0; for (i=0; i= 16) @@ -672,8 +672,8 @@ size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len) if (++i == s) { - const uint64x2_t t1 = vld1q_u64((const uint64_t *)data); - d1 = veorq_u64(vrev64q_u8(vextq_u64(t1, t1, 1)), x); + const uint64x2_t t1 = vreinterpretq_u64_u8(vrev64q_u8(vld1q_u8(data))); + d1 = veorq_u64(vextq_u64(t1, t1, 1), x); c0 = veorq_u64(c0, PMULL_00(d1, h0)); c2 = veorq_u64(c2, PMULL_10(d1, h1)); d1 = veorq_u64(d1, (uint64x2_t)vcombine_u32(vget_high_u32(vreinterpretq_u32_u64(d1)), @@ -691,8 +691,8 @@ size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len) if (++i == s) { - const uint64x2_t t2 = vld1q_u64((const uint64_t *)data); - d1 = veorq_u64(vrev64q_u8(vextq_u64(t2, t2, 1)), x); + const uint64x2_t t2 = vreinterpretq_u64_u8(vrev64q_u8(vld1q_u8(data))); + d1 = veorq_u64(vextq_u64(t2, t2, 1), x); c0 = veorq_u64(c0, PMULL_01(d1, h0)); c2 = veorq_u64(c2, PMULL_11(d1, h1)); d1 = veorq_u64(d1, (uint64x2_t)vcombine_u32(vget_high_u32(vreinterpretq_u32_u64(d1)), @@ -702,8 +702,8 @@ size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len) break; } - const uint64x2_t t3 = vld1q_u64((uint64_t *)(data+(s-i)*16-8)); - d2 = vrev64q_u8(vextq_u64(t3, t3, 1)); + const uint64x2_t t3 = vreinterpretq_u64_u8(vrev64q_u8(vld1q_u8(data+(s-i)*16-8))); + d2 = vextq_u64(t3, t3, 1); c0 = veorq_u64(c0, PMULL_01(d1, h0)); c2 = veorq_u64(c2, PMULL_01(d2, h1)); d1 = veorq_u64(d1, d2);