43 #include "../shared/shared.h"
48 #define SHA1CircularShift(bits,word) \
49 ((((word) << (bits)) & 0xFFFFFFFF) | \
50 ((word) >> (32-(bits))))
150 while (length-- && !context->
Corrupted) {
195 { 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6 };
201 for (
int t = 0; t < 16; t++) {
203 W[t] |= ((unsigned) context->
Message_Block[t * 4 + 1]) << 16;
208 for (
int t = 16; t < 80; t++) {
218 for (
int t = 0; t < 20; t++) {
219 unsigned temp =
SHA1CircularShift(5,A) + ((B & C) | ((~B) & D)) + E + W[t] + K[0];
228 for (
int t = 20; t < 40; t++) {
238 for (
int t = 40; t < 60; t++) {
239 unsigned temp =
SHA1CircularShift(5,A) + ((B & C) | (B & D) | (C & D)) + E + W[t] + K[2];
248 for (
int t = 60; t < 80; t++) {
342 const int n =
FS_Read(buf,
sizeof(buf), &f);
352 for (
int i = 0;
i < 5;
i++) {
371 for (
int i = 0;
i < 5;
i++) {
int FS_OpenFile(const char *filename, qFILE *file, filemode_t mode)
Finds and opens the file in the search path.
bool Com_SHA1Buffer(const unsigned char *buf, unsigned int len, char digest[41])
static void Com_SHA1PadMessage(SHA1Context *)
unsigned Message_Digest[5]
QGL_EXTERN GLuint GLsizei GLsizei * length
bool Com_SHA1Result(SHA1Context *context)
unsigned char Message_Block[64]
static void Com_SHA1ProcessMessageBlock(SHA1Context *)
int FS_Read(void *buffer, int len, qFILE *f)
void Com_SHA1Input(SHA1Context *context, const unsigned char *message_array, unsigned length)
QGL_EXTERN GLuint GLchar GLuint * len
bool Com_SHA1File(const char *filename, char digest[41])
void Q_strcat(char *dest, size_t destsize, const char *format,...)
Safely (without overflowing the destination buffer) concatenates two strings.
void Com_SHA1Reset(SHA1Context *context)
#define SHA1CircularShift(bits, word)