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