diff options
author | jsing <> | 2014-05-14 14:46:35 +0000 |
---|---|---|
committer | jsing <> | 2014-05-14 14:46:35 +0000 |
commit | f6a32a464c0b9c45d6390e4766b189b611a8450b (patch) | |
tree | 2438466190276223517edaaed7b9d5a6c90b9c72 /src/lib/libcrypto/poly1305/poly1305.c | |
parent | 6547059af7517b798a6e0027d4d2b4edb203a9bb (diff) | |
download | openbsd-f6a32a464c0b9c45d6390e4766b189b611a8450b.tar.gz openbsd-f6a32a464c0b9c45d6390e4766b189b611a8450b.tar.bz2 openbsd-f6a32a464c0b9c45d6390e4766b189b611a8450b.zip |
Add poly1305 to libcrypto utilising Andrew Moon's public domain
implementation.
ok miod@
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 | } | ||