diff options
Diffstat (limited to 'src/lib/libcrypto/poly1305/poly1305.c')
-rw-r--r-- | src/lib/libcrypto/poly1305/poly1305.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/lib/libcrypto/poly1305/poly1305.c b/src/lib/libcrypto/poly1305/poly1305.c new file mode 100644 index 0000000000..96083fe7e9 --- /dev/null +++ b/src/lib/libcrypto/poly1305/poly1305.c | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2014 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 | #include "poly1305.h" | ||
18 | #include "poly1305-donna.c" | ||
19 | |||
20 | void | ||
21 | CRYPTO_poly1305_init(poly1305_context *ctx, const unsigned char key[32]) | ||
22 | { | ||
23 | poly1305_init(ctx, key); | ||
24 | } | ||
25 | |||
26 | void | ||
27 | CRYPTO_poly1305_update(poly1305_context *ctx, const unsigned char *in, | ||
28 | size_t len) | ||
29 | { | ||
30 | poly1305_update(ctx, in, len); | ||
31 | } | ||
32 | |||
33 | void | ||
34 | CRYPTO_poly1305_finish(poly1305_context *ctx, unsigned char mac[16]) | ||
35 | { | ||
36 | poly1305_finish(ctx, mac); | ||
37 | } | ||