Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 1.40 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /************************************************************************
  2.  *   Bahamut / Azzurra include/sha1.h
  3.  *
  4.  *   This program is free software; you can redistribute it and/or modify
  5.  *   it under the terms of the GNU General Public License as published by
  6.  *   the Free Software Foundation; either version 2, or (at your option)
  7.  *   any later version.
  8.  *
  9.  *   This program is distributed in the hope that it will be useful,
  10.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  *   GNU General Public License for more details.
  13.  *
  14.  *   You should have received a copy of the GNU General Public License
  15.  *   along with this program; if not, write to the Free Software
  16.  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  */
  18.  
  19.  
  20. /*
  21.  * SHA-1 in C
  22.  * By Steve Reid <steve@edmweb.com>
  23.  * 100% Public Domain
  24.  */
  25.  
  26. #ifndef _SHA1_H_
  27. #define _SHA1_H_
  28.  
  29. #define SHA1_BLOCK_LENGTH               64
  30. #define SHA1_DIGEST_LENGTH              20
  31.  
  32. typedef struct
  33. {
  34.     uint32_t        state[5];
  35.     uint64_t        count;
  36.     unsigned char   buffer[SHA1_BLOCK_LENGTH];
  37. } SHA1_CTX;
  38.  
  39. void SHA1Init(SHA1_CTX * context);
  40. void SHA1Transform(uint32_t state[5], const unsigned char buffer[SHA1_BLOCK_LENGTH]);
  41. void SHA1Update(SHA1_CTX *context, const unsigned char *data, unsigned int len);
  42. void SHA1Final(unsigned char digest[SHA1_DIGEST_LENGTH], SHA1_CTX *context);
  43.  
  44. #endif /* _SHA1_H_ */