static const u32x4 ctr_inv_1 = { 0, 0, 0, 1 << 24 };
+#ifndef __VAES__
static_always_inline void
aes_gcm_enc_first_round (u8x16 * r, aes_gcm_counter_t * ctr, u8x16 k,
int n_blocks)
for (int i = 0; i < n_blocks; i++)
d[i] ^= aes_enc_last_round (r[i], k[rounds]);
}
+#endif
static_always_inline u8x16
aes_gcm_ghash_blocks (u8x16 T, aes_gcm_key_data_t * kd,
return T;
}
+#ifndef __VAES__
static_always_inline u8x16
aes_gcm_calc (u8x16 T, aes_gcm_key_data_t * kd, u8x16 * d,
aes_gcm_counter_t * ctr, u8x16u * inv, u8x16u * outv,
ghash_reduce2 (gd);
return ghash_final (gd);
}
+#endif
#ifdef __VAES__
static const u32x16 ctr_inv_1234 = {
aes_gcm_enc (u8x16 T, aes_gcm_key_data_t * kd, aes_gcm_counter_t * ctr,
u8x16u * inv, u8x16u * outv, u32 n_left, int rounds)
{
- u8x16 d[4];
aes_gcm_flags_t f = AES_GCM_F_ENCRYPT;
if (n_left == 0)
T = aes4_gcm_calc (T, kd, d4, ctr, inv, outv, rounds, 1, n_left, f);
return aes4_gcm_ghash_last (T, kd, d4, 1, n_left);
-#endif
-
+#else
+ u8x16 d[4];
if (n_left < 64)
{
f |= AES_GCM_F_LAST_ROUND;
T = aes_gcm_calc (T, kd, d, ctr, inv, outv, rounds, 1, n_left, f);
return aes_gcm_ghash_last (T, kd, d, 1, n_left);
+#endif
}
static_always_inline u8x16