The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Functions
sha1.h File Reference

Local implementation of the SHA1 hashing scheme. More...

#include <freeradius-devel/build.h>
#include <freeradius-devel/missing.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
+ Include dependency graph for sha1.h:

Go to the source code of this file.

Data Structures

struct  fr_sha1_ctx
 

Macros

#define SHA1_DIGEST_LENGTH   20
 

Functions

int fr_hmac_sha1 (uint8_t digest[static SHA1_DIGEST_LENGTH], uint8_t const *in, size_t inlen, uint8_t const *key, size_t key_len)
 Calculate HMAC using internal SHA1 implementation. More...
 
void fr_sha1_final (uint8_t digest[static SHA1_DIGEST_LENGTH], fr_sha1_ctx *context)
 
void fr_sha1_final_no_len (uint8_t digest[static SHA1_DIGEST_LENGTH], fr_sha1_ctx *context)
 
void fr_sha1_init (fr_sha1_ctx *context)
 
void fr_sha1_transform (uint32_t state[static 5], uint8_t const buffer[static 64])
 
void fr_sha1_update (fr_sha1_ctx *context, uint8_t const *in, size_t len)
 

Detailed Description

Local implementation of the SHA1 hashing scheme.

SHA-1 in C 100% Public Domain

Author
Steve Reid (steve.nosp@m.@edm.nosp@m.web.c.nosp@m.om)

Definition in file sha1.h.


Data Structure Documentation

◆ fr_sha1_ctx

struct fr_sha1_ctx

Definition at line 33 of file sha1.h.

Data Fields
uint8_t buffer[64]
uint32_t count[2]
uint32_t state[5]

Macro Definition Documentation

◆ SHA1_DIGEST_LENGTH

#define SHA1_DIGEST_LENGTH   20

Definition at line 29 of file sha1.h.

Function Documentation

◆ fr_hmac_sha1()

int fr_hmac_sha1 ( uint8_t  digest[static SHA1_DIGEST_LENGTH],
uint8_t const *  in,
size_t  inlen,
uint8_t const *  key,
size_t  key_len 
)

Calculate HMAC using internal SHA1 implementation.

Parameters
digestCaller digest to be filled in.
inPointer to data stream.
inlenlength of data stream.
keyPointer to authentication key.
key_lenLength of authentication key.
Returns
  • 0 on success.
  • -1 on error.

Definition at line 124 of file hmac_sha1.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_sha1_final()

void fr_sha1_final ( uint8_t  digest[static SHA1_DIGEST_LENGTH],
fr_sha1_ctx context 
)

Definition at line 141 of file sha1.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_sha1_final_no_len()

void fr_sha1_final_no_len ( uint8_t  digest[static SHA1_DIGEST_LENGTH],
fr_sha1_ctx context 
)

Definition at line 174 of file sha1.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_sha1_init()

void fr_sha1_init ( fr_sha1_ctx context)

Definition at line 93 of file sha1.c.

+ Here is the caller graph for this function:

◆ fr_sha1_transform()

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

Definition at line 35 of file sha1.c.

+ Here is the caller graph for this function:

◆ fr_sha1_update()

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

Definition at line 105 of file sha1.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: