mbed TLS v2.14.1
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
include
mbedtls
poly1305.h
Go to the documentation of this file.
1
15
/* Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved.
16
* SPDX-License-Identifier: Apache-2.0
17
*
18
* Licensed under the Apache License, Version 2.0 (the "License"); you may
19
* not use this file except in compliance with the License.
20
* You may obtain a copy of the License at
21
*
22
* http://www.apache.org/licenses/LICENSE-2.0
23
*
24
* Unless required by applicable law or agreed to in writing, software
25
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
26
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27
* See the License for the specific language governing permissions and
28
* limitations under the License.
29
*
30
* This file is part of Mbed TLS (https://tls.mbed.org)
31
*/
32
33
#ifndef MBEDTLS_POLY1305_H
34
#define MBEDTLS_POLY1305_H
35
36
#if !defined(MBEDTLS_CONFIG_FILE)
37
#include "
mbedtls/config.h
"
38
#else
39
#include MBEDTLS_CONFIG_FILE
40
#endif
41
42
#include <stdint.h>
43
#include <stddef.h>
44
45
#define MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA -0x0057
47
/* MBEDTLS_ERR_POLY1305_FEATURE_UNAVAILABLE is deprecated and should not be
48
* used. */
49
#define MBEDTLS_ERR_POLY1305_FEATURE_UNAVAILABLE -0x0059
51
/* MBEDTLS_ERR_POLY1305_HW_ACCEL_FAILED is deprecated and should not be used.
52
*/
53
#define MBEDTLS_ERR_POLY1305_HW_ACCEL_FAILED -0x005B
55
#ifdef __cplusplus
56
extern
"C"
{
57
#endif
58
59
#if !defined(MBEDTLS_POLY1305_ALT)
60
61
typedef
struct
mbedtls_poly1305_context
62
{
63
uint32_t
r
[4];
64
uint32_t
s
[4];
65
uint32_t
acc
[5];
66
uint8_t
queue
[16];
67
size_t
queue_len
;
68
}
69
mbedtls_poly1305_context
;
70
71
#else
/* MBEDTLS_POLY1305_ALT */
72
#include "poly1305_alt.h"
73
#endif
/* MBEDTLS_POLY1305_ALT */
74
89
void
mbedtls_poly1305_init
(
mbedtls_poly1305_context
*ctx );
90
96
void
mbedtls_poly1305_free
(
mbedtls_poly1305_context
*ctx );
97
111
int
mbedtls_poly1305_starts
(
mbedtls_poly1305_context
*ctx,
112
const
unsigned
char
key[32] );
113
131
int
mbedtls_poly1305_update
(
mbedtls_poly1305_context
*ctx,
132
const
unsigned
char
*input,
133
size_t
ilen );
134
147
int
mbedtls_poly1305_finish
(
mbedtls_poly1305_context
*ctx,
148
unsigned
char
mac[16] );
149
168
int
mbedtls_poly1305_mac
(
const
unsigned
char
key[32],
169
const
unsigned
char
*input,
170
size_t
ilen,
171
unsigned
char
mac[16] );
172
173
#if defined(MBEDTLS_SELF_TEST)
174
180
int
mbedtls_poly1305_self_test(
int
verbose );
181
#endif
/* MBEDTLS_SELF_TEST */
182
183
#ifdef __cplusplus
184
}
185
#endif
186
187
#endif
/* MBEDTLS_POLY1305_H */
Generated on Mon Jun 27 2022 04:24:25 for mbed TLS v2.14.1 by
1.8.1.2