Lines Matching refs:sctx

31 static void octeon_sha1_store_hash(struct sha1_state *sctx)
33 u64 *hash = (u64 *)sctx->state;
37 } hash_tail = { { sctx->state[4], } };
45 static void octeon_sha1_read_hash(struct sha1_state *sctx)
47 u64 *hash = (u64 *)sctx->state;
56 sctx->state[4] = hash_tail.word[0];
76 struct sha1_state *sctx = shash_desc_ctx(desc);
78 sctx->state[0] = SHA1_H0;
79 sctx->state[1] = SHA1_H1;
80 sctx->state[2] = SHA1_H2;
81 sctx->state[3] = SHA1_H3;
82 sctx->state[4] = SHA1_H4;
83 sctx->count = 0;
88 static void __octeon_sha1_update(struct sha1_state *sctx, const u8 *data,
95 partial = sctx->count % SHA1_BLOCK_SIZE;
96 sctx->count += len;
103 memcpy(sctx->buffer + partial, data,
105 src = sctx->buffer;
116 memcpy(sctx->buffer + partial, src, len - done);
122 struct sha1_state *sctx = shash_desc_ctx(desc);
131 if ((sctx->count % SHA1_BLOCK_SIZE) + len < SHA1_BLOCK_SIZE)
135 octeon_sha1_store_hash(sctx);
137 __octeon_sha1_update(sctx, data, len);
139 octeon_sha1_read_hash(sctx);
147 struct sha1_state *sctx = shash_desc_ctx(desc);
158 bits = cpu_to_be64(sctx->count << 3);
161 index = sctx->count & 0x3f;
165 octeon_sha1_store_hash(sctx);
167 __octeon_sha1_update(sctx, padding, pad_len);
170 __octeon_sha1_update(sctx, (const u8 *)&bits, sizeof(bits));
172 octeon_sha1_read_hash(sctx);
177 dst[i] = cpu_to_be32(sctx->state[i]);
180 memset(sctx, 0, sizeof(*sctx));
187 struct sha1_state *sctx = shash_desc_ctx(desc);
189 memcpy(out, sctx, sizeof(*sctx));
195 struct sha1_state *sctx = shash_desc_ctx(desc);
197 memcpy(sctx, in, sizeof(*sctx));