Lines Matching +full:p +full:- +full:384
1 // SPDX-License-Identifier: GPL-2.0
3 * sha3-ce-glue.c - core SHA-3 transform using v8.2 Crypto Extensions
26 MODULE_ALIAS_CRYPTO("sha3-224");
27 MODULE_ALIAS_CRYPTO("sha3-256");
28 MODULE_ALIAS_CRYPTO("sha3-384");
29 MODULE_ALIAS_CRYPTO("sha3-512");
38 unsigned int digest_size = crypto_shash_digestsize(desc->tfm); in sha3_update()
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() local
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()
54 data += p; in sha3_update()
55 len -= p; 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()
84 unsigned int digest_size = crypto_shash_digestsize(desc->tfm); in sha3_final()
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()
115 .base.cra_name = "sha3-224",
116 .base.cra_driver_name = "sha3-224-ce",
126 .base.cra_name = "sha3-256",
127 .base.cra_driver_name = "sha3-256-ce",
137 .base.cra_name = "sha3-384",
138 .base.cra_driver_name = "sha3-384-ce",
148 .base.cra_name = "sha3-512",
149 .base.cra_driver_name = "sha3-512-ce",