poly1305.c File Reference

Poly1305 message-authentication code. More...

#include "core/crypto.h"
#include "mac/poly1305.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL
 

Functions

void poly1305Init (Poly1305Context *context, const uint8_t *key)
 Initialize Poly1305 message-authentication code computation. More...
 
void poly1305Update (Poly1305Context *context, const void *data, size_t length)
 Update Poly1305 message-authentication code computation. More...
 
void poly1305Final (Poly1305Context *context, uint8_t *tag)
 Finalize Poly1305 message-authentication code computation. More...
 
void poly1305ProcessBlock (Poly1305Context *context)
 Process message in 16-byte blocks. More...
 

Detailed Description

Poly1305 message-authentication code.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneCRYPTO Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file poly1305.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL

Definition at line 32 of file poly1305.c.

Function Documentation

◆ poly1305Final()

void poly1305Final ( Poly1305Context context,
uint8_t *  tag 
)

Finalize Poly1305 message-authentication code computation.

Parameters
[in]contextPointer to the Poly1305 context
[out]tagCalculated message-authentication code

Definition at line 127 of file poly1305.c.

◆ poly1305Init()

void poly1305Init ( Poly1305Context context,
const uint8_t *  key 
)

Initialize Poly1305 message-authentication code computation.

Parameters
[in]contextPointer to the Poly1305 context to initialize
[in]keyPointer to the 256-bit key

Definition at line 49 of file poly1305.c.

◆ poly1305ProcessBlock()

void poly1305ProcessBlock ( Poly1305Context context)

Process message in 16-byte blocks.

Parameters
[in]contextPointer to the Poly1305 context

Definition at line 213 of file poly1305.c.

◆ poly1305Update()

void poly1305Update ( Poly1305Context context,
const void *  data,
size_t  length 
)

Update Poly1305 message-authentication code computation.

Parameters
[in]contextPointer to the Poly1305 context
[in]dataPointer to the input message
[in]lengthLength of the input message

Definition at line 89 of file poly1305.c.