nrfxlib API 2.8.99
Loading...
Searching...
No Matches
ocrypto_poly1305.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA
3 * Copyright (c) since 2013 Oberon microsystems AG
4 *
5 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
6 */
7
8
27#ifndef OCRYPTO_POLY1305_H
28#define OCRYPTO_POLY1305_H
29
30#include <stddef.h>
31#include <stdint.h>
32
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38
42#define ocrypto_poly1305_KEY_BYTES (32)
43
47#define ocrypto_poly1305_BYTES (16)
48
49
51typedef struct {
52 uint32_t h[5];
53 uint32_t r[4];
54 uint32_t c[4];
55 uint8_t buffer[16];
56 uint8_t length; // Data length in buffer.
57} ocrypto_poly1305_ctx;
86 ocrypto_poly1305_ctx *ctx,
87 const uint8_t key[ocrypto_poly1305_KEY_BYTES]);
88
105 ocrypto_poly1305_ctx *ctx,
106 const uint8_t *in, size_t in_len);
107
119 ocrypto_poly1305_ctx *ctx);
120
138 ocrypto_poly1305_ctx *ctx,
139 uint8_t r[ocrypto_poly1305_BYTES]);
154 uint8_t r[ocrypto_poly1305_BYTES],
155 const uint8_t *in, size_t in_len,
156 const uint8_t k[ocrypto_poly1305_KEY_BYTES]);
157
158#ifdef __cplusplus
159}
160#endif
161
162#endif
163
#define ocrypto_poly1305_BYTES
Definition ocrypto_poly1305.h:47
void ocrypto_poly1305_init(ocrypto_poly1305_ctx *ctx, const uint8_t key[(32)])
void ocrypto_poly1305_final(ocrypto_poly1305_ctx *ctx, uint8_t r[(16)])
#define ocrypto_poly1305_KEY_BYTES
Definition ocrypto_poly1305.h:42
void ocrypto_poly1305(uint8_t r[(16)], const uint8_t *in, size_t in_len, const uint8_t k[(32)])
void ocrypto_poly1305_update(ocrypto_poly1305_ctx *ctx, const uint8_t *in, size_t in_len)
void ocrypto_poly1305_pad(ocrypto_poly1305_ctx *ctx)