poly1305

Poly1305 one-time message authentication code. More...

Detailed Description

Poly1305 one-time message authentication code.

Poly1305 is a one-time authenticator designed by D.J. Bernstein. It uses a 32-byte one-time key and a message and produces a 16-byte tag.

Files

file  poly1305.h
 Poly1305 MAC interface.
 

Data Structures

struct  poly1305_ctx_t
 Poly1305 context. More...
 

Macros

#define POLY1305_BLOCK_SIZE   16
 Poly1305 block size.
 

Functions

void poly1305_init (poly1305_ctx_t *ctx, const uint8_t *key)
 Initialize a poly1305 context. More...
 
void poly1305_update (poly1305_ctx_t *ctx, const uint8_t *data, size_t len)
 Update the poly1305 context with a block of message. More...
 
void poly1305_finish (poly1305_ctx_t *ctx, uint8_t *mac)
 Finish the poly1305 operation. More...
 
void poly1305_auth (uint8_t *mac, const uint8_t *data, size_t len, const uint8_t *key)
 Calculate a single poly1305 tag. More...
 

Function Documentation

◆ poly1305_auth()

void poly1305_auth ( uint8_t *  mac,
const uint8_t *  data,
size_t  len,
const uint8_t *  key 
)

Calculate a single poly1305 tag.

Parameters
mac16 byte buffer for the tag
dataptr to the message
lenlength of the message
key32 byte key

◆ poly1305_finish()

void poly1305_finish ( poly1305_ctx_t ctx,
uint8_t *  mac 
)

Finish the poly1305 operation.

Parameters
ctxpoly1305 context
mac16 byte buffer for the tag

◆ poly1305_init()

void poly1305_init ( poly1305_ctx_t ctx,
const uint8_t *  key 
)

Initialize a poly1305 context.

Parameters
ctxPoly1305 context
key32 byte key

◆ poly1305_update()

void poly1305_update ( poly1305_ctx_t ctx,
const uint8_t *  data,
size_t  len 
)

Update the poly1305 context with a block of message.

Parameters
ctxpoly1305 context
dataptr to the message
lenlength of the message