BSL v0.0.0 - 0.geda3e66
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
crc.h File Reference

Declarations for BPv7 block CRC handling. More...

#include <BPSecLib_Public.h>
#include <qcbor/UsefulBuf.h>
#include <stdbool.h>
#include <stdint.h>
+ Include dependency graph for crc.h:
+ This graph shows which files directly or indirectly include this file:

Functions

void mock_bpa_crc_apply (UsefulBuf buf, size_t begin, size_t end, BSL_BundleCRCType_e crc_type)
 Apply a CRC function to an encoded block.
 
bool mock_bpa_crc_check (UsefulBufC buf, size_t begin, size_t end, BSL_BundleCRCType_e crc_type)
 Check the CRC of an encoded block.
 

Detailed Description

Declarations for BPv7 block CRC handling.

Function Documentation

◆ mock_bpa_crc_apply()

void mock_bpa_crc_apply ( UsefulBuf  buf,
size_t  begin,
size_t  end,
BSL_BundleCRCType_e  crc_type 
)

Apply a CRC function to an encoded block.

Parameters
bufThe buffer holding the encoded block. The buffer contents will be modified to hold the correct CRC value.
beginThe start of the block array
endThe end of the block array
crc_typeThe needed CRC type.

References BSL_BUNDLECRCTYPE_16, BSL_BUNDLECRCTYPE_32, and BSL_BUNDLECRCTYPE_NONE.

Referenced by bsl_mock_encode_canonical(), and bsl_mock_encode_primary().

◆ mock_bpa_crc_check()

bool mock_bpa_crc_check ( UsefulBufC  buf,
size_t  begin,
size_t  end,
BSL_BundleCRCType_e  crc_type 
)

Check the CRC of an encoded block.

Parameters
bufThe buffer holding the encoded block.
beginThe start of the block array
endThe end of the block array
crc_typeThe needed CRC type.
Returns
True if the CRC value agrees.

References BSL_BUNDLECRCTYPE_16, BSL_BUNDLECRCTYPE_32, and BSL_BUNDLECRCTYPE_NONE.

Referenced by bsl_mock_decode_canonical(), and bsl_mock_decode_primary().