MCPcopy Create free account
hub / github.com/F-Stack/f-stack / SHA1Update

Function SHA1Update

app/redis-6.2.6/src/sha1.c:131–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129/* Run your data through this. */
130
131void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32_t len)
132{
133 uint32_t i, j;
134
135 j = context->count[0];
136 if ((context->count[0] += len << 3) < j)
137 context->count[1]++;
138 context->count[1] += (len>>29);
139 j = (j >> 3) & 63;
140 if ((j + len) > 63) {
141 memcpy(&context->buffer[j], data, (i = 64-j));
142 SHA1Transform(context->state, context->buffer);
143 for ( ; i + 63 < len; i += 64) {
144 SHA1Transform(context->state, &data[i]);
145 }
146 j = 0;
147 }
148 else i = 0;
149 memcpy(&context->buffer[j], &data[i], len - i);
150}
151
152
153/* Add padding and return the message digest. */

Callers 6

sha1hexFunction · 0.70
xorDigestFunction · 0.70
mixDigestFunction · 0.70
SHA1FinalFunction · 0.70
sha1TestFunction · 0.70
sha1HashFunction · 0.50

Calls 2

SHA1TransformFunction · 0.70
memcpyFunction · 0.50

Tested by

no test coverage detected