poly1305.h
Go to the documentation of this file.
1 /* Copyright (c) 2014, Google Inc.
2  *
3  * Permission to use, copy, modify, and/or distribute this software for any
4  * purpose with or without fee is hereby granted, provided that the above
5  * copyright notice and this permission notice appear in all copies.
6  *
7  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
10  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
12  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
13  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
14 
15 #ifndef OPENSSL_HEADER_POLY1305_H
16 #define OPENSSL_HEADER_POLY1305_H
17 
18 #include <openssl/base.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 
25 typedef uint8_t poly1305_state[512];
26 
27 // CRYPTO_poly1305_init sets up |state| so that it can be used to calculate an
28 // authentication tag with the one-time key |key|. Note that |key| is a
29 // one-time key and therefore there is no `reset' method because that would
30 // enable several messages to be authenticated with the same key.
32  const uint8_t key[32]);
33 
34 // CRYPTO_poly1305_update processes |in_len| bytes from |in|. It can be called
35 // zero or more times after poly1305_init.
37  const uint8_t *in, size_t in_len);
38 
39 // CRYPTO_poly1305_finish completes the poly1305 calculation and writes a 16
40 // byte authentication tag to |mac|.
42  uint8_t mac[16]);
43 
44 
45 #if defined(__cplusplus)
46 } // extern C
47 #endif
48 
49 #endif // OPENSSL_HEADER_POLY1305_H
CRYPTO_poly1305_update
OPENSSL_EXPORT void CRYPTO_poly1305_update(poly1305_state *state, const uint8_t *in, size_t in_len)
Definition: poly1305.c:205
CRYPTO_poly1305_finish
OPENSSL_EXPORT void CRYPTO_poly1305_finish(poly1305_state *state, uint8_t mac[16])
Definition: poly1305.c:249
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
base.h
in
const char * in
Definition: third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc:391
CRYPTO_poly1305_init
OPENSSL_EXPORT void CRYPTO_poly1305_init(poly1305_state *state, const uint8_t key[32])
Definition: poly1305.c:159
key
const char * key
Definition: hpack_parser_table.cc:164
OPENSSL_EXPORT
#define OPENSSL_EXPORT
Definition: base.h:222
state
Definition: bloaty/third_party/zlib/contrib/blast/blast.c:41
poly1305_state
uint8_t poly1305_state[512]
Definition: poly1305.h:25


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:53