Mercurial > libavutil.hg
diff sha1.c @ 311:999cbf01173a libavutil
smaller av_sha1_update()
author | michael |
---|---|
date | Tue, 13 Mar 2007 11:25:57 +0000 |
parents | 9a876d28d480 |
children | ef246cda0613 |
line wrap: on
line diff
--- a/sha1.c Tue Mar 13 10:53:15 2007 +0000 +++ b/sha1.c Tue Mar 13 11:25:57 2007 +0000 @@ -90,6 +90,15 @@ j = context->count & 63; context->count += len; +#ifdef CONFIG_SMALL + for( i = 0; i < len; i++ ){ + context->buffer[ j++ ] = data[i]; + if( 64 == j ){ + transform(context->state, context->buffer); + j = 0; + } + } +#else if ((j + len) > 63) { memcpy(&context->buffer[j], data, (i = 64-j)); transform(context->state, context->buffer); @@ -100,6 +109,7 @@ } else i = 0; memcpy(&context->buffer[j], &data[i], len - i); +#endif } void av_sha1_final(AVSHA1* context, uint8_t digest[20]){