| 144 | |
| 145 | |
| 146 | void sha1_process_rar29(sha1_context *context, const unsigned char *data, size_t len) |
| 147 | { |
| 148 | size_t i, j = (size_t)(context->count & 63); |
| 149 | context->count += len; |
| 150 | |
| 151 | if ((j + len) > 63) |
| 152 | { |
| 153 | memcpy(context->buffer+j, data, (i = 64-j)); |
| 154 | uint32 workspace[16]; |
| 155 | SHA1Transform(context->state, workspace, context->buffer, true); |
| 156 | for ( ; i + 63 < len; i += 64) |
| 157 | { |
| 158 | SHA1Transform(context->state, workspace, data+i, false); |
| 159 | for (uint k = 0; k < 16; k++) |
| 160 | RawPut4(workspace[k],(void*)(data+i+k*4)); |
| 161 | } |
| 162 | j = 0; |
| 163 | } |
| 164 | else |
| 165 | i = 0; |
| 166 | if (len > i) |
| 167 | memcpy(context->buffer+j, data+i, len - i); |
| 168 | } |
| 169 | |
| 170 | |
| 171 | /* Add padding and return the message digest. */ |
no test coverage detected