From: Tadeusz Struk <tadeusz.struk@intel.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: davem@davemloft.net, linux-crypto@vger.kernel.org, qat-linux@intel.com
Subject: Re: [PATCH RFC 4/4] crypto: qat - Add new algif interface for userspace
Date: Fri, 07 Nov 2014 10:53:58 -0800 [thread overview]
Message-ID: <545D1546.1020308@intel.com> (raw)
In-Reply-To: <20141107053105.GA17825@gondor.apana.org.au>
Hi Herbert,
On 11/06/2014 09:31 PM, Herbert Xu wrote:
> On Thu, Nov 06, 2014 at 09:24:22PM -0800, Tadeusz Struk wrote:
>>
>> What about aead? Using my algif_qat I can build a single request to HW
>> that preforms both encryption and authentication in one go, ever for
>> things like aes-cbc-hmac-sha1. This allows me to get great performance
>> of authenticated encryption from user space.
>
> aead is simpler as it's already part of the API so we just need to
> add algif_aead.
>
> Cheers,
>
For the asymmetric crypto below are the operations and algorithms the
QAT HW can accelerate.
* DH:
1. Diffie-Hellman phase 1 operations as defined in the PKCS #3 standard.
2. Diffie-Hellman phase 2 operations as defined in the PKCS #3 standard.
* DSA:
1. Generate DSA P Parameter - performs FIPS 186-3 Appendix A.1.1.2 steps
11.4 (c = X mod 2q) and 11.5 (p = X - (c - 1)), and 11.7 (Test whether p
is prime)
2. Generate DSA G Parameter - performs FIPS 186-3 Appendix A.2.1, steps
1 (e = (p - 1)/q), 3 g = h^e mod p, and 4
3. Generate DSA Y Parameter - performs FIPS 186-3 section 4.1 (y = g^x
mod p)
4. Generate DSA R Signature - performs FIPS 186-3 Section 4.6: r = (g^k
mod p) mod q
5. Generate DSA S Signature - performs FIPS 186-3 Section 4.6: s =
(k^-1(z + xr)) mod q
6. Generate DSA R and S Signatures - performs FIPS 186-3 Section 4.6: r
= (g^k mod p) mod q, s = (k^-1(z + xr)) mod q
7. Verify DSA R and S signatures - performs FIPS 186-3 Section 4.7:
w = (s')^-1 mod q
u1 = (zw) mod q
u2 = ((r')w) mod q
v = (((g)^u1 (y)^u2) mod p) mod q
* RSA:
1. Generate RSA keys - as specified in the PKCS #1 V2.1 standard
2. Perform the RSA encrypt (verify) primitive
3. Perform the RSA decrypt (sign) primitive
* EC:
1. Elliptic Curve Point Multiplication as defined in ANSI X9.63 Annex D.3.2
2. Elliptic Curve Point Verification as defined in ANSI X9.62 Annex
A.4.2 steps a, b and c.
3. ECDH Point Multiplication as defined in ANSI X9.63 2001 section 5.4
4. ECDSA generate signature R as per ANSI X9.62 2005 section 7.3
5. ECDSA generate signature S as per ANSI X9.62 2005 section 7.3.
6. ECDSA generate signature R & S as per ANSI X9.62 2005 section 7.3.
7. ECDSA Verify as per ANSI X9.62 2005 section 7.4
* The QAT HW can also perform modular exponentiation operation: r =
(base ^ exponent) mod modulus, and modular inversion operation: r =
(1/A) mod modulus
* It can also probabilistically test if a number is prime using GCD,
Fermat, Miller-Rabin, and Lucas testing methods using all combinations
of these methods:
(1x GCD) + (1x Fermat) + (up to 50x Miller-Rabin rounds) + (1x Lucas)
* and it can also accelerate SSL, TLS and TLSv2 key generation and MGF1
as per RFC3447, and Extended Mask Generation Function.
Are you planning to add all of these to the API?
Maybe it will be easier to add a generic af_alg_type e.g "af_direct" for
the HW drivers to use to implement HW specific functionality for the
stuff that is not yet (or never will) on the API?
I can try to put something together.
Regards,
Tadeusz
next prev parent reply other threads:[~2014-11-07 18:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-06 19:59 [PATCH RFC 0/4] crypto: qat - Add userspace access to QAT services Tadeusz Struk
2014-11-06 19:59 ` [PATCH RFC 1/4] crytpo: qat - Fix 64 bytes requests Tadeusz Struk
2014-11-06 19:59 ` [PATCH RFC 2/4] crypto: qat - Add PKE firmware Tadeusz Struk
2014-11-06 19:59 ` [PATCH RFC 3/4] crypto: qat - Add userspace instances Tadeusz Struk
2014-11-06 19:59 ` [PATCH RFC 4/4] crypto: qat - Add new algif interface for userspace Tadeusz Struk
2014-11-07 2:56 ` Herbert Xu
2014-11-07 3:43 ` Tadeusz Struk
2014-11-07 4:05 ` Herbert Xu
2014-11-07 5:24 ` Tadeusz Struk
2014-11-07 5:31 ` Herbert Xu
2014-11-07 18:53 ` Tadeusz Struk [this message]
2014-11-07 19:48 ` Tadeusz Struk
2014-11-14 1:19 ` Herbert Xu
2014-11-14 1:25 ` Tadeusz Struk
2014-11-14 1:29 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=545D1546.1020308@intel.com \
--to=tadeusz.struk@intel.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=qat-linux@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).