Skip to content

Commit 689a4cc

Browse files
authored
Merge pull request #138 from a4lg/make-other-buckets-work
Build: Define default options only on "default"
2 parents 809279e + 396b877 commit 689a4cc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

‎CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ set(VERSION_PATCH 0)
6161

6262
# TLSH uses only half the counting buckets.
6363
# It can use all the buckets now.
64+
if(NOT TLSH_BUCKETS_48 AND NOT TLSH_BUCKETS_128 AND NOT TLSH_BUCKETS_256)
6465
set(TLSH_BUCKETS_128 1)
66+
endif()
6567
if(TLSH_BUCKETS_48 EQUAL 1)
6668
set(TLSH_HASH "min hash")
6769
add_definitions(-DBUCKETS_48)
@@ -77,7 +79,9 @@ endif()
7779

7880
# TLSH uses 1 byte checksum. The collision rate is 1 in 24.
7981
# It can use 3 bytes checksum now. That collision rate in 1 in 5800.
82+
if(NOT TLSH_CHECKSUM_0B AND NOT TLSH_CHECKSUM_1B AND TLSH_CHECKSUM_3B)
8083
set(TLSH_CHECKSUM_1B 1)
84+
endif()
8185

8286
if(TLSH_CHECKSUM_0B EQUAL 1)
8387
set(TLSH_CHECKSUM "no checksum")

‎include/tlsh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class TlshImpl;
103103

104104
#if defined BUCKETS_48
105105
// No 3 Byte checksum option for 48 Bucket min hash
106-
#define TLSH_STRING_LEN 30
106+
#define TLSH_STRING_LEN_REQ 30
107107
// changed the minimum data length to 256 for version 3.3
108108
#define MIN_DATA_LENGTH 10
109109
// added the -force option for version 3.5

0 commit comments

Comments
 (0)