Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Tudor-Dan Ambarus <tudor-dan.ambarus@nxp.com>
Cc: smueller@chronox.de, linux-crypto@vger.kernel.org,
	cristian.stoica@nxp.com, horia.geanta@nxp.com,
	alexandru.porosanu@nxp.com
Subject: Re: [PATCH 3/3] crypto: caam - add support for RSA algorithm
Date: Sat, 27 Feb 2016 17:08:24 +0000	[thread overview]
Message-ID: <20160227170824.GA8398@gondor.apana.org.au> (raw)
In-Reply-To: <VI1PR04MB131149561E463EA7BE714866B8A30@VI1PR04MB1311.eurprd04.prod.outlook.com>

Tudor-Dan Ambarus <tudor-dan.ambarus@nxp.com> wrote:
> Hi Stephan,
> 
>> -----Original Message-----
>> >+++ b/drivers/crypto/caam/caam_rsaprivkey.asn1
>> >@@ -0,0 +1,11 @@
>> >+RsaPrivKey ::= SEQUENCE {
>> >+    version         INTEGER,
>> >+    n               INTEGER ({ caam_rsa_get_n }),
>> >+    e               INTEGER ({ caam_rsa_get_e }),
>> >+    d               INTEGER ({ caam_rsa_get_d }),
>> >+    prime1          INTEGER,
>> >+    prime2          INTEGER,
>> >+    exponent1       INTEGER,
>> >+    exponent2       INTEGER,
>> >+    coefficient     INTEGER
>> >+}
>> 
>> Why do you define your own ASN.1 sequence? Why not using the common
>> crypto/rsaprivkey.asn1?
>> 
> 
> [ta] The functions indicated in crypto/rsaprivkey.asn1 return the key members in MPI format. Our hardware expects the keys as u8 buffers; retrieving the key members in MPI format and then writing them to u8 buffers would be an unnecessary step.

Is there any reason why we can't change it to return the raw
integer and make the software RSA implementation do the MPI parsing
instead?

As hardware RSA implementations are likely to want to use raw
integers we don't really want everyone to have their own parser.

I know qat has already gone in with its own parser but we should
fix it too.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2016-02-27 17:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-22  9:16 [PATCH 1/3] crypto: scatterwak - Add scatterwalk_sg_copychunks Tudor Ambarus
2016-02-22  9:16 ` [PATCH 2/3] crypto: scatterwalk - export scatterwalk_pagedone Tudor Ambarus
2016-02-22  9:16 ` [PATCH 3/3] crypto: caam - add support for RSA algorithm Tudor Ambarus
2016-02-22 10:10   ` Stephan Mueller
2016-02-22 11:40     ` Tudor-Dan Ambarus
2016-02-27 17:08       ` Herbert Xu [this message]
2016-03-01 11:29         ` Tudor-Dan Ambarus
  -- strict thread matches above, loose matches on Subject: below --
2016-05-12 15:06 [PATCH v5 0/3] " Tudor Ambarus
2016-05-12 15:06 ` [PATCH 3/3] " Tudor Ambarus
2016-05-12 19:20   ` Horia Ioan Geanta Neag
2016-06-07 14:24 [PATCH v7 0/3] " Tudor Ambarus
2016-06-07 14:24 ` [PATCH 3/3] " Tudor Ambarus

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=20160227170824.GA8398@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=alexandru.porosanu@nxp.com \
    --cc=cristian.stoica@nxp.com \
    --cc=horia.geanta@nxp.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=smueller@chronox.de \
    --cc=tudor-dan.ambarus@nxp.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