UFO: Alien Invasion
|
Go to the source code of this file.
Macros | |
#define | SHA1CircularShift(bits, word) |
Functions | |
static void | Com_SHA1ProcessMessageBlock (SHA1Context *) |
static void | Com_SHA1PadMessage (SHA1Context *) |
void | Com_SHA1Reset (SHA1Context *context) |
bool | Com_SHA1Result (SHA1Context *context) |
void | Com_SHA1Input (SHA1Context *context, const unsigned char *message_array, unsigned length) |
bool | Com_SHA1File (const char *filename, char digest[41]) |
bool | Com_SHA1Buffer (const unsigned char *buf, unsigned int len, char digest[41]) |
#define SHA1CircularShift | ( | bits, | |
word | |||
) |
Definition at line 48 of file sha1.cpp.
Referenced by Com_SHA1ProcessMessageBlock().
bool Com_SHA1Buffer | ( | const unsigned char * | buf, |
unsigned int | len, | ||
char | digest[41] | ||
) |
Definition at line 358 of file sha1.cpp.
References Com_SHA1Input(), Com_SHA1Reset(), Com_SHA1Result(), i, SHA1Context::Message_Digest, and Q_strcat().
Referenced by TEST_F(), and WEB_Auth().
bool Com_SHA1File | ( | const char * | filename, |
char | digest[41] | ||
) |
Definition at line 330 of file sha1.cpp.
References Com_SHA1Input(), Com_SHA1Reset(), Com_SHA1Result(), f, FILE_READ, FS_OpenFile(), FS_Read(), i, SHA1Context::Message_Digest, and Q_strcat().
void Com_SHA1Input | ( | SHA1Context * | context, |
const unsigned char * | message_array, | ||
unsigned | length | ||
) |
SHA1Input
Description: This function accepts an array of octets as the next portion of the message.
Parameters: context: [in/out] The SHA-1 context to update message_array: [in] An array of characters representing the next portion of the message. length: [in] The length of the message in message_array
Returns: Nothing.
Comments:
Definition at line 139 of file sha1.cpp.
References Com_SHA1ProcessMessageBlock(), SHA1Context::Computed, SHA1Context::Corrupted, SHA1Context::Length_High, SHA1Context::Length_Low, SHA1Context::Message_Block, and SHA1Context::Message_Block_Index.
Referenced by Com_SHA1Buffer(), and Com_SHA1File().
|
static |
SHA1PadMessage
Description: According to the standard, the message must be padded to an even 512 bits. The first padding bit must be a '1'. The last 64 bits represent the length of the original message. All bits in between should be 0. This function will pad the message according to those rules by filling the Message_Block array accordingly. It will also call SHA1ProcessMessageBlock() appropriately. When it returns, it can be assumed that the message digest has been computed.
Parameters: context: [in/out] The context to pad
Returns: Nothing.
Comments:
Definition at line 289 of file sha1.cpp.
References Com_SHA1ProcessMessageBlock(), SHA1Context::Length_High, SHA1Context::Length_Low, SHA1Context::Message_Block, and SHA1Context::Message_Block_Index.
Referenced by Com_SHA1Result().
|
static |
SHA1ProcessMessageBlock
Description: This function will process the next 512 bits of the message stored in the Message_Block array.
Parameters: None.
Returns: Nothing.
Comments: Many of the variable names in the SHAContext, especially the single character names, were used because those were the names used in the publication.
Definition at line 192 of file sha1.cpp.
References E, SHA1Context::Message_Block, SHA1Context::Message_Block_Index, SHA1Context::Message_Digest, and SHA1CircularShift.
Referenced by Com_SHA1Input(), and Com_SHA1PadMessage().
void Com_SHA1Reset | ( | SHA1Context * | context | ) |
SHA1Reset
Description: This function will initialize the SHA1Context in preparation for computing a new message digest.
Parameters: context: [in/out] The context to reset.
Returns: Nothing.
Comments:
Definition at line 72 of file sha1.cpp.
References SHA1Context::Computed, SHA1Context::Corrupted, SHA1Context::Length_High, SHA1Context::Length_Low, SHA1Context::Message_Block_Index, and SHA1Context::Message_Digest.
Referenced by Com_SHA1Buffer(), and Com_SHA1File().
bool Com_SHA1Result | ( | SHA1Context * | context | ) |
SHA1Result
Description: This function will return the 160-bit message digest into the Message_Digest array within the SHA1Context provided
Parameters: context: [in/out] The context to use to calculate the SHA-1 hash.
Returns: true if successful, false if it failed.
Comments:
Definition at line 104 of file sha1.cpp.
References Com_SHA1PadMessage(), SHA1Context::Computed, and SHA1Context::Corrupted.
Referenced by Com_SHA1Buffer(), and Com_SHA1File().