BSL v0.0.0
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
bsl_mock_bpa_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 bsl_mock_bpa_crc.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of 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.

Definition in file bsl_mock_bpa_crc.h.

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.

Definition at line 45 of file bsl_mock_bpa_crc.c.

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.

Definition at line 87 of file bsl_mock_bpa_crc.c.

References BSL_BUNDLECRCTYPE_16, BSL_BUNDLECRCTYPE_32, and BSL_BUNDLECRCTYPE_NONE.

Referenced by bsl_mock_decode_canonical(), and bsl_mock_decode_primary().