Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

Hash.h File Reference

#include <stdlib.h>
#include "BroString.h"

Include dependency graph for Hash.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Classes

class  HashKey

Defines

#define NUM_HASH_KEYS   (int(HASH_KEY_STRING) + 1)

Typedefs

typedef unsigned int hash_t

Enumerations

enum  HashKeyTag { HASH_KEY_INT, HASH_KEY_DOUBLE, NUM_HASH_KEYS }

Functions

void init_hash_function ()

Variables

int hash_cnt_all
int hash_cnt_uhash


Define Documentation

#define NUM_HASH_KEYS   (int(HASH_KEY_STRING) + 1)
 


Typedef Documentation

typedef unsigned int hash_t
 

Definition at line 29 of file Hash.h.

Referenced by SSL_Interpreter::analyzeCertificate(), CertStore::CertStore(), DictEntry::DictEntry(), Dictionary::DoRemove(), HashKey::Hash(), HashKey::HashBytes(), HashKey::HashKey(), Dictionary::Insert(), CertStore::isSameCert(), Dictionary::Lookup(), and Dictionary::Remove().


Enumeration Type Documentation

enum HashKeyTag
 

Enumeration values:
HASH_KEY_INT 
HASH_KEY_DOUBLE 
NUM_HASH_KEYS 

Definition at line 31 of file Hash.h.

00031              {
00032         HASH_KEY_INT,
00033         HASH_KEY_DOUBLE,
00034         HASH_KEY_STRING
00035 #define NUM_HASH_KEYS (int(HASH_KEY_STRING) + 1)
00036 } HashKeyTag;


Function Documentation

void init_hash_function  ) 
 

Definition at line 62 of file Hash.cc.

References hmac_md5(), internal_error(), shared_hmac_md5_key, uhash_key, UHASH_KEY_SIZE, and uint32.

Referenced by main().

00063         {
00064         if ( UHASH_KEY_SIZE % 16 != 0 )
00065                 internal_error("uhash key size must be multiply of 16");
00066 
00067         // Both Dietzfelbinger and H3 use random() to generate keys
00068         // -- is it strong enough?
00069 #ifdef USE_DIETZFELBINGER
00070         two_wise = new TwoWise((UHASH_KEY_SIZE + 3) >> 2);
00071 #endif
00072 
00073 #ifdef USE_H3
00074         h3 = new H3<hash_t, UHASH_KEY_SIZE>();
00075 #endif
00076 
00077 #if defined(USE_UHASH) || defined(USE_UMAC_NH)
00078         uint32 buf2[5];
00079         memcpy(buf2, shared_hmac_md5_key, sizeof(shared_hmac_md5_key));
00080 
00081         for ( int i = 0; i < UHASH_KEY_SIZE; i += 16 )
00082                 {
00083                 buf2[4] = i;
00084                 hmac_md5(sizeof(buf2), (const unsigned char*) buf2, uhash_key + i);
00085                 }
00086 #endif
00087         }


Variable Documentation

int hash_cnt_all
 

Definition at line 108 of file Hash.h.

Referenced by HashKey::HashBytes().

int hash_cnt_uhash
 

Definition at line 108 of file Hash.h.

Referenced by HashKey::HashBytes().


Generated on Wed Sep 14 03:00:14 2005 for bro_docs by doxygen 1.3.5