Lines Matching defs:mctx
160 static void md4_init(struct md4_ctx *mctx)
162 mctx->hash[0] = 0x67452301;
163 mctx->hash[1] = 0xefcdab89;
164 mctx->hash[2] = 0x98badcfe;
165 mctx->hash[3] = 0x10325476;
166 mctx->byte_count = 0;
169 static void md4_update(struct md4_ctx *mctx,
172 const uint32_t avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f);
174 mctx->byte_count += len;
177 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail),
182 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail),
185 md4_transform_helper(mctx);
189 while (len >= sizeof(mctx->block)) {
190 memcpy(mctx->block, data, sizeof(mctx->block));
191 md4_transform_helper(mctx);
192 data += sizeof(mctx->block);
193 len -= sizeof(mctx->block);
196 memcpy(mctx->block, data, len);
199 static void md4_final_ascii(struct md4_ctx *mctx, char *out, unsigned int len)
201 const unsigned int offset = mctx->byte_count & 0x3f;
202 char *p = (char *)mctx->block + offset;
208 md4_transform_helper(mctx);
209 p = (char *)mctx->block;
214 mctx->block[14] = mctx->byte_count << 3;
215 mctx->block[15] = mctx->byte_count >> 29;
216 le32_to_cpu_array(mctx->block, (sizeof(mctx->block) -
218 md4_transform(mctx->hash, mctx->block);
219 cpu_to_le32_array(mctx->hash, ARRAY_SIZE(mctx->hash));
222 mctx->hash[0], mctx->hash[1], mctx->hash[2], mctx->hash[3]);