comparison md5.c @ 46:a559b4f0754b libavutil

cast pointers to make compiler happy remove test define
author ivo
date Sun, 02 Jul 2006 19:00:15 +0000
parents 31c84858af22
children 1a9c62b337e4
comparison
equal deleted inserted replaced
45:31c84858af22 46:a559b4f0754b
114 ctx->len += len; 114 ctx->len += len;
115 115
116 for( i = 0; i < len; i++ ){ 116 for( i = 0; i < len; i++ ){
117 ctx->block[ ctx->b_used++ ] = src[i]; 117 ctx->block[ ctx->b_used++ ] = src[i];
118 if( 64 == ctx->b_used ){ 118 if( 64 == ctx->b_used ){
119 body(ctx->ABCD, ctx->block); 119 body(ctx->ABCD, (const uint32_t*) ctx->block);
120 ctx->b_used = 0; 120 ctx->b_used = 0;
121 } 121 }
122 } 122 }
123 } 123 }
124 124
128 ctx->block[ctx->b_used++] = 0x80; 128 ctx->block[ctx->b_used++] = 0x80;
129 129
130 memset(&ctx->block[ctx->b_used], 0, 64 - ctx->b_used); 130 memset(&ctx->block[ctx->b_used], 0, 64 - ctx->b_used);
131 131
132 if( 56 < ctx->b_used ){ 132 if( 56 < ctx->b_used ){
133 body( ctx->ABCD, ctx->block ); 133 body( ctx->ABCD, (const uint32_t*) ctx->block );
134 memset(ctx->block, 0, 64); 134 memset(ctx->block, 0, 64);
135 } 135 }
136 136
137 for(i=0; i<8; i++) 137 for(i=0; i<8; i++)
138 ctx->block[56+i] = (ctx->len << 3) >> (i<<3); 138 ctx->block[56+i] = (ctx->len << 3) >> (i<<3);
139 139
140 body(ctx->ABCD, ctx->block); 140 body(ctx->ABCD, (const uint32_t*) ctx->block);
141 141
142 #define le2me_32(a) a
143 for(i=0; i<4; i++) 142 for(i=0; i<4; i++)
144 ((uint32_t*)dst)[i]= le2me_32(ctx->ABCD[3-i]); 143 ((uint32_t*)dst)[i]= le2me_32(ctx->ABCD[3-i]);
145 } 144 }
146 145
147 void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len){ 146 void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len){