~hikiko/nux/arb-srgba-shader

« back to all changes in this revision

Viewing changes to NuxCore/Crypto/NSHA1.h

  • Committer: Neil Jagdish Patel
  • Date: 2010-09-01 19:25:37 UTC
  • Revision ID: neil.patel@canonical.com-20100901192537-mfz7rm6q262pewg6
Import and build NuxCore

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
// From http://www.packetizer.com/security/sha1/
 
3
/*
 
4
*  sha1.h
 
5
*
 
6
*       Copyright (C) 1998
 
7
*       Paul E. Jones <paulej@arid.us>
 
8
*       All Rights Reserved
 
9
*
 
10
*****************************************************************************
 
11
*       $Id: sha1.h,v 1.2 2004/03/27 18:00:33 paulej Exp $
 
12
*****************************************************************************
 
13
*
 
14
*  Description:
 
15
*      This class implements the Secure Hashing Standard as defined
 
16
*      in FIPS PUB 180-1 published April 17, 1995.
 
17
*
 
18
*      Many of the variable names in the SHA1Context, especially the
 
19
*      single character names, were used because those were the names
 
20
*      used in the publication.
 
21
*
 
22
*      Please read the file sha1.c for more information.
 
23
*
 
24
*/
 
25
 
 
26
 
 
27
#ifndef NSHA1_H
 
28
#define NSHA1_H
 
29
 
 
30
NAMESPACE_BEGIN
 
31
/* 
 
32
*  This structure will hold context information for the hashing
 
33
*  operation
 
34
*/
 
35
typedef struct SHA1Context
 
36
{
 
37
    unsigned Message_Digest[5]; /* Message Digest (output)          */
 
38
 
 
39
    unsigned Length_Low;        /* Message length in bits           */
 
40
    unsigned Length_High;       /* Message length in bits           */
 
41
 
 
42
    unsigned char Message_Block[64]; /* 512-bit message blocks      */
 
43
    int Message_Block_Index;    /* Index into message block array   */
 
44
 
 
45
    int Computed;               /* Is the digest computed?          */
 
46
    int Corrupted;              /* Is the message digest corruped?  */
 
47
} SHA1Context;
 
48
 
 
49
/*
 
50
*  Function Prototypes
 
51
*/
 
52
void SHA1Reset(SHA1Context *);
 
53
int SHA1Result(SHA1Context *);
 
54
void SHA1Input(SHA1Context *,
 
55
               const unsigned char *,
 
56
               unsigned);
 
57
 
 
58
NAMESPACE_END
 
59
 
 
60
#endif // NSHA1_H
 
61