My Project
Loading...
Searching...
No Matches
poly1305.h File Reference

Go to the source code of this file.

Data Structures

struct  Poly1305
 

Typedefs

typedef struct Poly1305 Poly1305
 

Functions

WOLFSSL_API int wc_Poly1305SetKey (Poly1305 *poly1305, const byte *key, word32 kySz)
 This function sets the key for a Poly1305 context structure, initializing it for hashing. Note: A new key should be set after generating a message hash with wc_Poly1305Final to ensure security.
 
WOLFSSL_API int wc_Poly1305Update (Poly1305 *poly1305, const byte *, word32)
 This function updates the message to hash with the Poly1305 structure.
 
WOLFSSL_API int wc_Poly1305Final (Poly1305 *poly1305, byte *tag)
 This function calculates the hash of the input messages and stores the result in mac. After this is called, the key should be reset.
 
WOLFSSL_API int wc_Poly1305_Pad (Poly1305 *ctx, word32 lenToPad)
 
WOLFSSL_API int wc_Poly1305_EncodeSizes (Poly1305 *ctx, word32 aadSz, word32 dataSz)
 
WOLFSSL_API int wc_Poly1305_MAC (Poly1305 *ctx, byte *additional, word32 addSz, byte *input, word32 sz, byte *tag, word32 tagSz)
 Takes in an initialized Poly1305 struct that has a key loaded and creates a MAC (tag) using recent TLS AEAD padding scheme.
 
void poly1305_block (Poly1305 *ctx, const unsigned char *m)
 
void poly1305_blocks (Poly1305 *ctx, const unsigned char *m, size_t bytes)
 

Variables

 C
 

Variable Documentation

◆ C

C
extern
Initial value:
{
#endif
#if defined(__SIZEOF_INT128__) && defined(__LP64__)
#define WC_HAS_SIZEOF_INT128_64BIT
#endif
#if defined(_MSC_VER) && defined(_M_X64)
#define WC_HAS_MSVC_64BIT
#endif
#if (defined(__GNUC__) && defined(__LP64__) && \
((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4))))
#define WC_HAS_GCC_4_4_64BIT
#endif
#ifdef USE_INTEL_SPEEDUP
#elif (defined(WC_HAS_SIZEOF_INT128_64BIT) || defined(WC_HAS_MSVC_64BIT) || \
defined(WC_HAS_GCC_4_4_64BIT))
#define POLY130564
#else
#define POLY130532
#endif
enum {
POLY1305 = 7,
POLY1305_BLOCK_SIZE = 16,
POLY1305_DIGEST_SIZE = 16,
}