[FFmpeg-devel] [PATCH] SHA-256 support

Kostya kostya.shishkov
Wed Jun 10 17:11:49 CEST 2009


On Wed, Jun 10, 2009 at 11:56:37AM +0200, Michael Niedermayer wrote:
> On Wed, Jun 10, 2009 at 08:35:39AM +0300, Kostya wrote:
> > On Tue, Jun 09, 2009 at 09:16:10PM +0200, Michael Niedermayer wrote:
> > > On Tue, Jun 09, 2009 at 09:32:24PM +0300, Kostya wrote:
> > > > On Tue, Jun 09, 2009 at 04:47:09PM +0200, Michael Niedermayer wrote:
> > > > > On Tue, Jun 09, 2009 at 08:13:40AM +0300, Kostya wrote:
> > > > [...]
> > > > > > /* Hash a single 512-bit block. This is the core of the algorithm. */
> > > > > > 
> > > > > > static void transform(uint32_t state[5], const uint8_t buffer[64])
> > > > > 
> > > > > doxy?
> > > >  
> > > > no
> > > 
> > > make it a yes please
> >  
> > you know, in this phrase punctiation can radically alter its meaning
> 
> please read and follow the patch checklist, developer guide/policy as well
> as running our never tired patcheck script over your patches.
> Also please document functions and fields in a doxygen compatible way.
 
I did
BTW, looks like your patcheck behaviour is rather strange on non-GNU
systems. At least running it on my MacOS X results in strange hangups
and grep errors.
 
> [...]
> > > [...]
> > > 
> > > > static void transform(uint32_t state[5], const uint8_t buffer[64])
> > > > {
> > > >     unsigned int i, a, b, c, d, e, f, g, h;
> > > >     uint32_t block[16];
> > > >     uint32_t T1, T2;
> > > > 
> > > >     a = state[0];
> > > >     b = state[1];
> > > >     c = state[2];
> > > >     d = state[3];
> > > >     e = state[4];
> > > >     f = state[5];
> > > >     g = state[6];
> > > >     h = state[7];
> > > > #if CONFIG_SMALL
> > > >     for (i = 0; i < 64; i++) {
> > > >         if (i < 16) {
> > > >             T1 = block[i] = be2me_32(((const uint32_t*)buffer)[i]);
> > > >         } else {
> > > >             block[i & 0xF] +=            block[(i +  9) & 0xF]
> > > >                             + sigma0_256(block[(i +  1) & 0xF])
> > > >                             + sigma1_256(block[(i + 14) & 0xF]);
> > > >             T1 = block[i & 0xF];
> > > 
> > > now you removed the other part of the optimization
> > > please restore the size of the block array and get rid of the & 0xF
> > 
> > Not removed.
> > The code I used (http://www.aarongifford.com/computers/sha2-1.0.tar.gz)
> > does not have such kind of optimization, so I have to add it myself.
> > Done though.
> 
> whatever, your code still contains the & 0xF
> also theres trailing whitespace in there

got rid of both
 
> great devel + sloppy + lazy == kostya

I agree only to the parts after first plus sign.

> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sha2.patch
Type: text/x-diff
Size: 12546 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090610/5fdef124/attachment.patch>



More information about the ffmpeg-devel mailing list