Lines Matching defs:sctx
33 static void octeon_sha256_store_hash(struct sha256_state *sctx)
35 u64 *hash = (u64 *)sctx->state;
43 static void octeon_sha256_read_hash(struct sha256_state *sctx)
45 u64 *hash = (u64 *)sctx->state;
67 static void __octeon_sha256_update(struct sha256_state *sctx, const u8 *data,
74 partial = sctx->count % SHA256_BLOCK_SIZE;
75 sctx->count += len;
82 memcpy(sctx->buf + partial, data,
84 src = sctx->buf;
95 memcpy(sctx->buf + partial, src, len - done);
101 struct sha256_state *sctx = shash_desc_ctx(desc);
110 if ((sctx->count % SHA256_BLOCK_SIZE) + len < SHA256_BLOCK_SIZE)
114 octeon_sha256_store_hash(sctx);
116 __octeon_sha256_update(sctx, data, len);
118 octeon_sha256_read_hash(sctx);
126 struct sha256_state *sctx = shash_desc_ctx(desc);
137 bits = cpu_to_be64(sctx->count << 3);
140 index = sctx->count & 0x3f;
144 octeon_sha256_store_hash(sctx);
146 __octeon_sha256_update(sctx, padding, pad_len);
149 __octeon_sha256_update(sctx, (const u8 *)&bits, sizeof(bits));
151 octeon_sha256_read_hash(sctx);
156 dst[i] = cpu_to_be32(sctx->state[i]);
159 memset(sctx, 0, sizeof(*sctx));
178 struct sha256_state *sctx = shash_desc_ctx(desc);
180 memcpy(out, sctx, sizeof(*sctx));
186 struct sha256_state *sctx = shash_desc_ctx(desc);
188 memcpy(sctx, in, sizeof(*sctx));