Type: fix
Change-Id: Id61aa407eeeb4d44cf47ed39283a0c79ed3abbee
Signed-off-by: Damjan Marion <damarion@cisco.com>
static const u32x4 ctr_inv_1 = { 0, 0, 0, 1 << 24 };
static const u32x4 ctr_inv_1 = { 0, 0, 0, 1 << 24 };
static_always_inline void
aes_gcm_enc_first_round (u8x16 * r, aes_gcm_counter_t * ctr, u8x16 k,
int n_blocks)
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]);
}
for (int i = 0; i < n_blocks; i++)
d[i] ^= aes_enc_last_round (r[i], k[rounds]);
}
static_always_inline u8x16
aes_gcm_ghash_blocks (u8x16 T, aes_gcm_key_data_t * kd,
static_always_inline u8x16
aes_gcm_ghash_blocks (u8x16 T, aes_gcm_key_data_t * kd,
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,
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);
}
ghash_reduce2 (gd);
return ghash_final (gd);
}
#ifdef __VAES__
static const u32x16 ctr_inv_1234 = {
#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)
{
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)
{
aes_gcm_flags_t f = AES_GCM_F_ENCRYPT;
if (n_left == 0)
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);
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);
if (n_left < 64)
{
f |= AES_GCM_F_LAST_ROUND;
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);
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);
}
static_always_inline u8x16
}
static_always_inline u8x16
typedef struct
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
typedef struct
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
+#if __VAES__
+ u8x16 cbc_iv[16];
+#else
} crypto_native_per_thread_data_t;
typedef struct
} crypto_native_per_thread_data_t;
typedef struct