SM3 hash function. More...
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL CRYPTO_TRACE_LEVEL |
#define | W(n) w[(n) & 0x0F] |
#define | FF1(x, y, z) ((x) ^ (y) ^ (z)) |
#define | FF2(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) |
#define | GG1(x, y, z) ((x) ^ (y) ^ (z)) |
#define | GG2(x, y, z) (((x) & (y)) | ((~x) & (z))) |
#define | P0(x) ((x) ^ ROL32(x, 9) ^ ROL32(x, 17)) |
#define | P1(x) ((x) ^ ROL32(x, 15) ^ ROL32(x, 23)) |
#define | TJ1 0x79CC4519 |
#define | TJ2 0x7A879D8A |
Functions | |
error_t | sm3Compute (const void *data, size_t length, uint8_t *digest) |
Digest a message using SM3. More... | |
void | sm3Init (Sm3Context *context) |
Initialize SM3 message digest context. More... | |
void | sm3Update (Sm3Context *context, const void *data, size_t length) |
Update the SM3 context with a portion of the message being hashed. More... | |
void | sm3Final (Sm3Context *context, uint8_t *digest) |
Finish the SM3 message digest. More... | |
void | sm3FinalRaw (Sm3Context *context, uint8_t *digest) |
Finish the SM3 message digest (no padding added) More... | |
void | sm3ProcessBlock (Sm3Context *context) |
Process message in 16-word blocks. More... | |
Variables | |
const uint8_t | SM3_OID [6] = {0x28, 0xCF, 0x06, 0x03, 0x00, 0x41} |
const HashAlgo | sm3HashAlgo |
Detailed Description
SM3 hash function.
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 sm3.c.
Macro Definition Documentation
◆ FF1
◆ FF2
◆ GG1
◆ GG2
◆ P0
◆ P1
◆ TJ1
◆ TJ2
◆ TRACE_LEVEL
◆ W
Function Documentation
◆ sm3Compute()
error_t sm3Compute | ( | const void * | data, |
size_t | length, | ||
uint8_t * | digest | ||
) |
◆ sm3Final()
void sm3Final | ( | Sm3Context * | context, |
uint8_t * | digest | ||
) |
◆ sm3FinalRaw()
void sm3FinalRaw | ( | Sm3Context * | context, |
uint8_t * | digest | ||
) |
◆ sm3Init()
void sm3Init | ( | Sm3Context * | context | ) |
◆ sm3ProcessBlock()
void sm3ProcessBlock | ( | Sm3Context * | context | ) |
◆ sm3Update()
void sm3Update | ( | Sm3Context * | context, |
const void * | data, | ||
size_t | length | ||
) |
Variable Documentation
◆ SM3_OID
const uint8_t SM3_OID[6] = {0x28, 0xCF, 0x06, 0x03, 0x00, 0x41} |
◆ sm3HashAlgo
const HashAlgo sm3HashAlgo |