Camellia encryption algorithm. More...
Go to the source code of this file.
Macros | |
| #define | TRACE_LEVEL CRYPTO_TRACE_LEVEL |
| #define | F(xl, xr, kl, kr) |
| #define | FL(xl, xr, kl, kr) |
| #define | FL_INV(yl, yr, kl, kr) |
| #define | S(zl, zr) |
| #define | P(zl, zr) |
| #define | ROUND(left1, left2, right1, right2, k1, k2) |
| #define | KL 0 |
| #define | KR 4 |
| #define | KA 8 |
| #define | KB 12 |
| #define | L 0 |
| #define | R 64 |
Functions | |
| error_t | camelliaInit (CamelliaContext *context, const uint8_t *key, size_t keyLen) |
| Initialize a Camellia context using the supplied key. More... | |
| void | camelliaEncryptBlock (CamelliaContext *context, const uint8_t *input, uint8_t *output) |
| Encrypt a 16-byte block using Camellia algorithm. More... | |
| void | camelliaDecryptBlock (CamelliaContext *context, const uint8_t *input, uint8_t *output) |
| Decrypt a 16-byte block using Camellia algorithm. More... | |
| void | camelliaDeinit (CamelliaContext *context) |
| Release Camellia context. More... | |
Variables | |
| const uint8_t | CAMELLIA128_CBC_OID [11] = {0x2A, 0x83, 0x08, 0x8C, 0x9A, 0x4B, 0x3D, 0x01, 0x01, 0x01, 0x02} |
| const uint8_t | CAMELLIA192_CBC_OID [11] = {0x2A, 0x83, 0x08, 0x8C, 0x9A, 0x4B, 0x3D, 0x01, 0x01, 0x01, 0x03} |
| const uint8_t | CAMELLIA256_CBC_OID [11] = {0x2A, 0x83, 0x08, 0x8C, 0x9A, 0x4B, 0x3D, 0x01, 0x01, 0x01, 0x04} |
| const CipherAlgo | camelliaCipherAlgo |
Detailed Description
Camellia encryption algorithm.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2025 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
Camellia is an encryption algorithm designed to encipher and decipher blocks of 128 bits under control of a 128/192/256-bit secret key
- Version
- 2.5.4
Definition in file camellia.c.
Macro Definition Documentation
◆ F
| #define F | ( | xl, | |
| xr, | |||
| kl, | |||
| kr | |||
| ) |
Definition at line 48 of file camellia.c.
◆ FL
| #define FL | ( | xl, | |
| xr, | |||
| kl, | |||
| kr | |||
| ) |
Definition at line 57 of file camellia.c.
◆ FL_INV
| #define FL_INV | ( | yl, | |
| yr, | |||
| kl, | |||
| kr | |||
| ) |
Definition at line 65 of file camellia.c.
◆ KA
| #define KA 8 |
Definition at line 112 of file camellia.c.
◆ KB
| #define KB 12 |
Definition at line 113 of file camellia.c.
◆ KL
| #define KL 0 |
Definition at line 110 of file camellia.c.
◆ KR
| #define KR 4 |
Definition at line 111 of file camellia.c.
◆ L
| #define L 0 |
Definition at line 114 of file camellia.c.
◆ P
| #define P | ( | zl, | |
| zr | |||
| ) |
◆ R
| #define R 64 |
Definition at line 115 of file camellia.c.
◆ ROUND
| #define ROUND | ( | left1, | |
| left2, | |||
| right1, | |||
| right2, | |||
| k1, | |||
| k2 | |||
| ) |
Definition at line 95 of file camellia.c.
◆ S
| #define S | ( | zl, | |
| zr | |||
| ) |
Definition at line 73 of file camellia.c.
◆ TRACE_LEVEL
| #define TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Definition at line 37 of file camellia.c.
Function Documentation
◆ camelliaDecryptBlock()
| void camelliaDecryptBlock | ( | CamelliaContext * | context, |
| const uint8_t * | input, | ||
| uint8_t * | output | ||
| ) |
Decrypt a 16-byte block using Camellia algorithm.
- Parameters
-
[in] context Pointer to the Camellia context [in] input Ciphertext block to decrypt [out] output Plaintext block resulting from decryption
Definition at line 537 of file camellia.c.
◆ camelliaDeinit()
| void camelliaDeinit | ( | CamelliaContext * | context | ) |
Release Camellia context.
- Parameters
-
[in] context Pointer to the Camellia context
Definition at line 614 of file camellia.c.
◆ camelliaEncryptBlock()
| void camelliaEncryptBlock | ( | CamelliaContext * | context, |
| const uint8_t * | input, | ||
| uint8_t * | output | ||
| ) |
Encrypt a 16-byte block using Camellia algorithm.
- Parameters
-
[in] context Pointer to the Camellia context [in] input Plaintext block to encrypt [out] output Ciphertext block resulting from encryption
Definition at line 465 of file camellia.c.
◆ camelliaInit()
| error_t camelliaInit | ( | CamelliaContext * | context, |
| const uint8_t * | key, | ||
| size_t | keyLen | ||
| ) |
Initialize a Camellia context using the supplied key.
- Parameters
-
[in] context Pointer to the Camellia context to initialize [in] key Pointer to the key [in] keyLen Length of the key
- Returns
- Error code
Definition at line 313 of file camellia.c.
Variable Documentation
◆ CAMELLIA128_CBC_OID
| const uint8_t CAMELLIA128_CBC_OID[11] = {0x2A, 0x83, 0x08, 0x8C, 0x9A, 0x4B, 0x3D, 0x01, 0x01, 0x01, 0x02} |
Definition at line 283 of file camellia.c.
◆ CAMELLIA192_CBC_OID
| const uint8_t CAMELLIA192_CBC_OID[11] = {0x2A, 0x83, 0x08, 0x8C, 0x9A, 0x4B, 0x3D, 0x01, 0x01, 0x01, 0x03} |
Definition at line 285 of file camellia.c.
◆ CAMELLIA256_CBC_OID
| const uint8_t CAMELLIA256_CBC_OID[11] = {0x2A, 0x83, 0x08, 0x8C, 0x9A, 0x4B, 0x3D, 0x01, 0x01, 0x01, 0x04} |
Definition at line 287 of file camellia.c.
◆ camelliaCipherAlgo
| const CipherAlgo camelliaCipherAlgo |
Definition at line 290 of file camellia.c.
