API Reference Manual  1.45.0
api/spec/hash.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2015-2018 Linaro Limited
3  */
4 
11 #ifndef ODP_API_SPEC_HASH_H_
12 #define ODP_API_SPEC_HASH_H_
13 #include <odp/visibility_begin.h>
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 #include <odp/api/std_types.h>
20 
37 uint32_t odp_hash_crc32(const void *data, uint32_t data_len, uint32_t init_val);
38 
51 uint32_t odp_hash_crc32c(const void *data, uint32_t data_len,
52  uint32_t init_val);
53 
59 typedef struct odp_hash_crc_param_t {
61  uint32_t width;
63  uint64_t poly;
69  uint64_t xor_out;
71 
85 int odp_hash_crc_gen64(const void *data, uint32_t data_len,
86  uint64_t init_val, odp_hash_crc_param_t *crc_param,
87  uint64_t *crc);
88 
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #include <odp/visibility_end.h>
98 #endif
Standard C language types and definitions for ODP.
uint32_t odp_hash_crc32(const void *data, uint32_t data_len, uint32_t init_val)
Calculate CRC-32.
int odp_hash_crc_gen64(const void *data, uint32_t data_len, uint64_t init_val, odp_hash_crc_param_t *crc_param, uint64_t *crc)
Calculate up to 64 bit CRC using the given parameters.
uint32_t odp_hash_crc32c(const void *data, uint32_t data_len, uint32_t init_val)
Calculate CRC-32C.
struct odp_hash_crc_param_t odp_hash_crc_param_t
CRC parameters.
int odp_bool_t
Use odp boolean type to have it well-defined and known size, regardless which compiler is used as thi...
CRC parameters.
Definition: api/spec/hash.h:59
uint64_t xor_out
XOR this value to CRC output (stored in 'width' LSB bits)
Definition: api/spec/hash.h:69
odp_bool_t reflect_out
0: don't reflect, 1: reflect bits in output bytes
Definition: api/spec/hash.h:67
uint32_t width
CRC width in bits.
Definition: api/spec/hash.h:61
uint64_t poly
Polynomial (stored in 'width' LSB bits)
Definition: api/spec/hash.h:63
odp_bool_t reflect_in
0: don't reflect, 1: reflect bits in input bytes
Definition: api/spec/hash.h:65