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