libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / libsodium / src / libsodium / crypto_onetimeauth / poly1305 / onetimeauth_poly1305.c
blobfc2bc1ac4fde941557f5c91670739a22a1da03be
2 #include <sys/types.h>
4 #include <assert.h>
5 #include <inttypes.h>
6 #include <limits.h>
8 #include "crypto_onetimeauth_poly1305.h"
9 #include "crypto_onetimeauth_poly1305_ref.h"
11 static const crypto_onetimeauth_poly1305_implementation *implementation =
12 &crypto_onetimeauth_poly1305_ref_implementation;
14 int
15 crypto_onetimeauth_poly1305_set_implementation(crypto_onetimeauth_poly1305_implementation *impl)
17 implementation = impl;
19 return 0;
22 const char *
23 crypto_onetimeauth_poly1305_implementation_name(void)
25 return implementation->implementation_name();
28 int
29 crypto_onetimeauth_poly1305(unsigned char *out, const unsigned char *in,
30 unsigned long long inlen, const unsigned char *k)
32 return implementation->onetimeauth(out, in, inlen, k);
35 int
36 crypto_onetimeauth_poly1305_verify(const unsigned char *h,
37 const unsigned char *in,
38 unsigned long long inlen,
39 const unsigned char *k)
41 return implementation->onetimeauth_verify(h, in, inlen, k);