All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
sha1.c File Reference
#include <freeradius-devel/libradius.h>
#include "../include/sha1.h"
+ Include dependency graph for sha1.c:

Go to the source code of this file.

Macros

#define blk(i)
 
#define blk0(i)   (block->l[i] = htonl(block->l[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);
 
#define rol(value, bits)   (((value) << (bits)) | ((value) >> (32 - (bits))))
 

Functions

void fr_sha1_final (uint8_t digest[20], fr_sha1_ctx *context)
 
void fr_sha1_final_no_len (uint8_t digest[20], fr_sha1_ctx *context)
 
void fr_sha1_init (fr_sha1_ctx *context)
 
void fr_sha1_transform (uint32_t state[5], uint8_t const buffer[64])
 
void fr_sha1_update (fr_sha1_ctx *context, uint8_t const *data, size_t len)
 

Macro Definition Documentation

#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:16

Definition at line 23 of file sha1.c.

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

Definition at line 21 of file sha1.c.

#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 27 of file sha1.c.

#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 28 of file sha1.c.

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

Definition at line 29 of file sha1.c.

#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 30 of file sha1.c.

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

Definition at line 31 of file sha1.c.

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

Definition at line 16 of file sha1.c.

Function Documentation

void fr_sha1_final ( uint8_t  digest[20],
fr_sha1_ctx context 
)

Definition at line 132 of file sha1.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fr_sha1_final_no_len ( uint8_t  digest[20],
fr_sha1_ctx context 
)

Definition at line 165 of file sha1.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fr_sha1_init ( fr_sha1_ctx context)

Definition at line 94 of file sha1.c.

+ Here is the caller graph for this function:

void fr_sha1_transform ( uint32_t  state[5],
uint8_t const  buffer[64] 
)

Definition at line 36 of file sha1.c.

+ Here is the caller graph for this function:

void fr_sha1_update ( fr_sha1_ctx context,
uint8_t const *  data,
size_t  len 
)

Definition at line 106 of file sha1.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: