Lines Matching refs:sctx
32 static void octeon_sha1_store_hash(struct sha1_state *sctx)
34 u64 *hash = (u64 *)sctx->state;
38 } hash_tail = { { sctx->state[4], } };
46 static void octeon_sha1_read_hash(struct sha1_state *sctx)
48 u64 *hash = (u64 *)sctx->state;
57 sctx->state[4] = hash_tail.word[0];
75 static void __octeon_sha1_update(struct sha1_state *sctx, const u8 *data,
82 partial = sctx->count % SHA1_BLOCK_SIZE;
83 sctx->count += len;
90 memcpy(sctx->buffer + partial, data,
92 src = sctx->buffer;
103 memcpy(sctx->buffer + partial, src, len - done);
109 struct sha1_state *sctx = shash_desc_ctx(desc);
118 if ((sctx->count % SHA1_BLOCK_SIZE) + len < SHA1_BLOCK_SIZE)
122 octeon_sha1_store_hash(sctx);
124 __octeon_sha1_update(sctx, data, len);
126 octeon_sha1_read_hash(sctx);
134 struct sha1_state *sctx = shash_desc_ctx(desc);
145 bits = cpu_to_be64(sctx->count << 3);
148 index = sctx->count & 0x3f;
152 octeon_sha1_store_hash(sctx);
154 __octeon_sha1_update(sctx, padding, pad_len);
157 __octeon_sha1_update(sctx, (const u8 *)&bits, sizeof(bits));
159 octeon_sha1_read_hash(sctx);
164 dst[i] = cpu_to_be32(sctx->state[i]);
167 memset(sctx, 0, sizeof(*sctx));
174 struct sha1_state *sctx = shash_desc_ctx(desc);
176 memcpy(out, sctx, sizeof(*sctx));
182 struct sha1_state *sctx = shash_desc_ctx(desc);
184 memcpy(sctx, in, sizeof(*sctx));