Loading...
Searching...
No Matches
hamming256.h
1/*
2 * Copyright (C) 2015 Lucas Jenß
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
18#ifndef ECC_HAMMING256_H
19#define ECC_HAMMING256_H
20
21#include <stdint.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
28#define Hamming_ERROR_NONE 0
29
31#define Hamming_ERROR_SINGLEBIT 1
32
34#define Hamming_ERROR_ECC 2
35
37#define Hamming_ERROR_MULTIPLEBITS 3
38
47void hamming_compute256x( const uint8_t *data, uint32_t size, uint8_t *code );
48
61uint8_t hamming_verify256x( uint8_t *data, uint32_t size, const uint8_t *code );
62
63#ifdef __cplusplus
64}
65#endif
66
67#endif /* ECC_HAMMING256_H */
void hamming_compute256x(const uint8_t *data, uint32_t size, uint8_t *code)
Computes 3-bytes hamming codes for a data block whose size is multiple of 256 bytes.
uint8_t hamming_verify256x(uint8_t *data, uint32_t size, const uint8_t *code)
Verifies 3-bytes hamming codes for a data block whose size is multiple of 256 bytes.