Lines Matching refs:sctx
51 struct sha512_state *sctx = shash_desc_ctx(desc); in nx_sha512_init() local
53 memset(sctx, 0, sizeof *sctx); in nx_sha512_init()
55 sctx->state[0] = __cpu_to_be64(SHA512_H0); in nx_sha512_init()
56 sctx->state[1] = __cpu_to_be64(SHA512_H1); in nx_sha512_init()
57 sctx->state[2] = __cpu_to_be64(SHA512_H2); in nx_sha512_init()
58 sctx->state[3] = __cpu_to_be64(SHA512_H3); in nx_sha512_init()
59 sctx->state[4] = __cpu_to_be64(SHA512_H4); in nx_sha512_init()
60 sctx->state[5] = __cpu_to_be64(SHA512_H5); in nx_sha512_init()
61 sctx->state[6] = __cpu_to_be64(SHA512_H6); in nx_sha512_init()
62 sctx->state[7] = __cpu_to_be64(SHA512_H7); in nx_sha512_init()
63 sctx->count[0] = 0; in nx_sha512_init()
71 struct sha512_state *sctx = shash_desc_ctx(desc); in nx_sha512_update() local
80 u64 buf_len = (sctx->count[0] % SHA512_BLOCK_SIZE); in nx_sha512_update()
88 total = (sctx->count[0] % SHA512_BLOCK_SIZE) + len; in nx_sha512_update()
90 memcpy(sctx->buf + buf_len, data, len); in nx_sha512_update()
91 sctx->count[0] += len; in nx_sha512_update()
95 memcpy(csbcpb->cpb.sha512.message_digest, sctx->state, SHA512_DIGEST_SIZE); in nx_sha512_update()
105 out_sg = nx_build_sg_list(nx_ctx->out_sg, (u8 *)sctx->state, in nx_sha512_update()
121 (u8 *) sctx->buf, in nx_sha512_update()
184 memcpy(sctx->buf, data, leftover); in nx_sha512_update()
185 sctx->count[0] += len; in nx_sha512_update()
186 memcpy(sctx->state, csbcpb->cpb.sha512.message_digest, SHA512_DIGEST_SIZE); in nx_sha512_update()
194 struct sha512_state *sctx = shash_desc_ctx(desc); in nx_sha512_final() local
213 if (sctx->count[0] >= SHA512_BLOCK_SIZE) { in nx_sha512_final()
216 memcpy(csbcpb->cpb.sha512.input_partial_digest, sctx->state, in nx_sha512_final()
227 count0 = sctx->count[0] * 8; in nx_sha512_final()
231 len = sctx->count[0] & (SHA512_BLOCK_SIZE - 1); in nx_sha512_final()
232 in_sg = nx_build_sg_list(nx_ctx->in_sg, sctx->buf, &len, in nx_sha512_final()
235 if (len != (sctx->count[0] & (SHA512_BLOCK_SIZE - 1))) { in nx_sha512_final()
258 atomic64_add(sctx->count[0], &(nx_ctx->stats->sha512_bytes)); in nx_sha512_final()
268 struct sha512_state *sctx = shash_desc_ctx(desc); in nx_sha512_export() local
270 memcpy(out, sctx, sizeof(*sctx)); in nx_sha512_export()
277 struct sha512_state *sctx = shash_desc_ctx(desc); in nx_sha512_import() local
279 memcpy(sctx, in, sizeof(*sctx)); in nx_sha512_import()