mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: LABBE Corentin <clabbe.montjoie@gmail.com>
Cc: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	maxime.ripard@free-electrons.com, linux@arm.linux.org.uk,
	davem@davemloft.net, akpm@linux-foundation.org,
	gregkh@linuxfoundation.org, mchehab@osg.samsung.com,
	arnd@arndb.de, joe@perches.com, devicetree@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-sunxi@googlegroups.com
Subject: Re: [linux-sunxi] Re: [PATCH v10 4/5] crypto: Add Allwinner Security System crypto accelerator
Date: Thu, 9 Jul 2015 14:59:56 +0800	[thread overview]
Message-ID: <20150709065955.GC32698@gondor.apana.org.au> (raw)
In-Reply-To: <20150709064150.GA4028@Red>

On Thu, Jul 09, 2015 at 08:41:50AM +0200, LABBE Corentin wrote:
>
> > > +	/* get the partial hash only if something was written */
> > > +	if (op->mode == SS_OP_SHA1) {
> > > +		for (i = 0; i < 5; i++)
> > > +			op->hash[i] = readl(ss->base + SS_MD0 + i * 4);
> > > +	} else {
> > > +		for (i = 0; i < 4; i++)
> > > +			op->hash[i] = readl(ss->base + SS_MD0 + i * 4);
> > > +	}
> > 
> > You can avoid the op->mode check by storing the hash size in algt.
> > 
> 
> It seems that I can use crypto_ahash_digestsize() that do the same thing.

I don't think so because the partial hash size is not the same
as the final digest size.

> > > +int sun4i_hash_finup(struct ahash_request *areq)
> > > +{
> > > +	int err;
> > > +
> > > +	err = sun4i_hash_update(areq);
> > > +	if (err != 0)
> > > +		return err;
> > > +
> > > +	return sun4i_hash_final(areq);
> > 
> > You can drop finup since the API provides a default finup that's
> > exactly the same as this.  You only need to provide finup if it
> > can optimise on this.
> > 
> > Ditto for digest.
> 
> If I remove digest(), loading the driver crash the kernel with:

You're right.  We don't provide a default digest function for ahash,
we only do it for shash.  So I guess you'll have to keep digest
around for now.

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:[~2015-07-09  7:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 19:10 [PATCH v10] " LABBE Corentin
2015-07-06 19:10 ` [PATCH v10 1/5] ARM: sun4i: dt: Add Security System to A10 SoC DTS LABBE Corentin
2015-07-06 19:10 ` [PATCH v10 2/5] ARM: sun7i: dt: Add Security System to A20 " LABBE Corentin
2015-07-06 19:10 ` [PATCH v10 3/5] ARM: sun4i: dt: Add DT bindings documentation for SUN4I Security System LABBE Corentin
2015-07-06 19:10 ` [PATCH v10 4/5] crypto: Add Allwinner Security System crypto accelerator LABBE Corentin
2015-07-07 13:49   ` Herbert Xu
2015-07-09  6:41     ` [linux-sunxi] " LABBE Corentin
2015-07-09  6:59       ` Herbert Xu [this message]
2015-07-07 14:01   ` Maxime Ripard
2015-07-06 19:10 ` [PATCH v10 5/5] MAINTAINERS: Add myself as maintainer of Allwinner Security System LABBE Corentin

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=20150709065955.GC32698@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=clabbe.montjoie@gmail.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=joe@perches.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=mchehab@osg.samsung.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@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

all inboxes | Powered by JetHome®