MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / sha1_process

Function sha1_process

Libraries/unrar/sha1.cpp:125–143  ·  view source on GitHub ↗

Run your data through this. */

Source from the content-addressed store, hash-verified

123
124/* Run your data through this. */
125void sha1_process( sha1_context * context, const unsigned char * data, size_t len)
126{
127 size_t i, j = (size_t)(context->count & 63);
128 context->count += len;
129
130 if ((j + len) > 63)
131 {
132 memcpy(context->buffer+j, data, (i = 64-j));
133 uint32 workspace[16];
134 SHA1Transform(context->state, workspace, context->buffer, true);
135 for ( ; i + 63 < len; i += 64)
136 SHA1Transform(context->state, workspace, data+i, false);
137 j = 0;
138 }
139 else
140 i = 0;
141 if (len > i)
142 memcpy(context->buffer+j, data+i, len - i);
143}
144
145
146void sha1_process_rar29(sha1_context *context, const unsigned char *data, size_t len)

Callers 1

SetKey30Method · 0.85

Calls 1

SHA1TransformFunction · 0.85

Tested by

no test coverage detected