CycloneBOOT 2.6.6
Secure Bootloader for ARM Cortex-M MCU
Loading...
Searching...
No Matches
crc32.c File Reference

CRC32 cryptographic integrity tag. More...

#include "core/crc32.h"
#include "core/crypto.h"
#include "debug.h"

Macros

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL
 

Functions

error_t crc32Compute (const void *data, size_t length, uint8_t *digest)
 Digest a message using CRC32.
 
void crc32Init (Crc32Context *context)
 Initialize CRC32 message digest context.
 
void crc32Update (Crc32Context *context, const void *data, size_t length)
 Update the CRC32 context with a portion of the message being hashed.
 
void crc32Final (Crc32Context *context, uint8_t *digest)
 Finish the CRC32 message digest.
 

Variables

const HashAlgo crc32HashAlgo
 

Detailed Description

CRC32 cryptographic integrity tag.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2021-2026 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneBOOT 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.6.6

Function Documentation

◆ crc32Compute()

error_t crc32Compute ( const void *  data,
size_t  length,
uint8_t *  digest 
)

Digest a message using CRC32.

Parameters
[in]dataPointer to the message being hashed
[in]lengthLength of the message
[out]digestPointer to the calculated digest
Returns
Error code

◆ crc32Final()

void crc32Final ( Crc32Context *  context,
uint8_t *  digest 
)

Finish the CRC32 message digest.

Parameters
[in]contextPointer to the CRC32 context
[out]digestCalculated digest (optional parameter)

◆ crc32Init()

void crc32Init ( Crc32Context *  context)

Initialize CRC32 message digest context.

Parameters
[in]contextPointer to the CRC32 context to initialize

◆ crc32Update()

void crc32Update ( Crc32Context *  context,
const void *  data,
size_t  length 
)

Update the CRC32 context with a portion of the message being hashed.

Parameters
[in]contextPointer to the CRC32 context
[in]dataPointer to the buffer being hashed
[in]lengthLength of the buffer

Variable Documentation

◆ crc32HashAlgo

const HashAlgo crc32HashAlgo
Initial value:
= {"CRC32",
NULL,
0,
sizeof(Crc32Context),
1,
CRC32_DIGEST_SIZE,
0,
FALSE,
(HashAlgoCompute)crc32Compute,
(HashAlgoInit)crc32Init,
(HashAlgoUpdate)crc32Update,
(HashAlgoFinal)crc32Final,
(HashAlgoFinalRaw)NULL}
void crc32Final(Crc32Context *context, uint8_t *digest)
Finish the CRC32 message digest.
Definition crc32.c:161
error_t crc32Compute(const void *data, size_t length, uint8_t *digest)
Digest a message using CRC32.
Definition crc32.c:99
void crc32Init(Crc32Context *context)
Initialize CRC32 message digest context.
Definition crc32.c:119
void crc32Update(Crc32Context *context, const void *data, size_t length)
Update the CRC32 context with a portion of the message being hashed.
Definition crc32.c:132
CRC32 algorithm context.
Definition crc32.h:59