mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Megha Dey <megha.dey@intel.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: tim.c.chen@linux.intel.com, davem@davemloft.net,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [Patch V5 1/7] crypto: Multi-buffer encryption infrastructure support
Date: Thu, 08 Jun 2017 12:52:54 -0700	[thread overview]
Message-ID: <1496951574.8042.15.camel@megha-Z97X-UD7-TH> (raw)
In-Reply-To: <20170424090024.GA20535@gondor.apana.org.au>

On Mon, 2017-04-24 at 17:00 +0800, Herbert Xu wrote:
> On Thu, Apr 20, 2017 at 01:50:34PM -0700, Megha Dey wrote:
> >
> > +static int simd_skcipher_decrypt_mb(struct skcipher_request *req)
> > +{
> > +	struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
> > +	struct simd_skcipher_ctx_mb *ctx = crypto_skcipher_ctx(tfm);
> > +	struct skcipher_request *subreq;
> > +	struct crypto_skcipher *child;
> > +
> > +	subreq = skcipher_request_ctx(req);
> > +	*subreq = *req;
> > +
> > +	child = &ctx->mcryptd_tfm->base;
> > +
> > +	skcipher_request_set_tfm(subreq, child);
> > +
> > +	return crypto_skcipher_decrypt(subreq);
> > +}
> 
> Why did you add the code here in simd.c? This doesn't seem to have
> anything to do with kernel SIMD instructions.
> 
> From your later patch I see that what you want is simply a wrapper
> around a synchronous internal algorithm.  That is indeed similar
> in purpose to simd.c, but I still find it weird to be adding this
> code here.
> 
> My suggestion is to instead move this code to mcryptd.c.  It's
> a bit fiddly because mcryptd already exists as a template.  But
> you should still be able to create a seaprate mcryptd interface
> for skcipher in the way that simd does it.  In time we can convert
> mcryptd hash to this model too.
> 
> Also you adopted the simd compat naming scheme.  Please don't do
> that as you're creating something brand new so there is no need
> to keep the existing compat (i.e., __XXX) naming scheme.  In the
> new naming scheme, the internal algorithm should just carry the
> normal alg name (e.g., ecb(aes)) and driver name, while the mcryptd
> wrapped version will have the same algorithm name but carry a
> prefix on the driver name (which is simd- for simd.c, but you
> should probably used mcryptd-).
> 
> Cheers,

I will move this code to the mcryptd.c.

About the naming scheme, could you give me an example where the internal
and external algorithm have the same name? I tried searching but did not
find any.

When the outer and inner algorithm have the same name, I see a crash
when testing using tcrypt. This is because the wrong algortihm (with a
higher priority) is being picked up in __crypto_alg_lookup.  

Inner alg:
Currently:
alg name:__cbc(aes), driver name:__cbc-aes-aesni-mb

expected:
alg name:cbc(aes), driver name: cbc-aes-aesni-mb

Outer alg:
Currently:
alg name:cbc(aes), driver name:cbc-aes-aesni-mb

expected:
alg name:cbc(aes), driver name:mcryptd-cbc-aes-aesni-mb

Thanks,
Megha

  reply	other threads:[~2017-06-08 19:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 20:50 [Patch V5 0/7] crypto: AES CBC multibuffer implementation Megha Dey
2017-04-20 20:50 ` [Patch V5 1/7] crypto: Multi-buffer encryption infrastructure support Megha Dey
2017-04-21  0:19   ` kbuild test robot
2017-04-21  3:02   ` kbuild test robot
2017-04-24  9:00   ` Herbert Xu
2017-06-08 19:52     ` Megha Dey [this message]
2017-06-23  8:32       ` Herbert Xu
2017-04-20 20:50 ` [Patch V5 2/7] crypto: AES CBC multi-buffer data structures Megha Dey
2017-04-20 20:50 ` [Patch V5 3/7] crypto: AES CBC multi-buffer scheduler Megha Dey
2017-04-20 20:50 ` [Patch V5 4/7] crypto: AES CBC by8 encryption Megha Dey
2017-04-20 20:50 ` [Patch V5 5/7] crypto: AES CBC multi-buffer glue code Megha Dey
2017-04-20 20:50 ` [Patch V5 6/7] crypto: AES vectors for AES CBC multibuffer testing Megha Dey
2017-04-20 20:50 ` [Patch V5 7/7] crypto: AES CBC multi-buffer tcrypt Megha Dey
2017-04-21  0:54   ` kbuild test robot
2017-04-21  1:56   ` kbuild test robot

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=1496951574.8042.15.camel@megha-Z97X-UD7-TH \
    --to=megha.dey@intel.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tim.c.chen@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

all inboxes | Powered by JetHome®