lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150709065955.GC32698@gondor.apana.org.au>
Date:	Thu, 9 Jul 2015 14:59:56 +0800
From:	Herbert Xu <herbert@...dor.apana.org.au>
To:	LABBE Corentin <clabbe.montjoie@...il.com>
Cc:	robh+dt@...nel.org, pawel.moll@....com, mark.rutland@....com,
	ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
	maxime.ripard@...e-electrons.com, linux@....linux.org.uk,
	davem@...emloft.net, akpm@...ux-foundation.org,
	gregkh@...uxfoundation.org, mchehab@....samsung.com, arnd@...db.de,
	joe@...ches.com, devicetree@...r.kernel.org,
	linux-doc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org,
	linux-sunxi@...glegroups.com
Subject: Re: [linux-sunxi] Re: [PATCH v10 4/5] crypto: Add Allwinner Security
 System crypto accelerator

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@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ