Skip to contentSkip to conversation

Accelerate GCM with PCLMULQDQ-NI

DISCUSSION Huang Ying 2 participants 3 messages Mar 18, 2009 – Mar 30, 2009 Crypto API

lore
Share & tools
lore

Huang Ying

author
#0 lore raw

Hi,

In addition to AES-NI, Intel will provide PCLMULQDQ-NI (carry-less multiplication) in future CPU to accelerate GCM mode. The document can be found here:

http://software.intel.com/en-us/articles/carry-less-multiplication-and-its-usage-for-computing-the-gcm-mode/

It follows the same design as that of AES-NI, that is, XMM registers are used.

To accelerate GCM with it, I make the following design:

1. Implement ghash as an ahash algorithm, Use ghash in gcm implementation.
2. Provide a new implementation of ghash with PCLMULQDQ-NI.

What do you think about that?

Best Regards,
Huang Ying

maintainer
#1 lore raw
Quoted 8 lines · Huang Ying

To accelerate GCM with it, I make the following design:

1. Implement ghash as an ahash algorithm, Use ghash in gcm implementation.
2. Provide a new implementation of ghash with PCLMULQDQ-NI.

What do you think about that?

Sounds OK to me. I presume the choice of ahash instead of shash is due to the use of XMM registers, just like AES?

Cheers,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
author
#2 lore raw
Quoted 4 lines · Herbert Xu
Quoted 3 lines · Huang Ying

To accelerate GCM with it, I make the following design:

Quoted 8 lines
Quoted 5 lines

1. Implement ghash as an ahash algorithm, Use ghash in gcm implementation.
2. Provide a new implementation of ghash with PCLMULQDQ-NI.

What do you think about that?

Sounds OK to me. I presume the choice of ahash instead of shash is due to the use of XMM registers, just like AES?

Yes, because PCLMULQDQ touches XMMs too. Just like AES, there is a raw
shash: ghash-clmul and an ahash via cryptd(ghash-clmul).

Best Regards,
Huang Ying