Changeset 1919 for trunk/lib/test


Ignore:
Timestamp:
Feb 11, 2012, 12:01:17 AM (7 years ago)
Author:
ksherdy
Message:

Simplified hash functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/test/hash_test.cpp

    r1918 r1919  
    101101    */
    102102
    103     /*
    104     for(uint32_t mask_bits=1;mask_bits<64;mask_bits++) {
    105         r = byte_mask_hash((uint8_t *) &b0, 0, mask_bits);
    106         print_register("r", r);
    107     }
    108     */
    109 
    110     // Length 8 (bits)
    111     /*
    112     hash_size = 8;
    113     for(uint32_t pos=0;pos<sizeof(uint64_t);pos++) {
    114 
    115         r = bit_compress_hash((uint8_t *) &b0,(uint8_t *) &b2, pos*8, 8, hash_size);
    116         cout << dec << "bit_compress_hash = " << r << endl << endl;
    117         cout << endl << endl;
    118 
    119     }
    120     */
    121 
    122     /*
    123103    uint8_t pos, slice;
    124104    hash_size = 8;
     
    126106    slice = 16;
    127107    pos = 0;
    128     r = byte_compress_hash((uint8_t *) &b0, pos, slice, hash_size);
     108    r = compress_hash((uint8_t *) &b0, pos, slice, hash_size);
    129109
    130110    pos = 1;
    131     r = byte_compress_hash((uint8_t *) &b0, pos, slice, hash_size);
     111    r = compress_hash((uint8_t *) &b0, pos, slice, hash_size);
    132112
    133113    slice = 24;
    134114    pos = 0;
    135     r = byte_compress_hash((uint8_t *) &b0, pos, slice, hash_size);
     115    r = compress_hash((uint8_t *) &b0, pos, slice, hash_size);
    136116
    137117    pos = 1;
    138     r = byte_compress_hash((uint8_t *) &b0, pos, slice, hash_size);
     118    r = compress_hash((uint8_t *) &b0, pos, slice, hash_size);
    139119
    140120    slice = 32;
    141121
    142122    pos = 0;
    143     r = byte_compress_hash((uint8_t *) &b0, pos, slice, hash_size);
     123    r = compress_hash((uint8_t *) &b0, pos, slice, hash_size);
    144124
    145125    pos = 1;
    146     r = byte_compress_hash((uint8_t *) &b0, pos, slice, hash_size);
     126    r = compress_hash((uint8_t *) &b0, pos, slice, hash_size);
    147127
    148128    pos = 2;
    149     r = byte_compress_hash((uint8_t *) &b0, pos, slice, hash_size);
    150     */
     129    r = compress_hash((uint8_t *) &b0, pos, slice, hash_size);
     130
     131    pos = 0;
     132    slice = 8*10;
     133    hash_size = 16;
     134    r = compress_hash((uint8_t *) &b0, pos, slice, hash_size);
     135
    151136
    152137    return 1;
Note: See TracChangeset for help on using the changeset viewer.