[U-Boot] [PATCH 09/17] Add sha256 command for hashing

Simon Glass sjg at chromium.org
Thu Nov 22 15:48:44 CET 2012


Hi Wolfgang,

On Sat, Nov 3, 2012 at 8:23 AM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Simon Glass,
>
> In message <1351902453-27956-10-git-send-email-sjg at chromium.org> you wrote:
>> From: ARUN MANKUZHI <arun.m at samsung.com>
>>
>> sha256 command is added which can be used to test SHA 256 hash
>> algorithm.
>>
>> Signed-off-by: ARUN MANKUZHI <arun.m at samsung.com>
>> Signed-off-by: Simon Glass <sjg at chromium.org>
>> ---
>>  README                   |    1 +
>>  common/Makefile          |    1 +
>>  common/cmd_sha256.c      |   57 ++++++++++++++++++++++++++++++++++++++++++++++
>>  include/config_cmd_all.h |    1 +
>>  4 files changed, 60 insertions(+), 0 deletions(-)
>>  create mode 100644 common/cmd_sha256.c
>
> Please make sure interface and functionality is similar to what we do
> elsewhere, i. e. with the crc32 command.

OK I didn't notice some new patches in SHA1 also, which provide an
enhanced command similar to crc32. It's isn't really sensible to
duplicate that code. Thanks for pointing that out.

I think we should come up with some sort of generic hashing command
which can deal with multiple algorithms. Then SHA1 and SHA256 at least
can share the same basic parsing / verification code. I will take a
look at this, and put it in a new version of this series.

>
>> +U_BOOT_CMD(
>> +     sha256, 4, 1, do_sha256,
>> +     "print hash result",
>> +     "<input> <inputlength> <output>"
>> +);
>
> What is "<input>" or "<output>" supposed to mean?  I don;t understand
> this.
>
> "<output>" should not be mandatory. I would appreciate if we
> could use similar help text as with the crc32 command:
>
>         crc32 - checksum calculation
>
>         Usage:
>         crc32 address count [addr]
>             - compute CRC32 checksum [save at addr]
>
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> "Love is an ideal thing, marriage a real thing; a  confusion  of  the
> real with the ideal never goes unpunished."                  - Goethe

Regards,
Simon


More information about the U-Boot mailing list