2crc8.h 550 B

123456789101112131415161718192021
  1. /* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
  2. * Use of this source code is governed by a BSD-style license that can be
  3. * found in the LICENSE file.
  4. *
  5. * Very simple 8-bit CRC function.
  6. */
  7. #ifndef VBOOT_REFERENCE_2_CRC8_H_
  8. #define VBOOT_REFERENCE_2_CRC8_H_
  9. /**
  10. * Calculate CRC-8 of the data, using x^8 + x^2 + x + 1 polynomial.
  11. *
  12. * @param data Data to CRC
  13. * @param size Size of data in bytes
  14. * @return CRC-8 of the data.
  15. */
  16. uint8_t vb2_crc8(const void *data, uint32_t size);
  17. #endif /* VBOOT_REFERENCE_2_CRC8_H_ */