linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: LABBE Corentin <montjoie.mailing@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: LABBE Corentin <clabbe.montjoie@gmail.com>,
	davem@davemloft.net, thomas.lendacky@amd.com,
	geert+renesas@glider.be, ulf.hansson@linaro.org,
	wsa@the-dreams.de, keescook@chromium.org,
	maxime.ripard@free-electrons.com, linux-kernel@vger.kernel.org,
	linux-crypto@vger.kernel.org
Subject: Re: [PATCH 1/8] crypto: hash: add zero length message hash for shax and md5
Date: Thu, 15 Oct 2015 11:42:04 +0200	[thread overview]
Message-ID: <20151015094204.GA6305@Red> (raw)
In-Reply-To: <20151014100802.GA15884@gondor.apana.org.au>

On Wed, Oct 14, 2015 at 06:08:02PM +0800, Herbert Xu wrote:
> On Mon, Oct 12, 2015 at 06:53:39PM +0200, LABBE Corentin wrote:
> > Some crypto drivers cannot process empty data message and return a
> > precalculated hash for md5/sha1/sha224/sha256.
> > 
> > This patch add thoses precalculated hash in include/crypto.
> > 
> > Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
> > ---
> >  include/crypto/md5.h |  5 +++++
> >  include/crypto/sha.h | 20 ++++++++++++++++++++
> >  2 files changed, 25 insertions(+)
> > 
> > diff --git a/include/crypto/md5.h b/include/crypto/md5.h
> > index 146af82..6496ee0 100644
> > --- a/include/crypto/md5.h
> > +++ b/include/crypto/md5.h
> > @@ -13,6 +13,11 @@
> >  #define MD5_H2	0x98badcfeUL
> >  #define MD5_H3	0x10325476UL
> >  
> > +static const u8 md5_zero_message_hash[MD5_DIGEST_SIZE] = {
> > +	0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04,
> > +	0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e,
> > +};
> > +
> 
> This potentially creates this structure in every file that includes
> md5.h.  How about putting it into md5_generic and exporting it?
> 

md5_generic does not exists, do you mean md5.c ?
I have made some try with EXPORT_SYMBOL() but without success.
Do you have any example of how to do that ?

Regards

  reply	other threads:[~2015-10-15  9:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12 16:53 [PATCH] crypto: add precalculated hash for zero message length LABBE Corentin
2015-10-12 16:53 ` [PATCH 1/8] crypto: hash: add zero length message hash for shax and md5 LABBE Corentin
2015-10-14 10:08   ` Herbert Xu
2015-10-15  9:42     ` LABBE Corentin [this message]
2015-10-16 11:26       ` Ulf Hansson
2015-10-12 16:53 ` [PATCH 2/8] crypto: niagara: Use precalculated hash from headers LABBE Corentin
2015-10-12 16:53 ` [PATCH 3/8] crypto: ccp: " LABBE Corentin
2015-10-12 21:16   ` Tom Lendacky
2015-10-12 16:53 ` [PATCH 4/8] crypto: ux500: " LABBE Corentin
2015-10-12 16:53 ` [PATCH 5/8] crypto: akcipher: fix typos in include/crypto/akcipher.h LABBE Corentin
2015-10-12 16:53 ` [PATCH 6/8] crypto: akcipher: the key parameter must be const u8 * LABBE Corentin
2015-10-12 16:53 ` [PATCH 7/8] crypto: testmgr: Constify tested key/iv/plaintext/digest LABBE Corentin
2015-10-12 16:53 ` [PATCH 8/8] crypto: testmgr: Use the xxx_zero_message_hash from headers LABBE Corentin
2015-10-12 19:24   ` kbuild test robot
2015-10-12 19:31     ` Corentin LABBE
  -- strict thread matches above, loose matches on Subject: below --
2015-10-20  7:33 [PATCH v2] crypto: add precalculated hash for zero message length LABBE Corentin
2015-10-20  7:33 ` [PATCH 1/8] crypto: hash: add zero length message hash for shax and md5 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=20151015094204.GA6305@Red \
    --to=montjoie.mailing@gmail.com \
    --cc=clabbe.montjoie@gmail.com \
    --cc=davem@davemloft.net \
    --cc=geert+renesas@glider.be \
    --cc=herbert@gondor.apana.org.au \
    --cc=keescook@chromium.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=thomas.lendacky@amd.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wsa@the-dreams.de \
    /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).