/*****************************************************************************
 * Copyright Gemalto, unpublished work, created 2015. This computer program
 * includes Confidential, Proprietary Information and is a Trade Secret of
 * Gemalto. All use, disclosure, and/or reproduction is prohibited unless
 * authorised in writing by an officer of Gemalto. All Rights Reserved.
 *
 * Gemalto licenses this file to you under the secESE Gemalto License.
 * See NOTICE file for more information regarding copyright ownership.
 * A copy of secESE Gemalto License is available in LICENSE file included in
 * source code distribution of secESE Gemalto. You can ask a copy of the
 * License by contacting Gemalto (http://www.gemalto.com).
 ****************************************************************************/

/**
 * @file
 * $Author$
 * $Revision$
 * $Date$
 *
 * T=1 checksum algorithms.
 *
 */

#ifndef CHECKSUM_H
#define CHECKSUM_H

/* Both function return checksum.
 *
 * When computing checksum. caller is responsible to store value at block end.
 * In case of CRC16, this is lowest byte first, followed by higher byte.
 *
 * When verifying checksum, function returns zero for a correct checksum.
 *
 */

unsigned lrc8(const void *s, size_t n);
unsigned crc_ccitt(uint16_t crc,  const void *s, size_t n);

#endif /* CHECKSUM_H */
