Lines Matching refs:sctx
53 static inline void ppc_sha1_clear_context(struct sha1_state *sctx) in ppc_sha1_clear_context() argument
56 u32 *ptr = (u32 *)sctx; in ppc_sha1_clear_context()
65 struct sha1_state *sctx = shash_desc_ctx(desc); in ppc_spe_sha1_init() local
67 sctx->state[0] = SHA1_H0; in ppc_spe_sha1_init()
68 sctx->state[1] = SHA1_H1; in ppc_spe_sha1_init()
69 sctx->state[2] = SHA1_H2; in ppc_spe_sha1_init()
70 sctx->state[3] = SHA1_H3; in ppc_spe_sha1_init()
71 sctx->state[4] = SHA1_H4; in ppc_spe_sha1_init()
72 sctx->count = 0; in ppc_spe_sha1_init()
80 struct sha1_state *sctx = shash_desc_ctx(desc); in ppc_spe_sha1_update() local
81 const unsigned int offset = sctx->count & 0x3f; in ppc_spe_sha1_update()
87 sctx->count += len; in ppc_spe_sha1_update()
88 memcpy((char *)sctx->buffer + offset, src, len); in ppc_spe_sha1_update()
92 sctx->count += len; in ppc_spe_sha1_update()
95 memcpy((char *)sctx->buffer + offset, src, avail); in ppc_spe_sha1_update()
98 ppc_spe_sha1_transform(sctx->state, (const u8 *)sctx->buffer, 1); in ppc_spe_sha1_update()
110 ppc_spe_sha1_transform(sctx->state, src, bytes >> 6); in ppc_spe_sha1_update()
117 memcpy((char *)sctx->buffer, src, len); in ppc_spe_sha1_update()
123 struct sha1_state *sctx = shash_desc_ctx(desc); in ppc_spe_sha1_final() local
124 const unsigned int offset = sctx->count & 0x3f; in ppc_spe_sha1_final()
125 char *p = (char *)sctx->buffer + offset; in ppc_spe_sha1_final()
127 __be64 *pbits = (__be64 *)(((char *)&sctx->buffer) + 56); in ppc_spe_sha1_final()
137 ppc_spe_sha1_transform(sctx->state, sctx->buffer, 1); in ppc_spe_sha1_final()
138 p = (char *)sctx->buffer; in ppc_spe_sha1_final()
143 *pbits = cpu_to_be64(sctx->count << 3); in ppc_spe_sha1_final()
144 ppc_spe_sha1_transform(sctx->state, sctx->buffer, 1); in ppc_spe_sha1_final()
148 dst[0] = cpu_to_be32(sctx->state[0]); in ppc_spe_sha1_final()
149 dst[1] = cpu_to_be32(sctx->state[1]); in ppc_spe_sha1_final()
150 dst[2] = cpu_to_be32(sctx->state[2]); in ppc_spe_sha1_final()
151 dst[3] = cpu_to_be32(sctx->state[3]); in ppc_spe_sha1_final()
152 dst[4] = cpu_to_be32(sctx->state[4]); in ppc_spe_sha1_final()
154 ppc_sha1_clear_context(sctx); in ppc_spe_sha1_final()
160 struct sha1_state *sctx = shash_desc_ctx(desc); in ppc_spe_sha1_export() local
162 memcpy(out, sctx, sizeof(*sctx)); in ppc_spe_sha1_export()
168 struct sha1_state *sctx = shash_desc_ctx(desc); in ppc_spe_sha1_import() local
170 memcpy(sctx, in, sizeof(*sctx)); in ppc_spe_sha1_import()