public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <l.majewski@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] lib:crc32:hash: Allow setting of the initial crc32 value
Date: Thu, 08 May 2014 10:59:51 +0200	[thread overview]
Message-ID: <20140508105951.07cb74fb@amdc2363> (raw)
In-Reply-To: <CAPnjgZ0Qk=ZsjmQheZKw7ikmRYhLgwW51CR4pB5qufX15Ne_bA@mail.gmail.com>

Hi Simon,

> Hi Lukasz,
> 
> On 7 May 2014 06:57, Lukasz Majewski <l.majewski@samsung.com> wrote:
> >
> > The current approach set the initial value of crc32 calculation to
> > zero, which is correct for calculating checksum of the whole chunk
> > of data.
> >
> > It however, lacks the flexibility, when one wants to calculate
> > CRC32 of a file comprised of many smaller parts received separately.
> >
> > In the proposed approach the output value is used as a starting
> > condition for the proper crc32 calculation at crc32_wd function.
> > This behavior is identical to the one provided by crc32() method
> > implementation.
> >
> > Additionally comments were appropriately updated.
> 
> Maybe I am missing something, but this doesn't seem necessary. In
> hash.h we have
> 
> hash_init()
> hash_update()
> hash_finish()
> 
> which permits you to pass more data through a hash function. Doesn't
> this already do what you want?

I thought, that I would get away with replacing crc32() function call
with similar one - hash_block(). As it was pointed out it doesn't
itself provide the same functionality.

However, I will try to implement the solution you suggested. Thanks for
tip.


> 
> What is missing is probably command-line access to this API.
> Something like:
> 
> hash init <envvar>, <algo>
> hash update  <envvar>, <data>, <size>
> hash finish <envvar>, [*]<result>
> 
> or similar.
> 
> Regards,
> Simon


-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

      reply	other threads:[~2014-05-08  8:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-05 13:07 [U-Boot] [PATCH] lib:crc32: Allow setting of the initial crc32 value Lukasz Majewski
2014-05-05 17:47 ` Wolfgang Denk
2014-05-05 18:56   ` Marek Vasut
2014-05-06  5:54   ` Lukasz Majewski
2014-05-05 17:51 ` Marek Vasut
2014-05-07  6:10 ` [U-Boot] [PATCH v2] " Lukasz Majewski
2014-05-07  8:25   ` Marek Vasut
2014-05-07 10:17     ` Lukasz Majewski
2014-05-07 10:42   ` Wolfgang Denk
2014-05-07 12:25     ` Lukasz Majewski
2014-05-07 12:57 ` [U-Boot] [PATCH v3] lib:crc32:hash: " Lukasz Majewski
2014-05-07 23:04   ` Simon Glass
2014-05-08  8:59     ` Lukasz Majewski [this message]

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=20140508105951.07cb74fb@amdc2363 \
    --to=l.majewski@samsung.com \
    --cc=u-boot@lists.denx.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