2022-07-27 13:51:53 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* include/crypto/poly1305.h
|
|
|
|
* $OpenBSD: poly1305.h,v 1.2 2020/07/22 13:54:30 tobhe Exp $
|
|
|
|
*
|
2022-07-18 09:00:30 +02:00
|
|
|
* Public Domain poly1305 from Andrew Moon
|
|
|
|
*
|
|
|
|
* poly1305 implementation using 32 bit * 32 bit = 64 bit multiplication
|
|
|
|
* and 64 bit addition from https://github.com/floodyberry/poly1305-donna
|
2022-07-27 13:51:53 +02:00
|
|
|
****************************************************************************/
|
2022-07-18 09:00:30 +02:00
|
|
|
|
2022-07-27 13:51:53 +02:00
|
|
|
#ifndef __INCLUDE_CRYPTO_POLY1305_H
|
|
|
|
#define __INCLUDE_CRYPTO_POLY1305_H
|
2022-07-18 09:00:30 +02:00
|
|
|
|
2022-07-28 11:52:21 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2022-07-18 09:00:30 +02:00
|
|
|
#define poly1305_block_size 16
|
|
|
|
|
2022-07-27 13:51:53 +02:00
|
|
|
typedef struct poly1305_state
|
|
|
|
{
|
|
|
|
unsigned long r[5];
|
|
|
|
unsigned long h[5];
|
|
|
|
unsigned long pad[4];
|
|
|
|
size_t leftover;
|
|
|
|
unsigned char buffer[poly1305_block_size];
|
|
|
|
unsigned char final;
|
2022-07-18 09:00:30 +02:00
|
|
|
} poly1305_state;
|
|
|
|
|
2022-07-27 13:51:53 +02:00
|
|
|
void poly1305_init(FAR poly1305_state *, FAR const unsigned char *);
|
|
|
|
void poly1305_update(FAR poly1305_state *,
|
|
|
|
FAR const unsigned char *, size_t);
|
|
|
|
void poly1305_finish(FAR poly1305_state *, FAR unsigned char *);
|
2022-07-18 09:00:30 +02:00
|
|
|
|
2022-07-27 13:51:53 +02:00
|
|
|
#endif /* __INCLUDE_CRYPTO_POLY1305_H */
|