[Ffmpeg-cvslog] r8381 - trunk/libavutil/sha1.c

michael subversion
Tue Mar 13 12:25:57 CET 2007


Author: michael
Date: Tue Mar 13 12:25:57 2007
New Revision: 8381

Modified:
   trunk/libavutil/sha1.c

Log:
smaller av_sha1_update()


Modified: trunk/libavutil/sha1.c
==============================================================================
--- trunk/libavutil/sha1.c	(original)
+++ trunk/libavutil/sha1.c	Tue Mar 13 12:25:57 2007
@@ -90,6 +90,15 @@ void av_sha1_update(AVSHA1* context, uin
 
     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 @@ void av_sha1_update(AVSHA1* context, uin
     }
     else i = 0;
     memcpy(&context->buffer[j], &data[i], len - i);
+#endif
 }
 
 void av_sha1_final(AVSHA1* context, uint8_t digest[20]){




More information about the ffmpeg-cvslog mailing list