Lines Matching refs:dctx

28 void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 key[POLY1305_KEY_SIZE])
30 poly1305_init_arm64(&dctx->h, key);
31 dctx->s[0] = get_unaligned_le32(key + 16);
32 dctx->s[1] = get_unaligned_le32(key + 20);
33 dctx->s[2] = get_unaligned_le32(key + 24);
34 dctx->s[3] = get_unaligned_le32(key + 28);
35 dctx->buflen = 0;
41 struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc);
43 dctx->buflen = 0;
44 dctx->rset = 0;
45 dctx->sset = false;
50 static void neon_poly1305_blocks(struct poly1305_desc_ctx *dctx, const u8 *src,
53 if (unlikely(!dctx->sset)) {
54 if (!dctx->rset) {
55 poly1305_init_arm64(&dctx->h, src);
58 dctx->rset = 1;
61 dctx->s[0] = get_unaligned_le32(src + 0);
62 dctx->s[1] = get_unaligned_le32(src + 4);
63 dctx->s[2] = get_unaligned_le32(src + 8);
64 dctx->s[3] = get_unaligned_le32(src + 12);
67 dctx->sset = true;
76 poly1305_blocks_neon(&dctx->h, src, len, hibit);
78 poly1305_blocks(&dctx->h, src, len, hibit);
81 static void neon_poly1305_do_update(struct poly1305_desc_ctx *dctx,
84 if (unlikely(dctx->buflen)) {
85 u32 bytes = min(len, POLY1305_BLOCK_SIZE - dctx->buflen);
87 memcpy(dctx->buf + dctx->buflen, src, bytes);
90 dctx->buflen += bytes;
92 if (dctx->buflen == POLY1305_BLOCK_SIZE) {
93 neon_poly1305_blocks(dctx, dctx->buf,
95 dctx->buflen = 0;
100 neon_poly1305_blocks(dctx, src, len, 1, do_neon);
106 dctx->buflen = len;
107 memcpy(dctx->buf, src, len);
115 struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc);
119 neon_poly1305_do_update(dctx, src, srclen, do_neon);
125 void poly1305_update_arch(struct poly1305_desc_ctx *dctx, const u8 *src,
128 if (unlikely(dctx->buflen)) {
129 u32 bytes = min(nbytes, POLY1305_BLOCK_SIZE - dctx->buflen);
131 memcpy(dctx->buf + dctx->buflen, src, bytes);
134 dctx->buflen += bytes;
136 if (dctx->buflen == POLY1305_BLOCK_SIZE) {
137 poly1305_blocks(&dctx->h, dctx->buf, POLY1305_BLOCK_SIZE, 1);
138 dctx->buflen = 0;
150 poly1305_blocks_neon(&dctx->h, src, todo, 1);
157 poly1305_blocks(&dctx->h, src, len, 1);
164 dctx->buflen = nbytes;
165 memcpy(dctx->buf, src, nbytes);
170 void poly1305_final_arch(struct poly1305_desc_ctx *dctx, u8 *dst)
172 if (unlikely(dctx->buflen)) {
173 dctx->buf[dctx->buflen++] = 1;
174 memset(dctx->buf + dctx->buflen, 0,
175 POLY1305_BLOCK_SIZE - dctx->buflen);
176 poly1305_blocks(&dctx->h, dctx->buf, POLY1305_BLOCK_SIZE, 0);
179 poly1305_emit(&dctx->h, dst, dctx->s);
180 memzero_explicit(dctx, sizeof(*dctx));
186 struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc);
188 if (unlikely(!dctx->sset))
191 poly1305_final_arch(dctx, dst);