Serpent encryption algorithm. More...
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL CRYPTO_TRACE_LEVEL |
#define | PHI 0x9E3779B9 |
#define | SBOX0(r0, r1, r2, r3) |
#define | SBOX0_INV(r0, r1, r2, r3) |
#define | SBOX1(r0, r1, r2, r3) |
#define | SBOX1_INV(r0, r1, r2, r3) |
#define | SBOX2(r0, r1, r2, r3) |
#define | SBOX2_INV(r0, r1, r2, r3) |
#define | SBOX3(r0, r1, r2, r3) |
#define | SBOX3_INV(r0, r1, r2, r3) |
#define | SBOX4(r0, r1, r2, r3) |
#define | SBOX4_INV(r0, r1, r2, r3) |
#define | SBOX5(r0, r1, r2, r3) |
#define | SBOX5_INV(r0, r1, r2, r3) |
#define | SBOX6(r0, r1, r2, r3) |
#define | SBOX6_INV(r0, r1, r2, r3) |
#define | SBOX7(r0, r1, r2, r3) |
#define | SBOX7_INV(r0, r1, r2, r3) |
#define | LT(x0, x1, x2, x3) |
#define | LT_INV(x0, x1, x2, x3) |
#define | XOR(x0, x1, x2, x3, k) |
#define | ROUND(n, x0, x1, x2, x3, k) |
#define | ROUND_INV(n, x0, x1, x2, x3, k) |
Functions | |
error_t | serpentInit (SerpentContext *context, const uint8_t *key, size_t keyLen) |
Key expansion. More... | |
void | serpentEncryptBlock (SerpentContext *context, const uint8_t *input, uint8_t *output) |
Encrypt a 16-byte block using Serpent algorithm. More... | |
void | serpentDecryptBlock (SerpentContext *context, const uint8_t *input, uint8_t *output) |
Decrypt a 16-byte block using Serpent algorithm. More... | |
void | serpentDeinit (SerpentContext *context) |
Release Serpent context. More... | |
Variables | |
const CipherAlgo | serpentCipherAlgo |
Detailed Description
Serpent encryption algorithm.
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.
Description
Serpent is a block cipher algorithm which supports a key size of 128, 192 or 256 bits. S-box functions are implemented as per Dag Arne Osvik's paper "Speeding up Serpent"
- Version
- 2.4.4
Definition in file serpent.c.
Macro Definition Documentation
◆ LT
#define LT | ( | x0, | |
x1, | |||
x2, | |||
x3 | |||
) |
◆ LT_INV
#define LT_INV | ( | x0, | |
x1, | |||
x2, | |||
x3 | |||
) |
◆ PHI
◆ ROUND
#define ROUND | ( | n, | |
x0, | |||
x1, | |||
x2, | |||
x3, | |||
k | |||
) |
◆ ROUND_INV
#define ROUND_INV | ( | n, | |
x0, | |||
x1, | |||
x2, | |||
x3, | |||
k | |||
) |
◆ SBOX0
#define SBOX0 | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ SBOX0_INV
#define SBOX0_INV | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ SBOX1
#define SBOX1 | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ SBOX1_INV
#define SBOX1_INV | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ SBOX2
#define SBOX2 | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ SBOX2_INV
#define SBOX2_INV | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ SBOX3
#define SBOX3 | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ SBOX3_INV
#define SBOX3_INV | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ SBOX4
#define SBOX4 | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ SBOX4_INV
#define SBOX4_INV | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ SBOX5
#define SBOX5 | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ SBOX5_INV
#define SBOX5_INV | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ SBOX6
#define SBOX6 | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ SBOX6_INV
#define SBOX6_INV | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ SBOX7
#define SBOX7 | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ SBOX7_INV
#define SBOX7_INV | ( | r0, | |
r1, | |||
r2, | |||
r3 | |||
) |
◆ TRACE_LEVEL
◆ XOR
#define XOR | ( | x0, | |
x1, | |||
x2, | |||
x3, | |||
k | |||
) |
Function Documentation
◆ serpentDecryptBlock()
void serpentDecryptBlock | ( | SerpentContext * | context, |
const uint8_t * | input, | ||
uint8_t * | output | ||
) |
◆ serpentDeinit()
void serpentDeinit | ( | SerpentContext * | context | ) |
◆ serpentEncryptBlock()
void serpentEncryptBlock | ( | SerpentContext * | context, |
const uint8_t * | input, | ||
uint8_t * | output | ||
) |
◆ serpentInit()
error_t serpentInit | ( | SerpentContext * | context, |
const uint8_t * | key, | ||
size_t | keyLen | ||
) |
Variable Documentation
◆ serpentCipherAlgo
const CipherAlgo serpentCipherAlgo |