Use AES encrypt key expansion API in GCM
Precompute GCM key API was using the AES key expansion API
for SSE, which generate expanded encrypt and decrypt keys,
discarding the decrypt keys.
Instead, AES encrypt key expansion API is used, to avoid
the need of temporary memory.
@@ -117,19 +117,14 @@ void aes_gcm_pre_192_vaes_avx512(const void *key, struct gcm_key_data *key_data)
void aes_gcm_pre_256_sse(const void *key, struct gcm_key_data *key_data)
{
- struct gcm_key_data tmp;
-
- aes_keyexp_256_sse(key, key_data->expanded_keys, tmp.expanded_keys);
+ aes_keyexp_256_enc_sse(key, key_data->expanded_keys);
aes_gcm_precomp_256_sse(key_data);
}
void aes_gcm_pre_256_sse_no_aesni(const void *key,
struct gcm_key_data *key_data)
{
- struct gcm_key_data tmp;
-
- aes_keyexp_256_sse_no_aesni(key, key_data->expanded_keys,
- tmp.expanded_keys);
+ aes_keyexp_256_enc_sse_no_aesni(key, key_data->expanded_keys);
aes_gcm_precomp_256_sse_no_aesni(key_data);
}
