Lines Matching refs:sctx
37 struct sha3_state *sctx = shash_desc_ctx(desc); in sha3_update() local
43 if ((sctx->partial + len) >= sctx->rsiz) { in sha3_update()
46 if (sctx->partial) { in sha3_update()
47 int p = sctx->rsiz - sctx->partial; in sha3_update()
49 memcpy(sctx->buf + sctx->partial, data, p); in sha3_update()
51 sha3_ce_transform(sctx->st, sctx->buf, 1, digest_size); in sha3_update()
56 sctx->partial = 0; in sha3_update()
59 blocks = len / sctx->rsiz; in sha3_update()
60 len %= sctx->rsiz; in sha3_update()
66 rem = sha3_ce_transform(sctx->st, data, blocks, in sha3_update()
69 data += (blocks - rem) * sctx->rsiz; in sha3_update()
75 memcpy(sctx->buf + sctx->partial, data, len); in sha3_update()
76 sctx->partial += len; in sha3_update()
83 struct sha3_state *sctx = shash_desc_ctx(desc); in sha3_final() local
91 sctx->buf[sctx->partial++] = 0x06; in sha3_final()
92 memset(sctx->buf + sctx->partial, 0, sctx->rsiz - sctx->partial); in sha3_final()
93 sctx->buf[sctx->rsiz - 1] |= 0x80; in sha3_final()
96 sha3_ce_transform(sctx->st, sctx->buf, 1, digest_size); in sha3_final()
100 put_unaligned_le64(sctx->st[i], digest++); in sha3_final()
103 put_unaligned_le32(sctx->st[i], (__le32 *)digest); in sha3_final()
105 memzero_explicit(sctx, sizeof(*sctx)); in sha3_final()