[openssl-dev] Stitched AES-NI AES-GCM code & AVX2

Brian Smith brian at briansmith.org
Fri Jun 10 00:09:35 UTC 2016


Hi,

I see that the stitched AES-NI AES-GCM code will be used if :

    gctx->ctr==aesni_ctr32_encrypt_blocks && \
    gctx->gcm.ghash==gcm_ghash_avx)

In gcm128, I see that it decides to use gcm_ghash_avx if:

    /* AVX+MOVBE */
    if (((OPENSSL_ia32cap_P[1] >> 22) & 0x41) == 0x41) {

But, I think the stitched AES-NI AES-GCM code requires AVX2, not just
AVX. So, I think that to condition to execute the stitched code should
be changed to also test the AVX2 flag.

Maybe in practice there are no processors that have AVX and MOVBE but
which don't have AVX2. But, better safe than sorry.

Cheers,
Brian
-- 
https://briansmith.org/


More information about the openssl-dev mailing list