xtea.h File Reference

XTEA (eXtended TEA) More...

#include "core/crypto.h"

Go to the source code of this file.

Data Structures

struct  XteaContext
 XTEA algorithm context. More...
 

Macros

#define XTEA_PRIVATE_CONTEXT
 
#define XTEA_BLOCK_SIZE   8
 
#define XTEA_NB_ROUNDS   32
 
#define XTEA_CIPHER_ALGO   (&xteaCipherAlgo)
 

Functions

error_t xteaInit (XteaContext *context, const uint8_t *key, size_t keyLen)
 Key expansion. More...
 
void xteaEncryptBlock (XteaContext *context, const uint8_t *input, uint8_t *output)
 Encrypt a 16-byte block using XTEA algorithm. More...
 
void xteaDecryptBlock (XteaContext *context, const uint8_t *input, uint8_t *output)
 Decrypt a 16-byte block using XTEA algorithm. More...
 
void xteaDeinit (XteaContext *context)
 Release XTEA context. More...
 

Variables

const CipherAlgo xteaCipherAlgo
 

Detailed Description

XTEA (eXtended TEA)

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 xtea.h.

Macro Definition Documentation

◆ XTEA_BLOCK_SIZE

#define XTEA_BLOCK_SIZE   8

Definition at line 43 of file xtea.h.

◆ XTEA_CIPHER_ALGO

#define XTEA_CIPHER_ALGO   (&xteaCipherAlgo)

Definition at line 47 of file xtea.h.

◆ XTEA_NB_ROUNDS

#define XTEA_NB_ROUNDS   32

Definition at line 45 of file xtea.h.

◆ XTEA_PRIVATE_CONTEXT

#define XTEA_PRIVATE_CONTEXT

Definition at line 39 of file xtea.h.

Function Documentation

◆ xteaDecryptBlock()

void xteaDecryptBlock ( XteaContext context,
const uint8_t *  input,
uint8_t *  output 
)

Decrypt a 16-byte block using XTEA algorithm.

Parameters
[in]contextPointer to the XTEA context
[in]inputCiphertext block to decrypt
[out]outputPlaintext block resulting from decryption

Decrypt a 16-byte block using XTEA algorithm.

Parameters
[in]contextPointer to the XTEA context
[in]inputCiphertext block to decrypt
[out]outputPlaintext block resulting from decryption

Definition at line 134 of file xtea.c.

◆ xteaDeinit()

void xteaDeinit ( XteaContext context)

Release XTEA context.

Parameters
[in]contextPointer to the XTEA context

Definition at line 168 of file xtea.c.

◆ xteaEncryptBlock()

void xteaEncryptBlock ( XteaContext context,
const uint8_t *  input,
uint8_t *  output 
)

Encrypt a 16-byte block using XTEA algorithm.

Parameters
[in]contextPointer to the XTEA context
[in]inputPlaintext block to encrypt
[out]outputCiphertext block resulting from encryption

Encrypt a 16-byte block using XTEA algorithm.

Parameters
[in]contextPointer to the XTEA context
[in]inputPlaintext block to encrypt
[out]outputCiphertext block resulting from encryption

Definition at line 98 of file xtea.c.

◆ xteaInit()

error_t xteaInit ( XteaContext context,
const uint8_t *  key,
size_t  keyLen 
)

Key expansion.

Parameters
[in]contextPointer to the XTEA context to initialize
[in]keyPointer to the key
[in]keyLenLength of the key
Returns
Error code

Key expansion.

Parameters
[in]contextPointer to the XTEA context to initialize
[in]keyPointer to the key
[in]keyLenLength of the key (must be set to 16)
Returns
Error code

Definition at line 69 of file xtea.c.

Variable Documentation

◆ xteaCipherAlgo

const CipherAlgo xteaCipherAlgo
extern

Definition at line 46 of file xtea.c.