Mbed TLS v3.6.7
Toggle main menu visibility
Loading...
Searching...
No Matches
poly1305.h
Go to the documentation of this file.
1
14
15
/*
16
* Copyright The Mbed TLS Contributors
17
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
18
*/
19
20
#ifndef MBEDTLS_POLY1305_H
21
#define MBEDTLS_POLY1305_H
22
#include "
mbedtls/private_access.h
"
23
24
#include "
mbedtls/build_info.h
"
25
26
#include <stdint.h>
27
#include <stddef.h>
28
30
#define MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA -0x0057
31
32
#ifdef __cplusplus
33
extern
"C"
{
34
#endif
35
36
#if !defined(MBEDTLS_POLY1305_ALT)
37
38
typedef
struct
mbedtls_poly1305_context
{
39
uint32_t
MBEDTLS_PRIVATE
(r)[4];
40
uint32_t
MBEDTLS_PRIVATE
(s)[4];
41
uint32_t
MBEDTLS_PRIVATE
(acc)[5];
42
uint8_t
MBEDTLS_PRIVATE
(queue)[16];
43
size_t
MBEDTLS_PRIVATE
(queue_len);
44
}
45
mbedtls_poly1305_context
;
46
47
#else
/* MBEDTLS_POLY1305_ALT */
48
#include "
poly1305_alt.h
"
49
#endif
/* MBEDTLS_POLY1305_ALT */
50
66
void
mbedtls_poly1305_init
(
mbedtls_poly1305_context
*ctx);
67
76
void
mbedtls_poly1305_free
(
mbedtls_poly1305_context
*ctx);
77
91
int
mbedtls_poly1305_starts
(
mbedtls_poly1305_context
*ctx,
92
const
unsigned
char
key[32]);
93
112
int
mbedtls_poly1305_update
(
mbedtls_poly1305_context
*ctx,
113
const
unsigned
char
*input,
114
size_t
ilen);
115
128
int
mbedtls_poly1305_finish
(
mbedtls_poly1305_context
*ctx,
129
unsigned
char
mac[16]);
130
149
int
mbedtls_poly1305_mac
(
const
unsigned
char
key[32],
150
const
unsigned
char
*input,
151
size_t
ilen,
152
unsigned
char
mac[16]);
153
154
#if defined(MBEDTLS_SELF_TEST)
161
int
mbedtls_poly1305_self_test
(
int
verbose);
162
#endif
/* MBEDTLS_SELF_TEST */
163
164
#ifdef __cplusplus
165
}
166
#endif
167
168
#endif
/* MBEDTLS_POLY1305_H */
build_info.h
Build-time configuration info.
mbedtls_poly1305_self_test
int mbedtls_poly1305_self_test(int verbose)
The Poly1305 checkup routine.
mbedtls_poly1305_update
int mbedtls_poly1305_update(mbedtls_poly1305_context *ctx, const unsigned char *input, size_t ilen)
This functions feeds an input buffer into an ongoing Poly1305 computation.
mbedtls_poly1305_mac
int mbedtls_poly1305_mac(const unsigned char key[32], const unsigned char *input, size_t ilen, unsigned char mac[16])
This function calculates the Poly1305 MAC of the input buffer with the provided key.
mbedtls_poly1305_finish
int mbedtls_poly1305_finish(mbedtls_poly1305_context *ctx, unsigned char mac[16])
This function generates the Poly1305 Message Authentication Code (MAC).
mbedtls_poly1305_init
void mbedtls_poly1305_init(mbedtls_poly1305_context *ctx)
This function initializes the specified Poly1305 context.
mbedtls_poly1305_starts
int mbedtls_poly1305_starts(mbedtls_poly1305_context *ctx, const unsigned char key[32])
This function sets the one-time authentication key.
mbedtls_poly1305_free
void mbedtls_poly1305_free(mbedtls_poly1305_context *ctx)
This function releases and clears the specified Poly1305 context.
poly1305_alt.h
private_access.h
Macro wrapper for struct's members.
MBEDTLS_PRIVATE
#define MBEDTLS_PRIVATE(member)
Definition
private_access.h:15
mbedtls_poly1305_context
Definition
poly1305.h:38
include
mbedtls
poly1305.h
Generated on
for Mbed TLS v3.6.7 by
1.17.0