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

Function MD5Pad

freebsd/kern/md5c.c:196–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194 */
195
196static void
197MD5Pad (MD5_CTX *context)
198{
199 unsigned char bits[8];
200 unsigned int index, padLen;
201
202 /* Save number of bits */
203 Encode (bits, context->count, 8);
204
205 /* Pad out to 56 mod 64. */
206 index = (unsigned int)((context->count[0] >> 3) & 0x3f);
207 padLen = (index < 56) ? (56 - index) : (120 - index);
208 MD5Update (context, PADDING, padLen);
209
210 /* Append length (before padding) */
211 MD5Update (context, bits, 8);
212}
213
214/*
215 * MD5 finalization. Ends an MD5 message-digest operation, writing the

Callers 1

MD5FinalFunction · 0.85

Calls 2

MD5UpdateFunction · 0.85
EncodeFunction · 0.70

Tested by

no test coverage detected