Lines Matching refs:mctx
131 struct md5_state *mctx = shash_desc_ctx(desc); in md5_init() local
133 mctx->hash[0] = MD5_H0; in md5_init()
134 mctx->hash[1] = MD5_H1; in md5_init()
135 mctx->hash[2] = MD5_H2; in md5_init()
136 mctx->hash[3] = MD5_H3; in md5_init()
137 mctx->byte_count = 0; in md5_init()
144 struct md5_state *mctx = shash_desc_ctx(desc); in md5_update() local
145 const u32 avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f); in md5_update()
147 mctx->byte_count += len; in md5_update()
150 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), in md5_update()
155 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), in md5_update()
158 md5_transform_helper(mctx); in md5_update()
162 while (len >= sizeof(mctx->block)) { in md5_update()
163 memcpy(mctx->block, data, sizeof(mctx->block)); in md5_update()
164 md5_transform_helper(mctx); in md5_update()
165 data += sizeof(mctx->block); in md5_update()
166 len -= sizeof(mctx->block); in md5_update()
169 memcpy(mctx->block, data, len); in md5_update()
176 struct md5_state *mctx = shash_desc_ctx(desc); in md5_final() local
177 const unsigned int offset = mctx->byte_count & 0x3f; in md5_final()
178 char *p = (char *)mctx->block + offset; in md5_final()
184 md5_transform_helper(mctx); in md5_final()
185 p = (char *)mctx->block; in md5_final()
190 mctx->block[14] = mctx->byte_count << 3; in md5_final()
191 mctx->block[15] = mctx->byte_count >> 29; in md5_final()
192 le32_to_cpu_array(mctx->block, (sizeof(mctx->block) - in md5_final()
194 md5_transform(mctx->hash, mctx->block); in md5_final()
195 cpu_to_le32_array(mctx->hash, sizeof(mctx->hash) / sizeof(u32)); in md5_final()
196 memcpy(out, mctx->hash, sizeof(mctx->hash)); in md5_final()
197 memset(mctx, 0, sizeof(*mctx)); in md5_final()