"Fossies" - the Fresh Open Source Software Archive

Member "coda-6.9.5/lib-src/base/coda_hash.h" (1 Aug 2007, 2381 Bytes) of package /linux/misc/old/coda-6.9.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "coda_hash.h" see the Fossies "Dox" file reference documentation.

    1 /* BLURB lgpl
    2 
    3                            Coda File System
    4                               Release 6
    5 
    6           Copyright (c) 1987-2003 Carnegie Mellon University
    7                   Additional copyrights listed below
    8 
    9 This  code  is  distributed "AS IS" without warranty of any kind under
   10 the  terms of the  GNU  Library General Public Licence  Version 2,  as
   11 shown in the file LICENSE. The technical and financial contributors to
   12 Coda are listed in the file CREDITS.
   13 
   14                         Additional copyrights
   15                            none currently
   16 
   17 #*/
   18 
   19 #ifndef _CODA_HASH_H_
   20 #define _CODA_HASH_H_ 1
   21 
   22 #ifdef __cplusplus
   23 extern "C" {
   24 #endif
   25 
   26 #ifdef HAVE_CONFIG_H
   27 #include <config.h>
   28 #endif
   29 
   30 #include <sys/types.h>
   31 
   32 #if defined(HAVE_MD5_H)
   33 #include <md5.h>
   34 #else
   35 
   36 /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
   37 rights reserved.
   38 
   39 License to copy and use this software is granted provided that it
   40 is identified as the "RSA Data Security, Inc. MD5 Message-Digest
   41 Algorithm" in all material mentioning or referencing this software
   42 or this function.
   43 
   44 License is also granted to make and use derivative works provided
   45 that such works are identified as "derived from the RSA Data
   46 Security, Inc. MD5 Message-Digest Algorithm" in all material
   47 mentioning or referencing the derived work.
   48 
   49 RSA Data Security, Inc. makes no representations concerning either
   50 the merchantability of this software or the suitability of this
   51 software for any particular purpose. It is provided "as is"
   52 without express or implied warranty of any kind.
   53 
   54 These notices must be retained in any copies of any part of this
   55 documentation and/or software.
   56  */
   57 
   58 typedef struct MD5Context {
   59     u_int32_t state[4];   /* state (ABCD) */
   60     u_int32_t count[2];   /* number of bits, modulo 2^64 (lsb first) */
   61     unsigned char buffer[64];     /* input buffer */
   62 } MD5_CTX;
   63 
   64 void MD5_Init(MD5_CTX *);
   65 void MD5_Update(MD5_CTX *, const unsigned char *, unsigned int);
   66 void MD5_Final(unsigned char [16], MD5_CTX *);
   67 
   68 #endif
   69 
   70 #define SHA_DIGEST_LENGTH 20
   71 
   72 typedef struct SHAContext {
   73     u_int32_t count;
   74     u_int32_t state[5];
   75     unsigned char buffer[64];
   76 } SHA_CTX;
   77 
   78 void SHA1_Init(SHA_CTX *ctx);
   79 void SHA1_Update(SHA_CTX *ctx, const unsigned char *buf, unsigned int len);
   80 void SHA1_Final(unsigned char sha[SHA_DIGEST_LENGTH], SHA_CTX *ctx);
   81 
   82 #ifdef __cplusplus
   83 }
   84 #endif
   85 
   86 #endif  /* _CODA_HASH_H_ */
   87