VSF Documented
vsf_crc.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __VSF_CRC_H__
19#define __VSF_CRC_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "../../vsf_crypto_cfg.h"
24
25#if VSF_HASH_USE_CRC == ENABLED
26
27// for stdint.h
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34/*============================ MACROS ========================================*/
35/*============================ MACROFIED FUNCTIONS ===========================*/
36/*============================ TYPES =========================================*/
37
38typedef struct vsf_crc_t {
39 enum {
46
47/*============================ GLOBAL VARIABLES ==============================*/
48
49extern const vsf_crc_t vsf_crc8_ccitt;
50extern const vsf_crc_t vsf_crc16_ccitt;
51
52/*============================ PROTOTYPES ====================================*/
53
54extern uint_fast32_t vsf_crc(const vsf_crc_t *crc, uint_fast32_t initial, uint8_t *buff, uint_fast32_t bytesize);
55
56#ifdef __cplusplus
57}
58#endif
59
60#endif
61#endif
62/* EOF */
unsigned uint32_t
Definition stdint.h:9
unsigned int uint_fast32_t
Definition stdint.h:27
unsigned char uint8_t
Definition stdint.h:5
Definition vsf_crc.h:38
enum vsf_crc_t::@3 bitlen
@ VSF_CRC_BITLEN32
Definition vsf_crc.h:42
@ VSF_CRC_BITLEN16
Definition vsf_crc.h:41
@ VSF_CRC_BITLEN8
Definition vsf_crc.h:40
uint32_t poly
Definition vsf_crc.h:44
const vsf_crc_t vsf_crc8_ccitt
Definition vsf_crc.c:29
uint_fast32_t vsf_crc(const vsf_crc_t *crc, uint_fast32_t initial, uint8_t *buff, uint_fast32_t bytesize)
Definition vsf_crc.c:43
const vsf_crc_t vsf_crc16_ccitt
Definition vsf_crc.c:34
uint8_t * buff
Definition vsf_memfs.h:51