sha2.H

Go to the documentation of this file.
00001 /*!@file Util/sha2.H general sha2 (256-bit) message-digest implementation */
00002 
00003 // This code is from http://www.cr0.net:8040/code/crypto/sha256/, also
00004 // under the GPL (see original copyright notice below).
00005 
00006 /*
00007  *  FIPS-180-2 compliant SHA-256 implementation
00008  *
00009  *  Copyright (C) 2001-2003  Christophe Devine
00010  *
00011  *  This program is free software; you can redistribute it and/or modify
00012  *  it under the terms of the GNU General Public License as published by
00013  *  the Free Software Foundation; either version 2 of the License, or
00014  *  (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
00019  *  GNU 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  02111-1307  USA
00024  */
00025 
00026 //
00027 // Primary maintainer for this file: Rob Peters <rjpeters at usc dot edu>
00028 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Util/sha2.H $
00029 // $Id: sha2.H 5367 2005-08-22 21:45:50Z rjpeters $
00030 //
00031 
00032 #ifndef UTIL_SHA2_H_DEFINED
00033 #define UTIL_SHA2_H_DEFINED
00034 
00035 #include "Util/Types.H"
00036 
00037 struct sha256_context
00038 {
00039   uint32 total[2];
00040   uint32 state[8];
00041   byte buffer[64];
00042 };
00043 
00044 void sha256_starts( sha256_context* ctx );
00045 void sha256_update( sha256_context* ctx, const byte* input, uint32 length );
00046 void sha256_finish( sha256_context* ctx, byte digest[32] );
00047 
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_SHA2_H_DEFINED
Generated on Sun May 8 08:06:59 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3