SFBChecksum.h

Go to the documentation of this file.
00001 /*                                             -*- mode:C; fill-column:100 -*-
00002  *
00003  * SFBChecksum.c - Cryptographically INSECURE, but fairly fast
00004  *                 and small LFSR-based checksum
00005  *
00006  * Copyright (C) 2008 The Regents of the University of New Mexico.  All rights reserved.
00007  *
00008  * This file is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2.1 of the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
00021  * USA
00022  */
00023 
00076 #ifndef SFBCHECKSUM_H
00077 #define SFBCHECKSUM_H
00078 
00079 #include <inttypes.h>  /* for uint32_t */
00080 
00081 #ifdef __cplusplus
00082 extern "C" {
00083 #endif
00084 
00091 typedef uint32_t SFBChecksum[2];
00092 
00101 void SFBChecksumInit(SFBChecksum cs);
00102 
00112 void SFBChecksumAddByte(SFBChecksum cs, char data);
00113 
00128 void SFBChecksumAddBytes(SFBChecksum cs, const char * data, int length);
00129 
00139 void SFBChecksumCopy(const SFBChecksum csFrom,SFBChecksum csTo);
00140 
00151 int SFBChecksumEqual(const SFBChecksum cs1,const SFBChecksum cs2);
00152 
00153 
00173 const char * SFBChecksumToString(SFBChecksum cs);
00174 
00204 int SFBChecksumFromString(SFBChecksum cs, const char * hexString);
00205 
00206 #ifdef __cplusplus
00207 }
00208 #endif
00209 
00210 #endif /* SFBCHECKSUM_H */

Generated on Fri Apr 22 06:54:11 2011 for SFB by doxygen 1.5.9