andre@0: /* andre@0: * poly1305.h - header file for Poly1305 implementation. andre@0: * andre@0: * This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: andre@0: #ifndef FREEBL_POLY1305_H_ andre@0: #define FREEBL_POLY1305_H_ andre@0: andre@0: typedef unsigned char poly1305_state[512]; andre@0: andre@0: /* Poly1305Init sets up |state| so that it can be used to calculate an andre@0: * authentication tag with the one-time key |key|. Note that |key| is a andre@0: * one-time key and therefore there is no `reset' method because that would andre@0: * enable several messages to be authenticated with the same key. */ andre@0: extern void Poly1305Init(poly1305_state* state, andre@0: const unsigned char key[32]); andre@0: andre@0: /* Poly1305Update processes |in_len| bytes from |in|. It can be called zero or andre@0: * more times after poly1305_init. */ andre@0: extern void Poly1305Update(poly1305_state* state, andre@0: const unsigned char *in, andre@0: size_t inLen); andre@0: andre@0: /* Poly1305Finish completes the poly1305 calculation and writes a 16 byte andre@0: * authentication tag to |mac|. */ andre@0: extern void Poly1305Finish(poly1305_state* state, andre@0: unsigned char mac[16]); andre@0: andre@0: #endif /* FREEBL_POLY1305_H_ */