nrfxlib API 3.3.99
Loading...
Searching...
No Matches
ocrypto_poly1305.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 - 2025 Nordic Semiconductor ASA
3 * Copyright (c) since 2013 Oberon microsystems AG
4 *
5 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
6 */
7
8
32#ifndef OCRYPTO_POLY1305_H
33#define OCRYPTO_POLY1305_H
34
35#include <stddef.h>
36#include <stdint.h>
37
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43
47#define ocrypto_poly1305_KEY_BYTES (32)
48
52#define ocrypto_poly1305_BYTES (16)
53
54
56typedef struct {
57 uint32_t h[5];
58 uint32_t r[4];
59 uint32_t c[4];
60 uint8_t buffer[16];
61 uint8_t length; // Data length in buffer.
62} ocrypto_poly1305_ctx;
93 ocrypto_poly1305_ctx *ctx,
94 const uint8_t key[ocrypto_poly1305_KEY_BYTES]);
95
112 ocrypto_poly1305_ctx *ctx,
113 const uint8_t *in, size_t in_len);
114
126 ocrypto_poly1305_ctx *ctx);
127
145 ocrypto_poly1305_ctx *ctx,
146 uint8_t r[ocrypto_poly1305_BYTES]);
161 uint8_t r[ocrypto_poly1305_BYTES],
162 const uint8_t *in, size_t in_len,
163 const uint8_t k[ocrypto_poly1305_KEY_BYTES]);
164
165#ifdef __cplusplus
166}
167#endif
168
169#endif
170
#define ocrypto_poly1305_BYTES
Definition ocrypto_poly1305.h:52
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:47
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)