Skip to content

Commit 588f574

Browse files
committed
**4.10.1**
30/09/2021 merge in pull request 108 Configure CMake for pthreads fix to 48 Bucket hash
1 parent 806d887 commit 588f574

File tree

5 files changed

+37
-9
lines changed

5 files changed

+37
-9
lines changed

‎CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ project(TLSH)
5757

5858
set(VERSION_MAJOR 4)
5959
set(VERSION_MINOR 10)
60-
set(VERSION_PATCH 0)
60+
set(VERSION_PATCH 1)
6161

6262
# TLSH uses only half the counting buckets.
6363
# It can use all the buckets now.

‎Change_History.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,3 +703,10 @@ TIME ms= 21.00 per million iterations
703703
using HAC-T
704704
we provide scripts to show people how to cluster the Malware Bazaar dataset using TLSH
705705
</PRE>
706+
707+
**4.10.1**
708+
<PRE>
709+
30/09/2021
710+
merge in pull request 108 Configure CMake for pthreads
711+
fix to 48 Bucket hash
712+
</PRE>

‎README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,13 +299,11 @@ TLSH similarity is expressed as a difference score:
299299

300300
# Current Version
301301

302-
**4.10.0**
302+
**4.10.1**
303303
<PRE>
304-
22/09/2021
305-
added Python tools for clustering file
306-
using DBSCAN
307-
using HAC-T
308-
we provide scripts to show people how to cluster the Malware Bazaar dataset using TLSH
304+
30/09/2021
305+
merge in pull request 108 Configure CMake for pthreads
306+
fix to 48 Bucket hash
309307
</PRE>
310308

311309
# Change History

‎include/tlsh_win_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#define VERSION_MAJOR 4
99
#define VERSION_MINOR 10
10-
#define VERSION_PATCH 0
10+
#define VERSION_PATCH 1
1111
#define TLSH_HASH "compact hash"
1212
#define TLSH_CHECKSUM "1 byte checksum"
1313

‎src/tlsh_impl.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,25 @@ static unsigned char v_table[256] = {
121121
51, 65, 28, 144, 254, 221, 93, 189, 194, 139, 112, 43, 71, 109, 184, 209
122122
};
123123

124+
static unsigned char v_table48[256] = {
125+
1, 39, 1, 12, 32, 34, 6, 22, 25, 1, 6, 36, 48, 38, 44, 19,
126+
14, 5, 21, 37, 17, 37, 26, 32, 16, 47, 24, 34, 44, 46, 38, 8,
127+
14, 33, 8, 7, 45, 48, 48, 2, 29, 5, 33, 18, 45, 0, 31, 30,
128+
25, 11, 46, 22, 38, 45, 48, 34, 24, 48, 20, 22, 48, 35, 5, 43,
129+
1, 42, 9, 22, 12, 48, 34, 31, 16, 5, 31, 7, 15, 14, 39, 48,
130+
30, 25, 19, 10, 18, 10, 10, 3, 48, 27, 17, 43, 38, 35, 0, 48,
131+
36, 8, 4, 27, 32, 37, 14, 4, 34, 30, 43, 13, 9, 48, 24, 27,
132+
23, 20, 31, 30, 35, 40, 9, 3, 26, 11, 44, 32, 40, 18, 4, 10,
133+
42, 30, 0, 39, 12, 35, 13, 26, 47, 26, 48, 46, 33, 18, 15, 8,
134+
26, 7, 19, 23, 48, 14, 3, 6, 7, 11, 7, 28, 42, 5, 23, 35,
135+
29, 29, 15, 46, 31, 47, 41, 16, 9, 41, 33, 32, 25, 16, 37, 27,
136+
22, 25, 2, 13, 46, 20, 9, 1, 38, 36, 15, 20, 10, 23, 21, 37,
137+
27, 44, 19, 28, 24, 48, 42, 4, 29, 12, 21, 48, 19, 13, 39, 11,
138+
41, 40, 42, 3, 6, 0, 11, 33, 20, 47, 2, 12, 21, 36, 21, 28,
139+
44, 36, 18, 28, 41, 6, 15, 8, 41, 40, 17, 4, 39, 47, 2, 24,
140+
3, 17, 28, 0, 48, 29, 45, 45, 2, 43, 16, 43, 23, 13, 40, 17,
141+
};
142+
124143
// Pearson's algorithm
125144
unsigned char b_mapping(unsigned char salt, unsigned char i, unsigned char j, unsigned char k) {
126145
unsigned char h = 0;
@@ -144,7 +163,11 @@ unsigned char faster_b_mapping(unsigned char mod_salt, unsigned char i, unsigned
144163
}
145164
*/
146165

147-
#define fast_b_mapping(ms,i,j,k) (v_table[ v_table[ v_table[ms^i] ^ j] ^ k ])
166+
#if defined BUCKETS_48
167+
#define fast_b_mapping(ms,i,j,k) (v_table48[ v_table[ v_table[ms^i] ^ j] ^ k ])
168+
#else
169+
#define fast_b_mapping(ms,i,j,k) (v_table [ v_table[ v_table[ms^i] ^ j] ^ k ])
170+
#endif
148171

149172
////////////////////////////////////////////////////////////////////////////////////////////
150173

0 commit comments

Comments
 (0)