Skip to content

Commit 5dcbd69

Browse files
committed
Move golomb_coding from /crypto to new/ filter folder.
1 parent 3ac551a commit 5dcbd69

11 files changed

Lines changed: 124 additions & 85 deletions

File tree

Makefile.am

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ src_libbitcoin_system_la_SOURCES = \
7474
src/crypto/der_parser.cpp \
7575
src/crypto/ec_context.cpp \
7676
src/crypto/ec_context.hpp \
77-
src/crypto/golomb_coding.cpp \
7877
src/crypto/pseudo_random.cpp \
7978
src/crypto/ring_signature.cpp \
8079
src/crypto/secp256k1.cpp \
@@ -87,6 +86,7 @@ src_libbitcoin_system_la_SOURCES = \
8786
src/error/op_error_t.cpp \
8887
src/error/script_error_t.cpp \
8988
src/error/transaction_error_t.cpp \
89+
src/filter/golomb_coding.cpp \
9090
src/hash/accumulator.cpp \
9191
src/hash/checksum.cpp \
9292
src/hash/siphash.cpp \
@@ -495,7 +495,6 @@ include_bitcoin_system_crypto_HEADERS = \
495495
include/bitcoin/system/crypto/aes256.hpp \
496496
include/bitcoin/system/crypto/crypto.hpp \
497497
include/bitcoin/system/crypto/der_parser.hpp \
498-
include/bitcoin/system/crypto/golomb_coding.hpp \
499498
include/bitcoin/system/crypto/pseudo_random.hpp \
500499
include/bitcoin/system/crypto/ring_signature.hpp \
501500
include/bitcoin/system/crypto/secp256k1.hpp
@@ -542,6 +541,11 @@ include_bitcoin_system_error_HEADERS = \
542541
include/bitcoin/system/error/script_error_t.hpp \
543542
include/bitcoin/system/error/transaction_error_t.hpp
544543

544+
include_bitcoin_system_filterdir = ${includedir}/bitcoin/system/filter
545+
include_bitcoin_system_filter_HEADERS = \
546+
include/bitcoin/system/filter/filter.hpp \
547+
include/bitcoin/system/filter/golomb_coding.hpp
548+
545549
include_bitcoin_system_hashdir = ${includedir}/bitcoin/system/hash
546550
include_bitcoin_system_hash_HEADERS = \
547551
include/bitcoin/system/hash/accumulator.hpp \

builds/cmake/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,6 @@ add_library( ${CANONICAL_LIB_NAME}
515515
"../../src/crypto/der_parser.cpp"
516516
"../../src/crypto/ec_context.cpp"
517517
"../../src/crypto/ec_context.hpp"
518-
"../../src/crypto/golomb_coding.cpp"
519518
"../../src/crypto/pseudo_random.cpp"
520519
"../../src/crypto/ring_signature.cpp"
521520
"../../src/crypto/secp256k1.cpp"
@@ -528,6 +527,7 @@ add_library( ${CANONICAL_LIB_NAME}
528527
"../../src/error/op_error_t.cpp"
529528
"../../src/error/script_error_t.cpp"
530529
"../../src/error/transaction_error_t.cpp"
530+
"../../src/filter/golomb_coding.cpp"
531531
"../../src/hash/accumulator.cpp"
532532
"../../src/hash/checksum.cpp"
533533
"../../src/hash/siphash.cpp"

builds/msvc/vs2022/libbitcoin-system/libbitcoin-system.vcxproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@
138138
<ClCompile Include="..\..\..\..\src\crypto\aes256.cpp" />
139139
<ClCompile Include="..\..\..\..\src\crypto\der_parser.cpp" />
140140
<ClCompile Include="..\..\..\..\src\crypto\ec_context.cpp" />
141-
<ClCompile Include="..\..\..\..\src\crypto\golomb_coding.cpp" />
142141
<ClCompile Include="..\..\..\..\src\crypto\pseudo_random.cpp" />
143142
<ClCompile Include="..\..\..\..\src\crypto\ring_signature.cpp" />
144143
<ClCompile Include="..\..\..\..\src\crypto\secp256k1.cpp" />
@@ -152,6 +151,7 @@
152151
<ClCompile Include="..\..\..\..\src\error\op_error_t.cpp" />
153152
<ClCompile Include="..\..\..\..\src\error\script_error_t.cpp" />
154153
<ClCompile Include="..\..\..\..\src\error\transaction_error_t.cpp" />
154+
<ClCompile Include="..\..\..\..\src\filter\golomb_coding.cpp" />
155155
<ClCompile Include="..\..\..\..\src\hash\accumulator.cpp" />
156156
<ClCompile Include="..\..\..\..\src\hash\checksum.cpp" />
157157
<ClCompile Include="..\..\..\..\src\hash\siphash.cpp" />
@@ -292,7 +292,6 @@
292292
<ClInclude Include="..\..\..\..\include\bitcoin\system\crypto\aes256.hpp" />
293293
<ClInclude Include="..\..\..\..\include\bitcoin\system\crypto\crypto.hpp" />
294294
<ClInclude Include="..\..\..\..\include\bitcoin\system\crypto\der_parser.hpp" />
295-
<ClInclude Include="..\..\..\..\include\bitcoin\system\crypto\golomb_coding.hpp" />
296295
<ClInclude Include="..\..\..\..\include\bitcoin\system\crypto\pseudo_random.hpp" />
297296
<ClInclude Include="..\..\..\..\include\bitcoin\system\crypto\ring_signature.hpp" />
298297
<ClInclude Include="..\..\..\..\include\bitcoin\system\crypto\secp256k1.hpp" />
@@ -332,6 +331,8 @@
332331
<ClInclude Include="..\..\..\..\include\bitcoin\system\error\transaction_error_t.hpp" />
333332
<ClInclude Include="..\..\..\..\include\bitcoin\system\exceptions.hpp" />
334333
<ClInclude Include="..\..\..\..\include\bitcoin\system\execution.hpp" />
334+
<ClInclude Include="..\..\..\..\include\bitcoin\system\filter\filter.hpp" />
335+
<ClInclude Include="..\..\..\..\include\bitcoin\system\filter\golomb_coding.hpp" />
335336
<ClInclude Include="..\..\..\..\include\bitcoin\system\forks.hpp" />
336337
<ClInclude Include="..\..\..\..\include\bitcoin\system\funclets.hpp" />
337338
<ClInclude Include="..\..\..\..\include\bitcoin\system\hash\accumulator.hpp" />

builds/msvc/vs2022/libbitcoin-system/libbitcoin-system.vcxproj.filters

Lines changed: 82 additions & 73 deletions
Large diffs are not rendered by default.

include/bitcoin/system.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
#include <bitcoin/system/crypto/aes256.hpp>
8080
#include <bitcoin/system/crypto/crypto.hpp>
8181
#include <bitcoin/system/crypto/der_parser.hpp>
82-
#include <bitcoin/system/crypto/golomb_coding.hpp>
8382
#include <bitcoin/system/crypto/pseudo_random.hpp>
8483
#include <bitcoin/system/crypto/ring_signature.hpp>
8584
#include <bitcoin/system/crypto/secp256k1.hpp>
@@ -116,6 +115,8 @@
116115
#include <bitcoin/system/error/op_error_t.hpp>
117116
#include <bitcoin/system/error/script_error_t.hpp>
118117
#include <bitcoin/system/error/transaction_error_t.hpp>
118+
#include <bitcoin/system/filter/filter.hpp>
119+
#include <bitcoin/system/filter/golomb_coding.hpp>
119120
#include <bitcoin/system/hash/accumulator.hpp>
120121
#include <bitcoin/system/hash/algorithm.hpp>
121122
#include <bitcoin/system/hash/algorithms.hpp>

include/bitcoin/system/crypto/crypto.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
#include <bitcoin/system/crypto/aes256.hpp>
2323
#include <bitcoin/system/crypto/der_parser.hpp>
24-
#include <bitcoin/system/crypto/golomb_coding.hpp>
2524
#include <bitcoin/system/crypto/pseudo_random.hpp>
2625
#include <bitcoin/system/crypto/ring_signature.hpp>
2726
#include <bitcoin/system/crypto/secp256k1.hpp>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
3+
*
4+
* This file is part of libbitcoin.
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU Affero General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU Affero General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Affero General Public License
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
#ifndef LIBBITCOIN_SYSTEM_FILTER_FILTER_HPP
21+
#define LIBBITCOIN_SYSTEM_FILTER_FILTER_HPP
22+
23+
#include <bitcoin/system/filter/golomb_coding.hpp>
24+
25+
#endif

include/bitcoin/system/crypto/golomb_coding.hpp renamed to include/bitcoin/system/filter/golomb_coding.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
// Sponsored in part by Digital Contract Design, LLC
2121

22-
#ifndef LIBBITCOIN_SYSTEM_CRYPTO_GOLOMB_CODING
23-
#define LIBBITCOIN_SYSTEM_CRYPTO_GOLOMB_CODING
22+
#ifndef LIBBITCOIN_SYSTEM_FILTER_GOLOMB_CODING
23+
#define LIBBITCOIN_SYSTEM_FILTER_GOLOMB_CODING
2424

2525
#include <istream>
2626
#include <ostream>

src/define.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
// /radix : /words
5656
// /serial : /radix
5757
// /hash : /radix /endian
58+
// /filter : /hash
5859
// /crypto : /hash
5960
// /stream : /crypto /endian /error
6061
// /chain : /stream forks [forward: settings]
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,14 @@
1919

2020
// Sponsored in part by Digital Contract Design, LLC
2121

22-
#include <bitcoin/system/crypto/golomb_coding.hpp>
22+
#include <bitcoin/system/filter/golomb_coding.hpp>
2323

2424
#include <algorithm>
2525
#include <iostream>
2626
#include <utility>
2727
#include <vector>
2828
#include <bitcoin/system/math/math.hpp>
2929

30-
// TODO: change to ipp and duck type streams for performance.
31-
// TODO: not actually cryptographic functions, move to wallet.
3230
// Avoid in header, circular dependency with stream to crypto.
3331
#include <bitcoin/system/stream/stream.hpp>
3432

0 commit comments

Comments
 (0)