U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] SHA1 Hash calculation
@ 2005-11-23  7:32 Tom Saarnio
  2005-11-23  7:56 ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Saarnio @ 2005-11-23  7:32 UTC (permalink / raw)
  To: u-boot

Hi!

I am wondering whether it would be worth to implement a SHA1 hash 
calculation over given memory address range. In this way one could 
assure for example that the binary image version is correct or that 
binary image is intact.

For those who are not familiar waith SHA1 (or 
other hash algorithms), the SHA1 algorithm computes a 160 bit 
"fingerprint" of given byte stream. The algorithm is designed so that 
collisions between any given byte stream is "unlikely" as it is very 
unlikely that two persons have identical fingerprints or dna.

Wikipedia:
http://en.wikipedia.org/wiki/SHA-1

Source code:
http://www.
cr0.net:8040/code/crypto/sha1/

Any comments?

br,

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] SHA1 Hash calculation
  2005-11-23  7:32 [U-Boot-Users] SHA1 Hash calculation Tom Saarnio
@ 2005-11-23  7:56 ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2005-11-23  7:56 UTC (permalink / raw)
  To: u-boot

In message <19732218.1132731152180.JavaMail.root@eni-cpps05.sth.basefarm.net> you wrote:
> 
> I am wondering whether it would be worth to implement a SHA1 hash 
> calculation over given memory address range. In this way one could 
> assure for example that the binary image version is correct or that 
> binary image is intact.

Is the existing CRC32 checksum not good enough for your purposes?

> Any comments?

Use the existing CRC command instead.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Anyone who knows history, particularly the history of Europe, will, I
think, recognize that the domination of education or of government by
any one particular religious faith is never a happy  arrangement  for
the people.                                       - Eleanor Roosevelt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] SHA1 Hash calculation
@ 2005-11-23  8:22 Tom Saarnio
  2005-11-23  9:11 ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Saarnio @ 2005-11-23  8:22 UTC (permalink / raw)
  To: u-boot

>> 
>> I am wondering whether it would be worth to implement a SHA1 
hash 
>> calculation over given memory address range. In this way one 
could 
>> assure for example that the binary image version is correct 
or that 
>> binary image is intact.
>
>Is the existing CRC32 checksum 
not good enough for your purposes?

The CRC32 is not collision-proof in 
similar fashion that SHA1. In real life, if two binary images give the 
same SHA1 checksum, you can say that these binaries are identical. With 
CRC32 this is not so - or at least I would not count on that :-)

br,

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] SHA1 Hash calculation
  2005-11-23  8:22 Tom Saarnio
@ 2005-11-23  9:11 ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2005-11-23  9:11 UTC (permalink / raw)
  To: u-boot

In message <31192263.1132734126001.JavaMail.root@eni-cpps05.sth.basefarm.net> you wrote:
>
> The CRC32 is not collision-proof in 
> similar fashion that SHA1. In real life, if two binary images give the 
> same SHA1 checksum, you can say that these binaries are identical. With 
> CRC32 this is not so - or at least I would not count on that :-)

Well, normally you have additional information like the U-Boot  image
header, version id, etc.

But feel free to implement sha1 support - if  it  can  be  configured
cleanly away then it's fine...

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Wagner's music is better than it sounds."               - Mark Twain

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-11-23  9:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-23  7:32 [U-Boot-Users] SHA1 Hash calculation Tom Saarnio
2005-11-23  7:56 ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2005-11-23  8:22 Tom Saarnio
2005-11-23  9:11 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox