Lines Matching refs:mctx
141 struct md4_ctx *mctx = shash_desc_ctx(desc); in md4_init() local
143 mctx->hash[0] = 0x67452301; in md4_init()
144 mctx->hash[1] = 0xefcdab89; in md4_init()
145 mctx->hash[2] = 0x98badcfe; in md4_init()
146 mctx->hash[3] = 0x10325476; in md4_init()
147 mctx->byte_count = 0; in md4_init()
154 struct md4_ctx *mctx = shash_desc_ctx(desc); in md4_update() local
155 const u32 avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f); in md4_update()
157 mctx->byte_count += len; in md4_update()
160 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), in md4_update()
165 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), in md4_update()
168 md4_transform_helper(mctx); in md4_update()
172 while (len >= sizeof(mctx->block)) { in md4_update()
173 memcpy(mctx->block, data, sizeof(mctx->block)); in md4_update()
174 md4_transform_helper(mctx); in md4_update()
175 data += sizeof(mctx->block); in md4_update()
176 len -= sizeof(mctx->block); in md4_update()
179 memcpy(mctx->block, data, len); in md4_update()
186 struct md4_ctx *mctx = shash_desc_ctx(desc); in md4_final() local
187 const unsigned int offset = mctx->byte_count & 0x3f; in md4_final()
188 char *p = (char *)mctx->block + offset; in md4_final()
194 md4_transform_helper(mctx); in md4_final()
195 p = (char *)mctx->block; in md4_final()
200 mctx->block[14] = mctx->byte_count << 3; in md4_final()
201 mctx->block[15] = mctx->byte_count >> 29; in md4_final()
202 le32_to_cpu_array(mctx->block, (sizeof(mctx->block) - in md4_final()
204 md4_transform(mctx->hash, mctx->block); in md4_final()
205 cpu_to_le32_array(mctx->hash, ARRAY_SIZE(mctx->hash)); in md4_final()
206 memcpy(out, mctx->hash, sizeof(mctx->hash)); in md4_final()
207 memset(mctx, 0, sizeof(*mctx)); in md4_final()