LibXenon
Bare-metal Xbox 360 homebrew library
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
sha1.c File Reference
#include <string.h>
#include "sha.h"
Include dependency graph for sha1.c:

Go to the source code of this file.

Data Structures

union  _BYTE64QUAD16
 

Macros

#define rol(value, bits)   (((value) << (bits)) | ((value) >> (32 - (bits))))
 
#define blk0(i)   block->l[i]
 
#define blk(i)
 
#define R0(v, w, x, y, z, i)   z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30);
 
#define R1(v, w, x, y, z, i)   z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30);
 
#define R2(v, w, x, y, z, i)   z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30);
 
#define R3(v, w, x, y, z, i)   z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30);
 
#define R4(v, w, x, y, z, i)   z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);
 

Typedefs

typedef union _BYTE64QUAD16 BYTE64QUAD16
 

Functions

void SHA1_Transform (sha1_quadbyte state[5], sha1_byte buffer[64])
 
void SHA1_Init (SHA_CTX *context)
 
void SHA1_Update (SHA_CTX *context, sha1_byte *data, unsigned int len)
 
void SHA1_Final (sha1_byte digest[SHA1_DIGEST_LENGTH], SHA_CTX *context)
 

Macro Definition Documentation

◆ blk

#define blk (   i)
Value:
(block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \
^block->l[(i+2)&15]^block->l[i&15],1))
#define rol(value, bits)
Definition: sha1.c:29

Definition at line 40 of file sha1.c.

◆ blk0

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

Definition at line 37 of file sha1.c.

◆ R0

#define R0 (   v,
  w,
  x,
  y,
  z,
 
)    z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30);

Definition at line 44 of file sha1.c.

◆ R1

#define R1 (   v,
  w,
  x,
  y,
  z,
 
)    z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30);

Definition at line 45 of file sha1.c.

◆ R2

#define R2 (   v,
  w,
  x,
  y,
  z,
 
)    z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30);

Definition at line 46 of file sha1.c.

◆ R3

#define R3 (   v,
  w,
  x,
  y,
  z,
 
)    z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30);

Definition at line 47 of file sha1.c.

◆ R4

#define R4 (   v,
  w,
  x,
  y,
  z,
 
)    z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);

Definition at line 48 of file sha1.c.

◆ rol

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

Definition at line 29 of file sha1.c.

Typedef Documentation

◆ BYTE64QUAD16

typedef union _BYTE64QUAD16 BYTE64QUAD16

Function Documentation

◆ SHA1_Final()

void SHA1_Final ( sha1_byte  digest[SHA1_DIGEST_LENGTH],
SHA_CTX context 
)

Definition at line 131 of file sha1.c.

◆ SHA1_Init()

void SHA1_Init ( SHA_CTX context)

Definition at line 100 of file sha1.c.

◆ SHA1_Transform()

void SHA1_Transform ( sha1_quadbyte  state[5],
sha1_byte  buffer[64] 
)

Definition at line 56 of file sha1.c.

◆ SHA1_Update()

void SHA1_Update ( SHA_CTX context,
sha1_byte data,
unsigned int  len 
)

Definition at line 111 of file sha1.c.