Files
zephyr/subsys/crc/crc7_sw.c
Duy Vo 0c5af6f25f crc: initial support for CRC subsystem
Migrate support from crc library to new crc subsystem
Add hardware acclerator backend for crc subsystem

Signed-off-by: Duy Vo <duy.vo.xc@bp.renesas.com>
2025-09-10 08:26:32 +02:00

20 lines
327 B
C

/*
* Copyright (c) 2018 Google LLC.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/sys/crc.h>
uint8_t __weak crc7_be(uint8_t seed, const uint8_t *src, size_t len)
{
while (len-- != 0UL) {
uint8_t e = seed ^ *src++;
uint8_t f = e ^ (e >> 4) ^ (e >> 7);
seed = (f << 1) ^ (f << 4);
}
return seed;
}