Lines Matching refs:dctx

24 	struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc);  in crypto_poly1305_init()  local
26 poly1305_core_init(&dctx->h); in crypto_poly1305_init()
27 dctx->buflen = 0; in crypto_poly1305_init()
28 dctx->rset = 0; in crypto_poly1305_init()
29 dctx->sset = false; in crypto_poly1305_init()
34 static unsigned int crypto_poly1305_setdesckey(struct poly1305_desc_ctx *dctx, in crypto_poly1305_setdesckey() argument
37 if (!dctx->sset) { in crypto_poly1305_setdesckey()
38 if (!dctx->rset && srclen >= POLY1305_BLOCK_SIZE) { in crypto_poly1305_setdesckey()
39 poly1305_core_setkey(&dctx->core_r, src); in crypto_poly1305_setdesckey()
42 dctx->rset = 2; in crypto_poly1305_setdesckey()
45 dctx->s[0] = get_unaligned_le32(src + 0); in crypto_poly1305_setdesckey()
46 dctx->s[1] = get_unaligned_le32(src + 4); in crypto_poly1305_setdesckey()
47 dctx->s[2] = get_unaligned_le32(src + 8); in crypto_poly1305_setdesckey()
48 dctx->s[3] = get_unaligned_le32(src + 12); in crypto_poly1305_setdesckey()
51 dctx->sset = true; in crypto_poly1305_setdesckey()
57 static void poly1305_blocks(struct poly1305_desc_ctx *dctx, const u8 *src, in poly1305_blocks() argument
62 if (unlikely(!dctx->sset)) { in poly1305_blocks()
63 datalen = crypto_poly1305_setdesckey(dctx, src, srclen); in poly1305_blocks()
68 poly1305_core_blocks(&dctx->h, &dctx->core_r, src, in poly1305_blocks()
75 struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc); in crypto_poly1305_update() local
78 if (unlikely(dctx->buflen)) { in crypto_poly1305_update()
79 bytes = min(srclen, POLY1305_BLOCK_SIZE - dctx->buflen); in crypto_poly1305_update()
80 memcpy(dctx->buf + dctx->buflen, src, bytes); in crypto_poly1305_update()
83 dctx->buflen += bytes; in crypto_poly1305_update()
85 if (dctx->buflen == POLY1305_BLOCK_SIZE) { in crypto_poly1305_update()
86 poly1305_blocks(dctx, dctx->buf, in crypto_poly1305_update()
88 dctx->buflen = 0; in crypto_poly1305_update()
93 poly1305_blocks(dctx, src, srclen); in crypto_poly1305_update()
99 dctx->buflen = srclen; in crypto_poly1305_update()
100 memcpy(dctx->buf, src, srclen); in crypto_poly1305_update()
108 struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc); in crypto_poly1305_final() local
110 if (unlikely(!dctx->sset)) in crypto_poly1305_final()
113 poly1305_final_generic(dctx, dst); in crypto_poly1305_final()