sha1.H

Go to the documentation of this file.
00001 /*!@file Util/sha1.H general sha1 (160-bit) message-digest implementation */
00002 
00003 // This code is from http://www.cr0.net:8040/code/crypto/sha1/, also
00004 // under the GPL (see original copyright notice below).
00005 
00006 /*
00007  *  FIPS-180-1 compliant SHA-1 implementation
00008  *
00009  *  Copyright (C) 2001-2003  Christophe Devine
00010  *
00011  *  This program is free software; you can redistribute it and/or
00012  *  modify it under the terms of the GNU General Public License as
00013  *  published by the Free Software Foundation; either version 2 of the
00014  *  License, or (at your option) any later version.
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  *  General Public License for more details.
00020  *
00021  *  You should have received a copy of the GNU General Public License
00022  *  along with this program; if not, write to the Free Software
00023  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00024  *  02111-1307 USA
00025  */
00026 
00027 //
00028 // Primary maintainer for this file: Rob Peters <rjpeters at usc dot edu>
00029 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Util/sha1.H $
00030 // $Id: sha1.H 5367 2005-08-22 21:45:50Z rjpeters $
00031 //
00032 
00033 #ifndef UTIL_SHA1_H_DEFINED
00034 #define UTIL_SHA1_H_DEFINED
00035 
00036 #include "Util/Types.H"
00037 
00038 struct sha1_context
00039 {
00040   uint32 total[2];
00041   uint32 state[5];
00042   byte buffer[64];
00043 };
00044 
00045 void sha1_starts( sha1_context* ctx );
00046 void sha1_update( sha1_context* ctx, const byte* input, uint32 length );
00047 void sha1_finish( sha1_context* ctx, byte digest[20] );
00048 
00049 // ######################################################################
00050 /* So things look consistent in everyone's emacs... */
00051 /* Local Variables: */
00052 /* indent-tabs-mode: nil */
00053 /* End: */
00054 
00055 #endif // UTIL_SHA1_H_DEFINED
Generated on Sun May 8 08:06:59 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3