Lines Matching refs:sctx

44 	struct sha512_state_be *sctx = shash_desc_ctx(desc);  in nx_sha512_init()  local
46 memset(sctx, 0, sizeof *sctx); in nx_sha512_init()
48 sctx->state[0] = __cpu_to_be64(SHA512_H0); in nx_sha512_init()
49 sctx->state[1] = __cpu_to_be64(SHA512_H1); in nx_sha512_init()
50 sctx->state[2] = __cpu_to_be64(SHA512_H2); in nx_sha512_init()
51 sctx->state[3] = __cpu_to_be64(SHA512_H3); in nx_sha512_init()
52 sctx->state[4] = __cpu_to_be64(SHA512_H4); in nx_sha512_init()
53 sctx->state[5] = __cpu_to_be64(SHA512_H5); in nx_sha512_init()
54 sctx->state[6] = __cpu_to_be64(SHA512_H6); in nx_sha512_init()
55 sctx->state[7] = __cpu_to_be64(SHA512_H7); in nx_sha512_init()
56 sctx->count[0] = 0; in nx_sha512_init()
64 struct sha512_state_be *sctx = shash_desc_ctx(desc); in nx_sha512_update() local
73 u64 buf_len = (sctx->count[0] % SHA512_BLOCK_SIZE); in nx_sha512_update()
81 total = (sctx->count[0] % SHA512_BLOCK_SIZE) + len; in nx_sha512_update()
83 memcpy(sctx->buf + buf_len, data, len); in nx_sha512_update()
84 sctx->count[0] += len; in nx_sha512_update()
88 memcpy(csbcpb->cpb.sha512.message_digest, sctx->state, SHA512_DIGEST_SIZE); in nx_sha512_update()
98 out_sg = nx_build_sg_list(nx_ctx->out_sg, (u8 *)sctx->state, in nx_sha512_update()
114 (u8 *) sctx->buf, in nx_sha512_update()
176 memcpy(sctx->buf, data, leftover); in nx_sha512_update()
177 sctx->count[0] += len; in nx_sha512_update()
178 memcpy(sctx->state, csbcpb->cpb.sha512.message_digest, SHA512_DIGEST_SIZE); in nx_sha512_update()
186 struct sha512_state_be *sctx = shash_desc_ctx(desc); in nx_sha512_final() local
205 if (sctx->count[0] >= SHA512_BLOCK_SIZE) { in nx_sha512_final()
208 memcpy(csbcpb->cpb.sha512.input_partial_digest, sctx->state, in nx_sha512_final()
219 count0 = sctx->count[0] * 8; in nx_sha512_final()
223 len = sctx->count[0] & (SHA512_BLOCK_SIZE - 1); in nx_sha512_final()
224 in_sg = nx_build_sg_list(nx_ctx->in_sg, sctx->buf, &len, in nx_sha512_final()
227 if (len != (sctx->count[0] & (SHA512_BLOCK_SIZE - 1))) { in nx_sha512_final()
249 atomic64_add(sctx->count[0], &(nx_ctx->stats->sha512_bytes)); in nx_sha512_final()
259 struct sha512_state_be *sctx = shash_desc_ctx(desc); in nx_sha512_export() local
261 memcpy(out, sctx, sizeof(*sctx)); in nx_sha512_export()
268 struct sha512_state_be *sctx = shash_desc_ctx(desc); in nx_sha512_import() local
270 memcpy(sctx, in, sizeof(*sctx)); in nx_sha512_import()