diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-03-13 11:25:57 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-03-13 11:25:57 +0000 |
commit | 36c7fa7ea541b370566a03f2801b8747dafd917a (patch) | |
tree | b5e2502c97ea653e7e0536751bd0619de0fe8778 /libavutil | |
parent | 104c30ee061d0c60a87591c4784a82d40a35ab2d (diff) | |
download | ffmpeg-streaming-36c7fa7ea541b370566a03f2801b8747dafd917a.zip ffmpeg-streaming-36c7fa7ea541b370566a03f2801b8747dafd917a.tar.gz |
smaller av_sha1_update()
Originally committed as revision 8381 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/sha1.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavutil/sha1.c b/libavutil/sha1.c index 43b6361..8d29657 100644 --- a/libavutil/sha1.c +++ b/libavutil/sha1.c @@ -90,6 +90,15 @@ void av_sha1_update(AVSHA1* context, uint8_t* data, unsigned int len){ 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, uint8_t* data, unsigned int len){ } else i = 0; memcpy(&context->buffer[j], &data[i], len - i); +#endif } void av_sha1_final(AVSHA1* context, uint8_t digest[20]){ |