Skip to content

Commit ea986a8

Browse files
committed
Merge #45: Allow fields to be opt-in rather than opt-out
67f5160 Add convenience defines for enabling byte sizes (Cory Fields) 812d428 Allow field opt-in (Cory Fields) Pull request description: This addresses the integration concern seen here: https://github.com/theuni/bitcoin/blob/minisketch-split/src/Makefile.minisketch.include#L4 If a field is explicitly enabled and disabled, disable takes precedence. Defines are intended to work as such: ``` Default: All fields enabled -DDISABLE_FIELD_3: All fields except 3 are enabled -DENABLE_FIELD_3: All fields enabled -DDISABLE_DEFAULT_FIELDS: Logical error, no fields enabled -DDISABLE_DEFAULT_FIELDS -DENABLE_FIELD_3: Only field 3 enabled -DDISABLE_DEFAULT_FIELDS -DENABLE_FIELD_2 -DENABLE_FIELD_3: Fields 2 and 3 are enabled -DDISABLE_DEFAULT_FIELDS -DENABLE_FIELD_2 -DENABLE_FIELD_3 -DDISABLE_FIELD_3: Only field 2 enabled ``` ACKs for top commit: sipa: utACK 67f5160 Tree-SHA512: b9e719450dd91089a74f7c59918372f1a36ff7fe3e1b6969d0db257e475ac8df56be650526a29ba8e50db8e63f20be005fa872890dbd84c616ccee4462b6d3dc
2 parents 985974d + 67f5160 commit ea986a8

20 files changed

+940
-362
lines changed

doc/gen_params.sage

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,14 +315,14 @@ def print_result(bits, style):
315315
assert(False)
316316

317317
for bits in range(2, 65):
318-
print("#ifndef DISABLE_FIELD_%i" % bits)
318+
print("#ifdef ENABLE_FIELD_INT_%i" % bits)
319319
print("// %i bit field" % bits)
320320
print_result(bits, INT)
321321
print("#endif")
322322
print("")
323323

324324
for bits in range(2, 65):
325-
print("#ifndef DISABLE_FIELD_%i" % bits)
325+
print("#ifdef ENABLE_FIELD_INT_%i" % bits)
326326
print("// %i bit field" % bits)
327327
print_result(bits, CLMUL)
328328
print_result(bits, CLMUL_TRI)

sources.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ MINISKETCH_DIST_HEADERS_INT += %reldir%/include/minisketch.h
1313

1414
MINISKETCH_LIB_HEADERS_INT =
1515
MINISKETCH_LIB_HEADERS_INT += %reldir%/src/false_positives.h
16+
MINISKETCH_LIB_HEADERS_INT += %reldir%/src/fielddefines.h
1617
MINISKETCH_LIB_HEADERS_INT += %reldir%/src/int_utils.h
1718
MINISKETCH_LIB_HEADERS_INT += %reldir%/src/lintrans.h
1819
MINISKETCH_LIB_HEADERS_INT += %reldir%/src/sketch.h

0 commit comments

Comments
 (0)