linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Harsh Jain <harshjain.prof@gmail.com>
Cc: linux-crypto@vger.kernel.org
Subject: Re: [PATCH 5/8] crypto:chcr: Change cra_flags for cipher algos
Date: Wed, 8 Mar 2017 18:21:08 +0800	[thread overview]
Message-ID: <20170308102108.GA5000@gondor.apana.org.au> (raw)
In-Reply-To: <CAFXBA=mkKinfgLT0vRSXjyW7Lt0V-6o0ud3bdzLZjxqF1je+sg@mail.gmail.com>

On Wed, Mar 08, 2017 at 03:28:26PM +0530, Harsh Jain wrote:
>
> If I try above patch on 4.9.13 stable kernel. Kernel  stops executing
> tests for cbc(aes), Same is working fine on cryptodev-2.6 latest tree.
> It seems below patch set has changed the behavior.
> 
> 
> crypto: testmgr - Do not test internal algorithms

On older kernels each ablkcipher gets an geniv instantiated on top
of it.  Therefore the ablkcipher itself is never tested, only the
geniv is tested.

We have since got rid of the geniv and now test the ablkcipher
directly.

There was a period where we didn't generate a geniv but I forgot
to also remove the below chunk which skipped testing the ablkcipher.

> diff --git a/crypto/algboss.c b/crypto/algboss.c
> index 6e39d9c..ccb85e1 100644
> --- a/crypto/algboss.c
> +++ b/crypto/algboss.c
> @@ -247,12 +247,8 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg)
> memcpy(param->alg, alg->cra_name, sizeof(param->alg));
> type = alg->cra_flags;
> - /* This piece of crap needs to disappear into per-type test hooks. */
> - if (!((type ^ CRYPTO_ALG_TYPE_BLKCIPHER) &
> - CRYPTO_ALG_TYPE_BLKCIPHER_MASK) && !(type & CRYPTO_ALG_GENIV) &&
> - ((alg->cra_flags & CRYPTO_ALG_TYPE_MASK) ==
> - CRYPTO_ALG_TYPE_BLKCIPHER ? alg->cra_blkcipher.ivsize :
> - alg->cra_ablkcipher.ivsize))
> + /* Do not test internal algorithms. */
> + if (type & CRYPTO_ALG_INTERNAL)
> type |= CRYPTO_ALG_TESTED;
>
> Its bit confusing for me. Are we supposed to declared it as
> "CRYPTO_ALG_TYPE_BLKCIPHER" for older kernels.

It should definitely be ABLKCIPHER in your case.

Even if the test is skipped your driver should still work.

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

  reply	other threads:[~2017-03-08 10:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-27 10:39 [PATCH 0/8] Bug fixes Harsh Jain
2017-01-27 10:39 ` [PATCH 1/8] crypto:chcr-Change flow IDs Harsh Jain
2017-01-27 10:39 ` [PATCH 2/8] crypto:chcr- Fix key length for RFC4106 Harsh Jain
2017-01-27 10:39 ` [PATCH 3/8] crypto:chcr-fix itnull.cocci warnings Harsh Jain
2017-01-27 10:39 ` [PATCH 4/8] crypto:chcr- Use cipher instead of Block Cipher in gcm setkey Harsh Jain
2017-01-27 10:39 ` [PATCH 5/8] crypto:chcr: Change cra_flags for cipher algos Harsh Jain
2017-03-08  9:58   ` Harsh Jain
2017-03-08 10:21     ` Herbert Xu [this message]
2017-01-27 10:39 ` [PATCH 6/8] crypto:chcr- Change algo priority Harsh Jain
2017-01-27 10:39 ` [PATCH 7/8] crypto:chcr- Fix wrong typecasting Harsh Jain
2017-01-27 10:39 ` [PATCH 8/8] crypto:chcr-Fix Smatch Complaint Harsh Jain
2017-02-03 10:21 ` [PATCH 0/8] Bug fixes 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=20170308102108.GA5000@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=harshjain.prof@gmail.com \
    --cc=linux-crypto@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;
as well as URLs for NNTP newsgroup(s).