Lines Matching defs:pCtx

214 RTDECL(void) RTMd5Init(PRTMD5CONTEXT pCtx)
216 pCtx->AltPrivate.buf[0] = 0x67452301;
217 pCtx->AltPrivate.buf[1] = 0xefcdab89;
218 pCtx->AltPrivate.buf[2] = 0x98badcfe;
219 pCtx->AltPrivate.buf[3] = 0x10325476;
221 pCtx->AltPrivate.bits[0] = 0;
222 pCtx->AltPrivate.bits[1] = 0;
231 RTDECL(void) RTMd5Update(PRTMD5CONTEXT pCtx, const void *pvBuf, size_t len)
237 t = pCtx->AltPrivate.bits[0];
238 if ((pCtx->AltPrivate.bits[0] = t + ((uint32_t) len << 3)) < t)
239 pCtx->AltPrivate.bits[1]++; /* Carry from low to high */
240 pCtx->AltPrivate.bits[1] += (uint32_t)(len >> 29);
247 uint8_t *p = (uint8_t *) pCtx->AltPrivate.in + t;
256 rtMd5ByteReverse(pCtx->AltPrivate.in, 16);
257 rtMd5Transform(pCtx->AltPrivate.buf, pCtx->AltPrivate.in);
267 rtMd5Transform(pCtx->AltPrivate.buf, (uint32_t const *)buf);
276 memcpy(pCtx->AltPrivate.in, buf, 64);
277 rtMd5ByteReverse(pCtx->AltPrivate.in, 16);
278 rtMd5Transform(pCtx->AltPrivate.buf, pCtx->AltPrivate.in);
285 memcpy(pCtx->AltPrivate.in, buf, len);
294 RTDECL(void) RTMd5Final(uint8_t digest[16], PRTMD5CONTEXT pCtx)
300 count = (pCtx->AltPrivate.bits[0] >> 3) & 0x3F;
304 p = (uint8_t *)pCtx->AltPrivate.in + count;
315 rtMd5ByteReverse(pCtx->AltPrivate.in, 16);
316 rtMd5Transform(pCtx->AltPrivate.buf, pCtx->AltPrivate.in);
319 memset(pCtx->AltPrivate.in, 0, 56);
326 rtMd5ByteReverse(pCtx->AltPrivate.in, 14);
329 pCtx->AltPrivate.in[14] = pCtx->AltPrivate.bits[0];
330 pCtx->AltPrivate.in[15] = pCtx->AltPrivate.bits[1];
332 rtMd5Transform(pCtx->AltPrivate.buf, pCtx->AltPrivate.in);
333 rtMd5ByteReverse(pCtx->AltPrivate.buf, 4);
334 memcpy(digest, pCtx->AltPrivate.buf, 16);
335 memset(pCtx, 0, sizeof(*pCtx)); /* In case it's sensitive */
344 PRTMD5CONTEXT const pCtx = RT_ALIGN_PT(&Ctx[0], 64, PRTMD5CONTEXT);
347 PRTMD5CONTEXT const pCtx = &Ctx;
350 RTMd5Init(pCtx);
354 RTMd5Update(pCtx, pvBuf, cb);
360 RTMd5Final(pabDigest, pCtx);