linux/include/crypto/poly1305.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Common values for the Poly1305 algorithm
 */

#ifndef _CRYPTO_POLY1305_H
#define _CRYPTO_POLY1305_H

#include <linux/types.h>
#include <linux/crypto.h>

#define POLY1305_BLOCK_SIZE
#define POLY1305_KEY_SIZE
#define POLY1305_DIGEST_SIZE

/* The poly1305_key and poly1305_state types are mostly opaque and
 * implementation-defined. Limbs might be in base 2^64 or base 2^26, or
 * different yet. The union type provided keeps these 64-bit aligned for the
 * case in which this is implemented using 64x64 multiplies.
 */

struct poly1305_key {};

struct poly1305_core_key {};

struct poly1305_state {};

struct poly1305_desc_ctx {};

void poly1305_init_arch(struct poly1305_desc_ctx *desc,
			const u8 key[POLY1305_KEY_SIZE]);
void poly1305_init_generic(struct poly1305_desc_ctx *desc,
			   const u8 key[POLY1305_KEY_SIZE]);

static inline void poly1305_init(struct poly1305_desc_ctx *desc, const u8 *key)
{}

void poly1305_update_arch(struct poly1305_desc_ctx *desc, const u8 *src,
			  unsigned int nbytes);
void poly1305_update_generic(struct poly1305_desc_ctx *desc, const u8 *src,
			     unsigned int nbytes);

static inline void poly1305_update(struct poly1305_desc_ctx *desc,
				   const u8 *src, unsigned int nbytes)
{}

void poly1305_final_arch(struct poly1305_desc_ctx *desc, u8 *digest);
void poly1305_final_generic(struct poly1305_desc_ctx *desc, u8 *digest);

static inline void poly1305_final(struct poly1305_desc_ctx *desc, u8 *digest)
{}

#endif