SM4 encryption algorithm. More...
#include "core/crypto.h"
Go to the source code of this file.
Data Structures | |
struct | Sm4Context |
SM4 algorithm context. More... | |
Macros | |
#define | SM4_PRIVATE_CONTEXT |
#define | SM4_BLOCK_SIZE 16 |
#define | SM4_CIPHER_ALGO (&sm4CipherAlgo) |
Functions | |
error_t | sm4Init (Sm4Context *context, const uint8_t *key, size_t keyLen) |
Key expansion. More... | |
void | sm4EncryptBlock (Sm4Context *context, const uint8_t *input, uint8_t *output) |
Encrypt a 16-byte block using SM4 algorithm. More... | |
void | sm4DecryptBlock (Sm4Context *context, const uint8_t *input, uint8_t *output) |
Decrypt a 16-byte block using SM4 algorithm. More... | |
void | sm4Deinit (Sm4Context *context) |
Release SM4 context. More... | |
Variables | |
const uint8_t | SM4_CBC_OID [8] |
const uint8_t | SM4_ECB_OID [8] |
const uint8_t | SM4_OFB_OID [8] |
const uint8_t | SM4_CFB_OID [8] |
const uint8_t | SM4_CTR_OID [8] |
const uint8_t | SM4_GCM_OID [8] |
const uint8_t | SM4_CCM_OID [8] |
const uint8_t | SM4_XTS_OID [8] |
const CipherAlgo | sm4CipherAlgo |
Detailed Description
SM4 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.
- Version
- 2.4.4
Definition in file sm4.h.
Macro Definition Documentation
◆ SM4_BLOCK_SIZE
◆ SM4_CIPHER_ALGO
#define SM4_CIPHER_ALGO (&sm4CipherAlgo) |
◆ SM4_PRIVATE_CONTEXT
Function Documentation
◆ sm4DecryptBlock()
void sm4DecryptBlock | ( | Sm4Context * | context, |
const uint8_t * | input, | ||
uint8_t * | output | ||
) |
◆ sm4Deinit()
void sm4Deinit | ( | Sm4Context * | context | ) |
◆ sm4EncryptBlock()
void sm4EncryptBlock | ( | Sm4Context * | context, |
const uint8_t * | input, | ||
uint8_t * | output | ||
) |
◆ sm4Init()
error_t sm4Init | ( | Sm4Context * | context, |
const uint8_t * | key, | ||
size_t | keyLen | ||
) |
Variable Documentation
◆ SM4_CBC_OID
◆ SM4_CCM_OID
◆ SM4_CFB_OID
◆ SM4_CTR_OID
◆ SM4_ECB_OID
◆ SM4_GCM_OID
◆ SM4_OFB_OID
◆ SM4_XTS_OID
◆ sm4CipherAlgo
|
extern |