Shadowrun: Awakened 29 September 2011 - Build 871
Classes | Defines
SHA1.h File Reference
#include "RakMemoryOverride.h"
#include <stdio.h>
#include <memory.h>
#include <string.h>
#include "Export.h"
Include dependency graph for SHA1.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CSHA1
union  CSHA1::SHA1_WORKSPACE_BLOCK

Defines

#define MAX_FILE_READ_BUFFER   8000
 [Internal] SHA-1 computation class
#define R0(v, w, x, y, z, i)   { z+=((w&(x^y))^y)+SHABLK0(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); }
#define R1(v, w, x, y, z, i)   { z+=((w&(x^y))^y)+SHABLK(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); }
#define R2(v, w, x, y, z, i)   { z+=(w^x^y)+SHABLK(i)+0x6ED9EBA1+ROL32(v,5); w=ROL32(w,30); }
#define R3(v, w, x, y, z, i)   { z+=(((w|x)&y)|(w&x))+SHABLK(i)+0x8F1BBCDC+ROL32(v,5); w=ROL32(w,30); }
#define R4(v, w, x, y, z, i)   { z+=(w^x^y)+SHABLK(i)+0xCA62C1D6+ROL32(v,5); w=ROL32(w,30); }
#define ROL32(value, bits)   (((value)<<(bits))|((value)>>(32-(bits))))
#define SHA1_LENGTH   20
#define SHABLK(i)
#define SHABLK0(i)   (block->l[i])

Define Documentation

#define MAX_FILE_READ_BUFFER   8000

100% free public domain implementation of the SHA-1 algorithm by Dominik Reichl <Dominik.Reichl@tiscali.de>

=== Test Vectors (from FIPS PUB 180-1) ===

"abc" A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D

"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1

A million repetitions of "a" 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F

Definition at line 29 of file SHA1.h.

#define R0 (   v,
  w,
  x,
  y,
  z,
 
)    { z+=((w&(x^y))^y)+SHABLK0(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); }

Definition at line 51 of file SHA1.h.

#define R1 (   v,
  w,
  x,
  y,
  z,
 
)    { z+=((w&(x^y))^y)+SHABLK(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); }

Definition at line 52 of file SHA1.h.

#define R2 (   v,
  w,
  x,
  y,
  z,
 
)    { z+=(w^x^y)+SHABLK(i)+0x6ED9EBA1+ROL32(v,5); w=ROL32(w,30); }

Definition at line 53 of file SHA1.h.

#define R3 (   v,
  w,
  x,
  y,
  z,
 
)    { z+=(((w|x)&y)|(w&x))+SHABLK(i)+0x8F1BBCDC+ROL32(v,5); w=ROL32(w,30); }

Definition at line 54 of file SHA1.h.

#define R4 (   v,
  w,
  x,
  y,
  z,
 
)    { z+=(w^x^y)+SHABLK(i)+0xCA62C1D6+ROL32(v,5); w=ROL32(w,30); }

Definition at line 55 of file SHA1.h.

#define ROL32 (   value,
  bits 
)    (((value)<<(bits))|((value)>>(32-(bits))))

Definition at line 38 of file SHA1.h.

#define SHA1_LENGTH   20

Definition at line 31 of file SHA1.h.

#define SHABLK (   i)
Value:
(block->l[i&15] = ROL32(block->l[(i+13)&15] ^ block->l[(i+8)&15] \
    ^ block->l[(i+2)&15] ^ block->l[i&15],1))

Definition at line 47 of file SHA1.h.

#define SHABLK0 (   i)    (block->l[i])

Definition at line 44 of file SHA1.h.


Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net