diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/poly1305/poly1305.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/lib/libcrypto/poly1305/poly1305.h b/src/lib/libcrypto/poly1305/poly1305.h new file mode 100644 index 0000000000..a4ccdd5d80 --- /dev/null +++ b/src/lib/libcrypto/poly1305/poly1305.h | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) Joel Sing <jsing@openbsd.org> | ||
| 3 | * | ||
| 4 | * Permission to use, copy, modify, and distribute this software for any | ||
| 5 | * purpose with or without fee is hereby granted, provided that the above | ||
| 6 | * copyright notice and this permission notice appear in all copies. | ||
| 7 | * | ||
| 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef HEADER_POLY1305_H | ||
| 18 | #define HEADER_POLY1305_H | ||
| 19 | |||
| 20 | #include <openssl/opensslconf.h> | ||
| 21 | |||
| 22 | #if defined(OPENSSL_NO_POLY1305) | ||
| 23 | #error Poly1305 is disabled. | ||
| 24 | #endif | ||
| 25 | |||
| 26 | #include <stddef.h> | ||
| 27 | |||
| 28 | #ifdef __cplusplus | ||
| 29 | extern "C" { | ||
| 30 | #endif | ||
| 31 | |||
| 32 | typedef struct poly1305_context { | ||
| 33 | size_t aligner; | ||
| 34 | unsigned char opaque[136]; | ||
| 35 | } poly1305_context; | ||
| 36 | |||
| 37 | typedef struct poly1305_context poly1305_state; | ||
| 38 | |||
| 39 | void CRYPTO_poly1305_init(poly1305_context *ctx, const unsigned char key[32]); | ||
| 40 | void CRYPTO_poly1305_update(poly1305_context *ctx, const unsigned char *in, | ||
| 41 | size_t len); | ||
| 42 | void CRYPTO_poly1305_finish(poly1305_context *ctx, unsigned char mac[16]); | ||
| 43 | |||
| 44 | #ifdef __cplusplus | ||
| 45 | } | ||
| 46 | #endif | ||
| 47 | |||
| 48 | #endif /* HEADER_POLY1305_H */ | ||
