UFO: Alien Invasion
Loading...
Searching...
No Matches
sha1.h
Go to the documentation of this file.
1
/*
2
* sha1.h
3
*
4
* Copyright (C) 1998, 2009
5
* Paul E. Jones <paulej@packetizer.com>
6
* All Rights Reserved
7
*
8
*****************************************************************************
9
* $Id: sha1.h 12 2009-06-22 19:34:25Z paulej $
10
*****************************************************************************
11
*
12
* Description:
13
* This class implements the Secure Hashing Standard as defined
14
* in FIPS PUB 180-1 published April 17, 1995.
15
*
16
* Many of the variable names in the SHA1Context, especially the
17
* single character names, were used because those were the names
18
* used in the publication.
19
*
20
* Please read the file sha1.c for more information.
21
*
22
*
23
* Freeware Public License (FPL)
24
*
25
* This software is licensed as "freeware." Permission to distribute
26
* this software in source and binary forms, including incorporation
27
* into other products, is hereby granted without a fee. THIS SOFTWARE
28
* IS PROVIDED 'AS IS' AND WITHOUT ANY EXPRESSED OR IMPLIED WARRANTIES,
29
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
30
* AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHOR SHALL NOT BE HELD
31
* LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE, EITHER
32
* DIRECTLY OR INDIRECTLY, INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA
33
* OR DATA BEING RENDERED INACCURATE.
34
*/
35
36
#pragma once
37
38
#include "
../shared/ufotypes.h
"
39
43
typedef
struct
SHA1Context
{
44
unsigned
Message_Digest
[5];
/* Message Digest (output) */
45
46
unsigned
Length_Low
;
/* Message length in bits */
47
unsigned
Length_High
;
/* Message length in bits */
48
49
unsigned
char
Message_Block
[64];
/* 512-bit message blocks */
50
int
Message_Block_Index
;
/* Index into message block array */
51
52
int
Computed
;
/* Is the digest computed? */
53
int
Corrupted
;
/* Is the message digest corrupted? */
54
}
SHA1Context
;
55
56
/*
57
* Function Prototypes
58
*/
59
void
Com_SHA1Reset
(
SHA1Context
*);
60
bool
Com_SHA1Result
(
SHA1Context
*);
61
void
Com_SHA1Input
(
SHA1Context
*,
const
unsigned
char
*,
unsigned
);
62
63
bool
Com_SHA1File
(
const
char
*
filename
,
char
digest[41]);
64
bool
Com_SHA1Buffer
(
const
unsigned
char
*
buf
,
unsigned
int
len
,
char
digest[41]);
filename
const char * filename
Definition
ioapi.h:41
buf
voidpf void * buf
Definition
ioapi.h:42
len
QGL_EXTERN GLuint GLchar GLuint * len
Definition
r_gl.h:99
Com_SHA1File
bool Com_SHA1File(const char *filename, char digest[41])
Definition
sha1.cpp:330
Com_SHA1Buffer
bool Com_SHA1Buffer(const unsigned char *buf, unsigned int len, char digest[41])
Definition
sha1.cpp:358
Com_SHA1Result
bool Com_SHA1Result(SHA1Context *)
Definition
sha1.cpp:104
Com_SHA1Reset
void Com_SHA1Reset(SHA1Context *)
Definition
sha1.cpp:72
Com_SHA1Input
void Com_SHA1Input(SHA1Context *, const unsigned char *, unsigned)
Definition
sha1.cpp:139
SHA1Context
Definition
sha1.h:43
SHA1Context::Message_Digest
unsigned Message_Digest[5]
Definition
sha1.h:44
SHA1Context::Computed
int Computed
Definition
sha1.h:52
SHA1Context::Message_Block_Index
int Message_Block_Index
Definition
sha1.h:50
SHA1Context::Length_Low
unsigned Length_Low
Definition
sha1.h:46
SHA1Context::Message_Block
unsigned char Message_Block[64]
Definition
sha1.h:49
SHA1Context::Corrupted
int Corrupted
Definition
sha1.h:53
SHA1Context::Length_High
unsigned Length_High
Definition
sha1.h:47
ufotypes.h
Cross-platform type definitions.
src
common
sha1.h
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.16.1