PandA-2024.02
Macros | Functions
sha.c File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define f1(x, y, z)   ((x & y) | (~x & z))
 
#define f2(x, y, z)   (x ^ y ^ z)
 
#define f3(x, y, z)   ((x & y) | (x & z) | (y & z))
 
#define f4(x, y, z)   (x ^ y ^ z)
 
#define CONST1   0x5a827999L
 
#define CONST2   0x6ed9eba1L
 
#define CONST3   0x8f1bbcdcL
 
#define CONST4   0xca62c1d6L
 
#define ROT32(x, n)   ((x << n) | (x >> (32 - n)))
 
#define FUNC(n, i)
 

Functions

void __builtin_bambu_time_start ()
 
void __builtin_bambu_time_stop ()
 
void local_memset (INT32 *s, int c, int n, int e)
 
void local_memcpy (INT32 *s1, const BYTE *s2, int n)
 
static void sha_transform ()
 
void sha_init ()
 
void sha_update (const BYTE *buffer, int count)
 
void sha_final ()
 
void __attribute__ ((noinline))
 

Macro Definition Documentation

◆ CONST1

#define CONST1   0x5a827999L

Definition at line 39 of file sha.c.

◆ CONST2

#define CONST2   0x6ed9eba1L

Definition at line 40 of file sha.c.

◆ CONST3

#define CONST3   0x8f1bbcdcL

Definition at line 41 of file sha.c.

◆ CONST4

#define CONST4   0xca62c1d6L

Definition at line 42 of file sha.c.

◆ f1

#define f1 (   x,
  y,
 
)    ((x & y) | (~x & z))

Definition at line 32 of file sha.c.

◆ f2

#define f2 (   x,
  y,
 
)    (x ^ y ^ z)

Definition at line 33 of file sha.c.

◆ f3

#define f3 (   x,
  y,
 
)    ((x & y) | (x & z) | (y & z))

Definition at line 34 of file sha.c.

◆ f4

#define f4 (   x,
  y,
 
)    (x ^ y ^ z)

Definition at line 35 of file sha.c.

◆ FUNC

#define FUNC (   n,
 
)
Value:
temp = ROT32(A,5) + f##n(B,C,D) + E + W[i] + CONST##n; \
E = D; D = C; C = ROT32(B,30); B = A; A = temp
#define C
Definition: generate.c:15
#define A
Definition: generate.c:13
#define D
Definition: generate.c:16
#define W
Definition: deriche.h:36
#define B
Definition: generate.c:14
#define ROT32(x, n)
Definition: sha.c:46

Definition at line 48 of file sha.c.

Referenced by sha_transform().

◆ ROT32

#define ROT32 (   x,
 
)    ((x << n) | (x >> (32 - n)))

Definition at line 46 of file sha.c.

Function Documentation

◆ __attribute__()

void __attribute__ ( (noinline)  )

Definition at line 206 of file sha.c.

References __builtin_bambu_time_start(), __builtin_bambu_time_stop(), in_i, indata, sha_final(), sha_init(), sha_update(), and VSIZE.

Here is the call graph for this function:

◆ __builtin_bambu_time_start()

void __builtin_bambu_time_start ( )

◆ __builtin_bambu_time_stop()

void __builtin_bambu_time_stop ( )

◆ local_memcpy()

void local_memcpy ( INT32 s1,
const BYTE s2,
int  n 
)

Definition at line 73 of file sha.c.

◆ local_memset()

void local_memset ( INT32 s,
int  c,
int  n,
int  e 
)

Definition at line 53 of file sha.c.

◆ sha_final()

void sha_final ( )

Definition at line 179 of file sha.c.

References local_memset(), sha_info_count_hi, sha_info_count_lo, sha_info_data, and sha_transform().

Here is the call graph for this function:

◆ sha_init()

void sha_init ( )

Definition at line 144 of file sha.c.

References L, sha_info_count_hi, sha_info_count_lo, and sha_info_digest.

◆ sha_transform()

static void sha_transform ( )
static

Definition at line 98 of file sha.c.

References A, B, C, D, FUNC, sha_info_data, sha_info_digest, and W.

Referenced by sha_final(), and sha_update().

Here is the caller graph for this function:

◆ sha_update()

void sha_update ( const BYTE buffer,
int  count 
)

Definition at line 158 of file sha.c.

References local_memcpy(), SHA_BLOCKSIZE, sha_info_count_hi, sha_info_count_lo, sha_info_data, and sha_transform().

Here is the call graph for this function:

Generated on Mon Feb 12 2024 13:03:08 for PandA-2024.02 by doxygen 1.8.13