Lines Matching refs:desc
15 void poly1305_init_generic(struct poly1305_desc_ctx *desc, in poly1305_init_generic() argument
18 poly1305_core_setkey(&desc->core_r, key); in poly1305_init_generic()
19 desc->s[0] = get_unaligned_le32(key + 16); in poly1305_init_generic()
20 desc->s[1] = get_unaligned_le32(key + 20); in poly1305_init_generic()
21 desc->s[2] = get_unaligned_le32(key + 24); in poly1305_init_generic()
22 desc->s[3] = get_unaligned_le32(key + 28); in poly1305_init_generic()
23 poly1305_core_init(&desc->h); in poly1305_init_generic()
24 desc->buflen = 0; in poly1305_init_generic()
25 desc->sset = true; in poly1305_init_generic()
26 desc->rset = 2; in poly1305_init_generic()
30 void poly1305_update_generic(struct poly1305_desc_ctx *desc, const u8 *src, in poly1305_update_generic() argument
35 if (unlikely(desc->buflen)) { in poly1305_update_generic()
36 bytes = min(nbytes, POLY1305_BLOCK_SIZE - desc->buflen); in poly1305_update_generic()
37 memcpy(desc->buf + desc->buflen, src, bytes); in poly1305_update_generic()
40 desc->buflen += bytes; in poly1305_update_generic()
42 if (desc->buflen == POLY1305_BLOCK_SIZE) { in poly1305_update_generic()
43 poly1305_core_blocks(&desc->h, &desc->core_r, desc->buf, in poly1305_update_generic()
45 desc->buflen = 0; in poly1305_update_generic()
50 poly1305_core_blocks(&desc->h, &desc->core_r, src, in poly1305_update_generic()
57 desc->buflen = nbytes; in poly1305_update_generic()
58 memcpy(desc->buf, src, nbytes); in poly1305_update_generic()
63 void poly1305_final_generic(struct poly1305_desc_ctx *desc, u8 *dst) in poly1305_final_generic() argument
65 if (unlikely(desc->buflen)) { in poly1305_final_generic()
66 desc->buf[desc->buflen++] = 1; in poly1305_final_generic()
67 memset(desc->buf + desc->buflen, 0, in poly1305_final_generic()
68 POLY1305_BLOCK_SIZE - desc->buflen); in poly1305_final_generic()
69 poly1305_core_blocks(&desc->h, &desc->core_r, desc->buf, 1, 0); in poly1305_final_generic()
72 poly1305_core_emit(&desc->h, desc->s, dst); in poly1305_final_generic()
73 *desc = (struct poly1305_desc_ctx){}; in poly1305_final_generic()