mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 0/9 v3] digest: allow multiple implementation of digest
Date: Tue, 31 Mar 2015 18:44:28 +0300	[thread overview]
Message-ID: <20150331184428.cf4d380d942268a64a0fc0e4@gmail.com> (raw)
In-Reply-To: <20150325115140.GD8125@ns203013.ovh.net>

On Wed, 25 Mar 2015 12:51:40 +0100
Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> wrote:

Hmmm.

This new digest implementation have some Kconfig inconsistency.

E.g. I can configure barebox like this:

  CONFIG_CMD_SHA1SUM=y
  ...
  CONFIG_SHA1=y
  # CONFIG_DIGEST_MD5_GENERIC is not set
  # CONFIG_DIGEST_SHA1_GENERIC is not set
  # CONFIG_DIGEST_SHA224_GENERIC is not set
  # CONFIG_DIGEST_SHA256_GENERIC is not set
  # CONFIG_DIGEST_SHA384_GENERIC is not set
  # CONFIG_DIGEST_SHA512_GENERIC is not set
  # CONFIG_DIGEST_HMAC_GENERIC is not set

And here is BUG log for this configuration:

  barebox:/ sha1sum foobar
  BUG: failure at commands/hashsum.c:61/do_hash()!
  BUG!
  no stack data available

Could we tune Kconfig somehow (e.g. add addition dependencies) to prevent situations like this?


> Hi,
> 
> 	The following serie allow you to have multiple driver for
> 	the digest.
> 
> 	This also switch the sha1 implementation to the kernel one and
> 	add the armv4 asm implementtion that save nearly 6KiB in a zbarebox
> 	lzo.
> 
> 
> v2:
> 	switch sha256 and sha512 to linux implementation
> 	add arm sha256 asm implementation
> 
> v3:
> 	Fix sha256 for armv4 in a better way as discussed on ARM ML
> 	Only register the generic hmac one time per sha algo, as we will
> 	use the best sha algo at runtime
> 
> The following changes since commit 52d4a0321405b7525422f04fffbe7f318c9c5a88:
> 
>   Merge branch 'for-next/state' into next (2015-03-19 07:55:59 +0100)
> 
> are available in the git repository at:
> 
>   git://git.jcrosoft.org/barebox.git delivery/sha1
> 
> for you to fetch changes up to 141ffeabaf852f6c11c7aad9c18b1e017578b56a:
> 
>   arm: crypto: add sha256 assembly support (2015-03-25 19:50:36 +0800)
> 
> ----------------------------------------------------------------
> Jean-Christophe PLAGNIOL-VILLARD (9):
>       command: digest/hashsum: set key command level
>       digest: allow algo to specify their length at runtime
>       crypto: prepare to allow multiple digest driver
>       crypto: hmac: move register to hmac
>       crypto: sha1: switch to linux implementation
>       crypto: sha256: switch to linux implementation
>       crypto: sha512: switch to linux implementation
>       arm: crypto: add sha1 assembly support
>       arm: crypto: add sha256 assembly support
> 
>  arch/arm/Makefile                               |    1 +
>  arch/arm/configs/at91rm9200ek_defconfig         |    4 +-
>  arch/arm/configs/highbank_defconfig             |    4 +-
>  arch/arm/configs/mioa701_defconfig              |    2 +-
>  arch/arm/configs/module-mb7707_defconfig        |    4 +-
>  arch/arm/configs/nhk8815_defconfig              |    2 +-
>  arch/arm/configs/phytec-phycard-omap3_defconfig |    6 +-
>  arch/arm/configs/rpi_defconfig                  |    4 +-
>  arch/arm/configs/versatilepb_arm1176_defconfig  |    4 +-
>  arch/arm/configs/versatilepb_defconfig          |    4 +-
>  arch/arm/configs/vexpress_ca9_defconfig         |    4 +-
>  arch/arm/configs/vexpress_defconfig             |    4 +-
>  arch/arm/configs/virt2real_defconfig            |    4 +-
>  arch/arm/configs/zylonite310_defconfig          |    2 +-
>  arch/arm/crypto/Makefile                        |   17 +
>  arch/arm/crypto/sha1-armv4-large.S              |  497 +++++++++++++++++++++++++++++
>  arch/arm/crypto/sha1_glue.c                     |  137 ++++++++
>  arch/arm/crypto/sha256-armv4.pl                 |  717 ++++++++++++++++++++++++++++++++++++++++++
>  arch/arm/crypto/sha256-core.S_shipped           | 2779 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  arch/arm/crypto/sha256_glue.c                   |  213 +++++++++++++
>  arch/arm/crypto/sha256_glue.h                   |   23 ++
>  arch/mips/configs/img-ci20_defconfig            |    6 +-
>  arch/mips/configs/ritmix-rzx50_defconfig        |    6 +-
>  arch/mips/configs/tplink-mr3020_defconfig       |    4 +-
>  commands/digest.c                               |   27 +-
>  commands/hashsum.c                              |   10 +-
>  commands/internal.h                             |    3 +-
>  crypto/Kconfig                                  |   57 +++-
>  crypto/Makefile                                 |   14 +-
>  crypto/digest.c                                 |   32 +-
>  crypto/hmac.c                                   |   58 +++-
>  crypto/md5.c                                    |   17 +-
>  crypto/sha1.c                                   |  539 +++++++++++++++-----------------
>  crypto/sha2.c                                   |  593 ++++++++++++++++++-----------------
>  crypto/sha4.c                                   |  495 +++++++++++++----------------
>  include/asm-generic/barebox.lds.h               |    3 +-
>  {crypto => include/crypto}/internal.h           |   10 -
>  include/crypto/sha.h                            |   95 ++++++
>  include/digest.h                                |   20 +-
>  include/init.h                                  |    3 +-
>  40 files changed, 5446 insertions(+), 978 deletions(-)
>  create mode 100644 arch/arm/crypto/Makefile
>  create mode 100644 arch/arm/crypto/sha1-armv4-large.S
>  create mode 100644 arch/arm/crypto/sha1_glue.c
>  create mode 100644 arch/arm/crypto/sha256-armv4.pl
>  create mode 100644 arch/arm/crypto/sha256-core.S_shipped
>  create mode 100644 arch/arm/crypto/sha256_glue.c
>  create mode 100644 arch/arm/crypto/sha256_glue.h
>  rename {crypto => include/crypto}/internal.h (53%)
>  create mode 100644 include/crypto/sha.h
> 
> Best Regards,
> J.
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox


-- 
-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2015-03-31 15:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-25 11:51 Jean-Christophe PLAGNIOL-VILLARD
2015-03-25 11:56 ` [PATCH 1/9] command: digest/hashsum: set key command level Jean-Christophe PLAGNIOL-VILLARD
2015-03-25 11:56   ` [PATCH 2/9] digest: allow algo to specify their length at runtime Jean-Christophe PLAGNIOL-VILLARD
2015-03-25 11:56   ` [PATCH 3/9] crypto: prepare to allow multiple digest driver Jean-Christophe PLAGNIOL-VILLARD
2015-03-25 11:56   ` [PATCH 4/9] crypto: hmac: move register to hmac Jean-Christophe PLAGNIOL-VILLARD
2015-06-15 14:27     ` Marc Kleine-Budde
2015-03-25 11:56   ` [PATCH 5/9] crypto: sha1: switch to linux implementation Jean-Christophe PLAGNIOL-VILLARD
2015-03-25 11:56   ` [PATCH 6/9] crypto: sha256: " Jean-Christophe PLAGNIOL-VILLARD
2015-03-25 11:56   ` [PATCH 7/9] crypto: sha512: " Jean-Christophe PLAGNIOL-VILLARD
2015-03-25 11:56   ` [PATCH 8/9] arm: crypto: add sha1 assembly support Jean-Christophe PLAGNIOL-VILLARD
2015-03-25 11:56   ` [PATCH 9/9] arm: crypto: add sha256 " Jean-Christophe PLAGNIOL-VILLARD
2015-03-26  6:46 ` [PATCH 0/9 v3] digest: allow multiple implementation of digest Sascha Hauer
2015-03-31 15:44 ` Antony Pavlov [this message]
2015-03-31 17:33   ` Jean-Christophe PLAGNIOL-VILLARD

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=20150331184428.cf4d380d942268a64a0fc0e4@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.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