Lines Matching refs:sctx
22 struct sm3_state *sctx = shash_desc_ctx(desc);
24 sctx->state[0] = SM3_IVA;
25 sctx->state[1] = SM3_IVB;
26 sctx->state[2] = SM3_IVC;
27 sctx->state[3] = SM3_IVD;
28 sctx->state[4] = SM3_IVE;
29 sctx->state[5] = SM3_IVF;
30 sctx->state[6] = SM3_IVG;
31 sctx->state[7] = SM3_IVH;
32 sctx->count = 0;
42 struct sm3_state *sctx = shash_desc_ctx(desc);
43 unsigned int partial = sctx->count % SM3_BLOCK_SIZE;
45 sctx->count += len;
53 memcpy(sctx->buffer + partial, data, p);
57 block_fn(sctx, sctx->buffer, 1);
64 block_fn(sctx, data, blocks);
70 memcpy(sctx->buffer + partial, data, len);
79 struct sm3_state *sctx = shash_desc_ctx(desc);
80 __be64 *bits = (__be64 *)(sctx->buffer + bit_offset);
81 unsigned int partial = sctx->count % SM3_BLOCK_SIZE;
83 sctx->buffer[partial++] = 0x80;
85 memset(sctx->buffer + partial, 0x0, SM3_BLOCK_SIZE - partial);
88 block_fn(sctx, sctx->buffer, 1);
91 memset(sctx->buffer + partial, 0x0, bit_offset - partial);
92 *bits = cpu_to_be64(sctx->count << 3);
93 block_fn(sctx, sctx->buffer, 1);
100 struct sm3_state *sctx = shash_desc_ctx(desc);
105 put_unaligned_be32(sctx->state[i], digest++);
107 *sctx = (struct sm3_state){};