summaryrefslogtreecommitdiff
path: root/include/crc.h
blob: 6615885f273aa2332777a4ba75f0849e568e5748 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef __CROS_EC_CRC_H
#define __CROS_EC_CRC_H
/* CRC-32 implementation with USB constants */
/* Note: it's a stateful CRC-32 to match the hardware block interface */

#ifdef CONFIG_HW_CRC
#include "crc_hw.h"
#else

/* Use software implementation */

void crc32_init(void);

void crc32_hash32(uint32_t val);

void crc32_hash16(uint16_t val);

uint32_t crc32_result(void);

#endif /* CONFIG_HW_CRC */

#endif /* __CROS_EC_CRC_H */