Rizin
unix-like reverse engineering framework and cli tools
lz_encoder_hash.h File Reference

Hash macros for match finders. More...

#include "check.h"

Go to the source code of this file.

Macros

#define hash_table   lzma_crc32_table[0]
 
#define HASH_2_SIZE   (UINT32_C(1) << 10)
 
#define HASH_3_SIZE   (UINT32_C(1) << 16)
 
#define HASH_4_SIZE   (UINT32_C(1) << 20)
 
#define HASH_2_MASK   (HASH_2_SIZE - 1)
 
#define HASH_3_MASK   (HASH_3_SIZE - 1)
 
#define HASH_4_MASK   (HASH_4_SIZE - 1)
 
#define FIX_3_HASH_SIZE   (HASH_2_SIZE)
 
#define FIX_4_HASH_SIZE   (HASH_2_SIZE + HASH_3_SIZE)
 
#define FIX_5_HASH_SIZE   (HASH_2_SIZE + HASH_3_SIZE + HASH_4_SIZE)
 
#define hash_2_calc()
 
#define hash_3_calc()
 
#define hash_4_calc()
 
#define hash_5_calc()
 
#define hash_zip_calc()
 
#define mt_hash_2_calc()
 
#define mt_hash_3_calc()
 
#define mt_hash_4_calc()
 

Detailed Description

Hash macros for match finders.

Definition in file lz_encoder_hash.h.

Macro Definition Documentation

◆ FIX_3_HASH_SIZE

#define FIX_3_HASH_SIZE   (HASH_2_SIZE)

Definition at line 35 of file lz_encoder_hash.h.

◆ FIX_4_HASH_SIZE

#define FIX_4_HASH_SIZE   (HASH_2_SIZE + HASH_3_SIZE)

Definition at line 36 of file lz_encoder_hash.h.

◆ FIX_5_HASH_SIZE

#define FIX_5_HASH_SIZE   (HASH_2_SIZE + HASH_3_SIZE + HASH_4_SIZE)

Definition at line 37 of file lz_encoder_hash.h.

◆ hash_2_calc

#define hash_2_calc ( )
Value:
const uint32_t hash_value \
= (uint32_t)(cur[0]) | ((uint32_t)(cur[1]) << 8)
unsigned int uint32_t
Definition: sftypes.h:29

Definition at line 44 of file lz_encoder_hash.h.

◆ HASH_2_MASK

#define HASH_2_MASK   (HASH_2_SIZE - 1)

Definition at line 31 of file lz_encoder_hash.h.

◆ HASH_2_SIZE

#define HASH_2_SIZE   (UINT32_C(1) << 10)

Definition at line 27 of file lz_encoder_hash.h.

◆ hash_3_calc

#define hash_3_calc ( )
Value:
const uint32_t temp = hash_table[cur[0]] ^ cur[1]; \
const uint32_t hash_2_value = temp & HASH_2_MASK; \
const uint32_t hash_value \
= (temp ^ ((uint32_t)(cur[2]) << 8)) & mf->hash_mask
#define hash_table
#define HASH_2_MASK

Definition at line 49 of file lz_encoder_hash.h.

◆ HASH_3_MASK

#define HASH_3_MASK   (HASH_3_SIZE - 1)

Definition at line 32 of file lz_encoder_hash.h.

◆ HASH_3_SIZE

#define HASH_3_SIZE   (UINT32_C(1) << 16)

Definition at line 28 of file lz_encoder_hash.h.

◆ hash_4_calc

#define hash_4_calc ( )
Value:
const uint32_t temp = hash_table[cur[0]] ^ cur[1]; \
const uint32_t hash_2_value = temp & HASH_2_MASK; \
const uint32_t hash_3_value \
= (temp ^ ((uint32_t)(cur[2]) << 8)) & HASH_3_MASK; \
const uint32_t hash_value = (temp ^ ((uint32_t)(cur[2]) << 8) \
^ (hash_table[cur[3]] << 5)) & mf->hash_mask
#define HASH_3_MASK

Definition at line 55 of file lz_encoder_hash.h.

◆ HASH_4_MASK

#define HASH_4_MASK   (HASH_4_SIZE - 1)

Definition at line 33 of file lz_encoder_hash.h.

◆ HASH_4_SIZE

#define HASH_4_SIZE   (UINT32_C(1) << 20)

Definition at line 29 of file lz_encoder_hash.h.

◆ hash_5_calc

#define hash_5_calc ( )
Value:
const uint32_t temp = hash_table[cur[0]] ^ cur[1]; \
const uint32_t hash_2_value = temp & HASH_2_MASK; \
const uint32_t hash_3_value \
= (temp ^ ((uint32_t)(cur[2]) << 8)) & HASH_3_MASK; \
uint32_t hash_4_value = (temp ^ ((uint32_t)(cur[2]) << 8) ^ \
^ hash_table[cur[3]] << 5); \
const uint32_t hash_value \
= (hash_4_value ^ (hash_table[cur[4]] << 3)) \
& mf->hash_mask; \
hash_4_value &= HASH_4_MASK
#define HASH_4_MASK

Definition at line 66 of file lz_encoder_hash.h.

◆ hash_table

#define hash_table   lzma_crc32_table[0]

Definition at line 24 of file lz_encoder_hash.h.

◆ hash_zip_calc

#define hash_zip_calc ( )
Value:
const uint32_t hash_value \
= (((uint32_t)(cur[2]) | ((uint32_t)(cur[0]) << 8)) \
^ hash_table[cur[1]]) & 0xFFFF

Definition at line 85 of file lz_encoder_hash.h.

◆ mt_hash_2_calc

#define mt_hash_2_calc ( )
Value:
const uint32_t hash_2_value \
= (hash_table[cur[0]] ^ cur[1]) & HASH_2_MASK

Definition at line 90 of file lz_encoder_hash.h.

◆ mt_hash_3_calc

#define mt_hash_3_calc ( )
Value:
const uint32_t temp = hash_table[cur[0]] ^ cur[1]; \
const uint32_t hash_2_value = temp & HASH_2_MASK; \
const uint32_t hash_3_value \
= (temp ^ ((uint32_t)(cur[2]) << 8)) & HASH_3_MASK

Definition at line 94 of file lz_encoder_hash.h.

◆ mt_hash_4_calc

#define mt_hash_4_calc ( )
Value:
const uint32_t temp = hash_table[cur[0]] ^ cur[1]; \
const uint32_t hash_2_value = temp & HASH_2_MASK; \
const uint32_t hash_3_value \
= (temp ^ ((uint32_t)(cur[2]) << 8)) & HASH_3_MASK; \
const uint32_t hash_4_value = (temp ^ ((uint32_t)(cur[2]) << 8) ^ \
(hash_table[cur[3]] << 5)) & HASH_4_MASK

Definition at line 100 of file lz_encoder_hash.h.