Lines Matching refs:sctx
22 struct sha1_state *sctx = shash_desc_ctx(desc); in sha1_base_init() local
24 sctx->state[0] = SHA1_H0; in sha1_base_init()
25 sctx->state[1] = SHA1_H1; in sha1_base_init()
26 sctx->state[2] = SHA1_H2; in sha1_base_init()
27 sctx->state[3] = SHA1_H3; in sha1_base_init()
28 sctx->state[4] = SHA1_H4; in sha1_base_init()
29 sctx->count = 0; in sha1_base_init()
39 struct sha1_state *sctx = shash_desc_ctx(desc); in sha1_base_do_update() local
40 unsigned int partial = sctx->count % SHA1_BLOCK_SIZE; in sha1_base_do_update()
42 sctx->count += len; in sha1_base_do_update()
50 memcpy(sctx->buffer + partial, data, p); in sha1_base_do_update()
54 block_fn(sctx, sctx->buffer, 1); in sha1_base_do_update()
61 block_fn(sctx, data, blocks); in sha1_base_do_update()
67 memcpy(sctx->buffer + partial, data, len); in sha1_base_do_update()
76 struct sha1_state *sctx = shash_desc_ctx(desc); in sha1_base_do_finalize() local
77 __be64 *bits = (__be64 *)(sctx->buffer + bit_offset); in sha1_base_do_finalize()
78 unsigned int partial = sctx->count % SHA1_BLOCK_SIZE; in sha1_base_do_finalize()
80 sctx->buffer[partial++] = 0x80; in sha1_base_do_finalize()
82 memset(sctx->buffer + partial, 0x0, SHA1_BLOCK_SIZE - partial); in sha1_base_do_finalize()
85 block_fn(sctx, sctx->buffer, 1); in sha1_base_do_finalize()
88 memset(sctx->buffer + partial, 0x0, bit_offset - partial); in sha1_base_do_finalize()
89 *bits = cpu_to_be64(sctx->count << 3); in sha1_base_do_finalize()
90 block_fn(sctx, sctx->buffer, 1); in sha1_base_do_finalize()
97 struct sha1_state *sctx = shash_desc_ctx(desc); in sha1_base_finish() local
102 put_unaligned_be32(sctx->state[i], digest++); in sha1_base_finish()
104 *sctx = (struct sha1_state){}; in sha1_base_finish()