diff --git a/src/libsodium/crypto_onetimeauth/crypto_onetimeauth.c b/src/libsodium/crypto_onetimeauth/crypto_onetimeauth.c index 19c6e71b..2af0fdac 100644 --- a/src/libsodium/crypto_onetimeauth/crypto_onetimeauth.c +++ b/src/libsodium/crypto_onetimeauth/crypto_onetimeauth.c @@ -32,3 +32,28 @@ crypto_onetimeauth_verify(const unsigned char *h, const unsigned char *in, { return crypto_onetimeauth_poly1305_verify(h, in, inlen, k); } + +int +crypto_onetimeauth_init(crypto_onetimeauth_state *state, + const unsigned char *key) +{ + return crypto_onetimeauth_poly1305_init + ((crypto_onetimeauth_poly1305_state *) state, key); +} + +int +crypto_onetimeauth_update(crypto_onetimeauth_state *state, + const unsigned char *in, + unsigned long long inlen) +{ + return crypto_onetimeauth_poly1305_update + ((crypto_onetimeauth_poly1305_state *) state, in, inlen); +} + +int +crypto_onetimeauth_final(crypto_onetimeauth_state *state, + unsigned char *out) +{ + return crypto_onetimeauth_poly1305_final + ((crypto_onetimeauth_poly1305_state *) state, out); +} diff --git a/src/libsodium/include/sodium/crypto_onetimeauth.h b/src/libsodium/include/sodium/crypto_onetimeauth.h index 98c9d680..02d41a9e 100644 --- a/src/libsodium/include/sodium/crypto_onetimeauth.h +++ b/src/libsodium/include/sodium/crypto_onetimeauth.h @@ -13,6 +13,8 @@ extern "C" { #endif +typedef crypto_onetimeauth_poly1305_state crypto_onetimeauth_state; + #define crypto_onetimeauth_BYTES crypto_onetimeauth_poly1305_BYTES SODIUM_EXPORT size_t crypto_onetimeauth_bytes(void); @@ -33,6 +35,19 @@ SODIUM_EXPORT int crypto_onetimeauth_verify(const unsigned char *h, const unsigned char *in, unsigned long long inlen, const unsigned char *k); +SODIUM_EXPORT +int crypto_onetimeauth_init(crypto_onetimeauth_state *state, + const unsigned char *key); + +SODIUM_EXPORT +int crypto_onetimeauth_update(crypto_onetimeauth_state *state, + const unsigned char *in, + unsigned long long inlen); + +SODIUM_EXPORT +int crypto_onetimeauth_final(crypto_onetimeauth_state *state, + unsigned char *out); + #ifdef __cplusplus } #endif