Lines Matching defs:mctx
126 int cifs_md4_init(struct md4_ctx *mctx)
128 memset(mctx, 0, sizeof(struct md4_ctx));
129 mctx->hash[0] = 0x67452301;
130 mctx->hash[1] = 0xefcdab89;
131 mctx->hash[2] = 0x98badcfe;
132 mctx->hash[3] = 0x10325476;
133 mctx->byte_count = 0;
139 int cifs_md4_update(struct md4_ctx *mctx, const u8 *data, unsigned int len)
141 const u32 avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f);
143 mctx->byte_count += len;
146 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail),
151 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail),
154 md4_transform_helper(mctx);
158 while (len >= sizeof(mctx->block)) {
159 memcpy(mctx->block, data, sizeof(mctx->block));
160 md4_transform_helper(mctx);
161 data += sizeof(mctx->block);
162 len -= sizeof(mctx->block);
165 memcpy(mctx->block, data, len);
171 int cifs_md4_final(struct md4_ctx *mctx, u8 *out)
173 const unsigned int offset = mctx->byte_count & 0x3f;
174 char *p = (char *)mctx->block + offset;
180 md4_transform_helper(mctx);
181 p = (char *)mctx->block;
186 mctx->block[14] = mctx->byte_count << 3;
187 mctx->block[15] = mctx->byte_count >> 29;
188 le32_to_cpu_array(mctx->block, (sizeof(mctx->block) -
190 md4_transform(mctx->hash, mctx->block);
191 cpu_to_le32_array(mctx->hash, ARRAY_SIZE(mctx->hash));
192 memcpy(out, mctx->hash, sizeof(mctx->hash));
193 memset(mctx, 0, sizeof(*mctx));