The Sleuth Kit  4.3
Macros | Functions
sha1c.c File Reference

Local copy of the public domain SHA-1 library code by David Ireland. More...

#include "tsk_base_i.h"

Macros

#define expand(W, i)
 
#define f1(x, y, z)   ( z ^ ( x & ( y ^ z ) ) ) /* Rounds 0-19 */
 
#define f2(x, y, z)   ( x ^ y ^ z ) /* Rounds 20-39 */
 
#define f3(x, y, z)   ( ( x & y ) | ( z & ( x | y ) ) ) /* Rounds 40-59 */
 
#define f4(x, y, z)   ( x ^ y ^ z ) /* Rounds 60-79 */
 
#define h0init   0x67452301UL
 
#define h1init   0xEFCDAB89UL
 
#define h2init   0x98BADCFEUL
 
#define h3init   0x10325476UL
 
#define h4init   0xC3D2E1F0UL
 
#define K1   0x5A827999UL /* Rounds 0-19 */
 
#define K2   0x6ED9EBA1UL /* Rounds 20-39 */
 
#define K3   0x8F1BBCDCUL /* Rounds 40-59 */
 
#define K4   0xCA62C1D6UL /* Rounds 60-79 */
 
#define ROTL(n, X)   ( ( ( X ) << n ) | ( ( X ) >> ( 32 - n ) ) )
 
#define SHS_DATASIZE   64
 
#define SHS_DIGESTSIZE   20
 
#define subRound(a, b, c, d, e, f, k, data)   ( e += ROTL( 5, a ) + f( b, c, d ) + k + data, b = ROTL( 30, b ) )
 

Functions

void TSK_SHA_Final (BYTE output[SHS_DIGESTSIZE], TSK_SHA_CTX *shsInfo)
 Calculate the hash of the data added to the context. More...
 
void TSK_SHA_Init (TSK_SHA_CTX *shsInfo)
 Initialize a SHA-1 context so that data can be added to it. More...
 
void TSK_SHA_Update (TSK_SHA_CTX *shsInfo, BYTE *buffer, int count)
 Add data to an initialized SHA-1 context. More...
 

Detailed Description

Local copy of the public domain SHA-1 library code by David Ireland.

Macro Definition Documentation

#define expand (   W,
 
)
Value:
( W[ i & 15 ] = ROTL( 1, ( W[ i & 15 ] ^ W[ (i - 14) & 15 ] ^ \
W[ (i - 8) & 15 ] ^ W[ (i - 3) & 15 ] ) ) )

Copyright © 2007-2015 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.