[FFmpeg-devel] [PATCH] Add SHA-2

Michael Niedermayer michaelni
Wed Jul 15 16:02:44 CEST 2009


On Wed, Jul 15, 2009 at 12:04:50PM +0300, Kostya wrote:
> On Tue, Jul 14, 2009 at 12:34:45PM +0200, Michael Niedermayer wrote:
> > On Sun, Jul 12, 2009 at 08:23:29AM +0300, Kostya wrote:
> > > On Sat, Jul 11, 2009 at 09:13:40PM +0200, Michael Niedermayer wrote:
> [...] 
> > > > > +#define Ch(x,y,z)   (((x) & (y)) ^ ((~(x)) & (z)))
> > > > > +#define Maj(x,y,z)  (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
> > > > 
> > > > you duplicate optimized code with optimizations removed
> > > 
> > > huh?
> > 
> > (w&(x^y))^y
> 
> Oh, fixed.
[...]

>  int av_sha_init(AVSHA* ctx, int bits)
>  {
> -    ctx->state[0] = 0x67452301;
> -    ctx->state[1] = 0xEFCDAB89;
> -    ctx->state[2] = 0x98BADCFE;
> -    ctx->state[3] = 0x10325476;
> -    ctx->state[4] = 0xC3D2E1F0;
> -    ctx->transform = sha1_transform;
> -    ctx->count    = 0;
[...]
> +        ctx->state[0] = 0x67452301;
> +        ctx->state[1] = 0xEFCDAB89;
> +        ctx->state[2] = 0x98BADCFE;
> +        ctx->state[3] = 0x10325476;
> +        ctx->state[4] = 0xC3D2E1F0;
> +        ctx->transform = sha1_transform;

cosmetics

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090715/77201b1d/attachment.pgp>



More information about the ffmpeg-devel mailing list