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
43typedef 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? */
55
56/*
57 * Function Prototypes
58 */
61void Com_SHA1Input (SHA1Context *, const unsigned char *, unsigned);
62
63bool Com_SHA1File (const char *filename, char digest[41]);
64bool Com_SHA1Buffer (const unsigned char *buf, unsigned int len, char digest[41]);
const char * filename
Definition ioapi.h:41
voidpf void * buf
Definition ioapi.h:42
QGL_EXTERN GLuint GLchar GLuint * len
Definition r_gl.h:99
bool Com_SHA1File(const char *filename, char digest[41])
Definition sha1.cpp:330
bool Com_SHA1Buffer(const unsigned char *buf, unsigned int len, char digest[41])
Definition sha1.cpp:358
bool Com_SHA1Result(SHA1Context *)
Definition sha1.cpp:104
void Com_SHA1Reset(SHA1Context *)
Definition sha1.cpp:72
void Com_SHA1Input(SHA1Context *, const unsigned char *, unsigned)
Definition sha1.cpp:139
unsigned Message_Digest[5]
Definition sha1.h:44
int Computed
Definition sha1.h:52
int Message_Block_Index
Definition sha1.h:50
unsigned Length_Low
Definition sha1.h:46
unsigned char Message_Block[64]
Definition sha1.h:49
int Corrupted
Definition sha1.h:53
unsigned Length_High
Definition sha1.h:47
Cross-platform type definitions.