From: Herbert Xu <herbert@gondor.apana.org.au>
To: Dan Streetman <ddstreet@ieee.org>
Cc: Haren Myneni <haren@linux.vnet.ibm.com>,
"David S. Miller" <davem@davemloft.net>,
Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Haren Myneni <hbabu@us.ibm.com>
Subject: Re: [PATCH] drivers/crypto/nx: Add CRC and validation support for nx842
Date: Tue, 22 Sep 2015 20:21:17 +0800 [thread overview]
Message-ID: <20150922122117.GA11522@gondor.apana.org.au> (raw)
In-Reply-To: <CALZtONDbOxorPmy2A9FkD7rpY2HsOMaEs9Vvqg2kHh1qtM0GqA@mail.gmail.com>
On Mon, Sep 21, 2015 at 11:21:14AM -0400, Dan Streetman wrote:
>
> As far as the hw and sw drivers producing the exact same output, I
> don't think that's possible with the current hw and sw drivers,
> because the hw driver may have to add a header to the actual byte
> stream that the hw creates, depending on buffer alignment and size
> (the hw has specific restrictions). Currently, the sw driver doesn't
> understand that header that the 842 hw driver creates, although that
> could be added to the sw driver. And, the hw driver skips adding the
> header if the buffers are correctly aligned/sized, which would result
> in a test vector failure if it doesn't align the buffer the same way
> each time.
I guess they don't have to be exactly the same. As long as each
can take the output of the other and compress/decompress them it
should be fine.
> Also, it might be a good time to add what we talked about a while ago,
> to push the alignment/size restrictions into the crypto compression
> layer, by adding cra_alignmask and cra_blocksize support to
> crypto/compress.c. Since the 842 hw has requirements not only for
> specific alignment and min/max sizes, but also a requirement for
> specific length multiple (i.e. must be !(len % 8)) it might be
> worthwhile to also add a cra_sizemodulo or something like that.
> However, if the common crypto alignment/size handling code allows any
> alignment/size buffers (instead of just returning error for mis-sized
> buffers), I think a common crypto header would need to be added in
> cases of mis-sizing, which may not be appropriate for common code.
> Alternately, the common crypto code could just return error for
> mis-sized buffers; users of the crypto comp api would just have to
> check crypto_tfm_alg_blocksize() before calling.
I'd like to see another hardware implementation before we start
moving this into the API.
> In case I haven't said it before, I really hate how the 842 hw
> requires specific alignment and sizing. How hard is it to add support
> for any alignment/size in the hw?!?
Another option is to use a software fallback for the cases that
the hardware can't handle.
Cheers,
--
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
next prev parent reply other threads:[~2015-09-22 12:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-20 0:02 [PATCH] drivers/crypto/nx: Add CRC and validation support for nx842 Haren Myneni
2015-09-21 14:26 ` Herbert Xu
2015-09-21 15:21 ` Dan Streetman
2015-09-22 12:21 ` Herbert Xu [this message]
2015-09-22 14:39 ` Dan Streetman
2015-09-22 14:42 ` Herbert Xu
2015-09-22 15:08 ` Dan Streetman
2015-09-23 9:54 ` Herbert Xu
2015-09-24 12:32 ` Dan Streetman
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=20150922122117.GA11522@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=davem@davemloft.net \
--cc=ddstreet@ieee.org \
--cc=haren@linux.vnet.ibm.com \
--cc=hbabu@us.ibm.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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