Commit Graph

35 Commits

Author SHA1 Message Date
Jack Grigg 7b005aaa7a Expand `CppStream` to cover all `Stream`-like C++ types
In its existing usage, `CppStream` was only used in a context where the
C++ `READWRITE` macro was being called with a `CDataStream`. However, in
other contexts the macro can be called with various other types with a
stream-like interface. Since we can't expose C++ templates across the
`cxx` bridge (or FFI generally), we instead turn `CppStream` into an
enum that covers all of the stream-like types we may want to use.
2023-04-06 21:30:38 +00:00
Kris Nuttycombe 3cec519ce4 scripted-diff: Update Zcash copyrights to 2023
-BEGIN VERIFY SCRIPT-
for party in "The Zcash developers" "The Bitcoin Core developers" "Bitcoin Developers"; do
  sed -i"" -e "s#Copyright (c) \([0-9]\{4\}\)\(-[0-9]\{4\}\)\? $party#Copyright (c) \1-2023 $party#" COPYING
  sed -i"" -e "s#\(.*\)\([0-9]\{4\}\)\(-[0-9]\{4\}\)\, $party#\1\2-2023, $party#" contrib/debian/copyright
done

sed -i"" -e "s/define(_COPYRIGHT_YEAR, [0-9]\{4\})/define(_COPYRIGHT_YEAR, 2023)/" configure.ac
sed -i"" -e "s/#define COPYRIGHT_YEAR [0-9]\{4\}/#define COPYRIGHT_YEAR 2023/" src/clientversion.h

git grep "^// Copyright (c) .* The Zcash developers" \
  | awk -F ':' '{print $1}' \
  | xargs -I {} sed -i"" -e "s#// Copyright (c) \([0-9]\{4\}\)\(-[0-9]\{4\}\)\? The Zcash developers#// Copyright (c) \1-2023 The Zcash developers#" {}
-END VERIFY SCRIPT-
2023-01-23 11:31:54 -07:00
Jack Grigg df08281f25 Migrate BLAKE2b Rust FFI to `cxx` 2022-05-27 20:15:05 +00:00
Kris Nuttycombe 73fcef8035 scripted-diff: Add 2018-2022 copyright headers for files added/modified in 2018
-BEGIN VERIFY SCRIPT-
grep -l "Copyright" $(grep -L "The Zcash developers" $(git diff --name-only --diff-filter=ACM b2a114a8c99947b66d1fbdc70278f13e7a415d2a..8df7a073ce13ec057b94b5a813bb5534cdfa6809 -- src/ test/ zcutil/ qa/)) | xargs -I {} sed -i"" -e "s#\(\(.*\)Copyright (c) .* The Bitcoin Core developers\)#\1\n\2Copyright (c) 2018-2022 The Zcash developers#" {}
-END VERIFY SCRIPT-
2022-05-11 17:28:03 -06:00
Pieter Wuille 46060d5c8b Support SipHash with arbitrary byte writes 2021-02-16 18:00:22 -07:00
Pieter Wuille f3b2cdb32b Add SipHash-2-4 primitives to hash 2021-02-11 11:10:42 -07:00
Homu 7d94064616 Auto merge of #4643 - str4d:locked-memory-manager, r=str4d
Locked memory manager

Add a pool for locked memory chunks, replacing `LockedPageManager`.

Cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#8321
- bitcoin/bitcoin#8753
- bitcoin/bitcoin#9063
- bitcoin/bitcoin#9070
- bitcoin/bitcoin#11385
- bitcoin/bitcoin#12048
  - Excludes change to benchmark.
- bitcoin/bitcoin#15117
- bitcoin/bitcoin#16161
  - Excludes Travis CI changes.
  - Includes change from bitcoin/bitcoin#13163
- bitcoin/bitcoin#15600
- bitcoin/bitcoin#18443
- Assorted small changes from:
  - bitcoin/bitcoin#9233
  - bitcoin/bitcoin#10483
  - bitcoin/bitcoin#10645
  - bitcoin/bitcoin#10969
  - bitcoin/bitcoin#11351
- bitcoin/bitcoin#19111
  - Excludes change to `src/rpc/server.cpp`
- bitcoin/bitcoin#9804
  - Only the commit for `src/key.cpp`
- bitcoin/bitcoin#9598
2020-09-29 22:18:48 +00:00
Jack Grigg 2d172e121f Replace libsodium's crypto_generichash_blake2b with blake2b_simd 2020-09-24 15:58:14 +01:00
Pieter Wuille 614d1bb207 Remove some unused functions and methods
In the case of CKey's destructor, it seems to have been an oversight in
f4d1fc259 not to delete it. At this point, it results in the move
constructors/assignment operators for CKey being deleted, which may have
a performance impact.
2020-07-31 06:51:33 +01:00
Daira Hopwood bc909a7a7f Replace http with https: in links to the MIT license.
Also change MIT/X11 to just MIT, since no distinction was intended.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2019-07-18 15:26:01 +01:00
Jack Grigg b7e75b17af
Implement basic Sapling v4 transaction parser
Details of Sapling datatypes will be filled in later; for now, they are treated
as binary blobs.

Includes code cherry-picked from upstream commit:
    7030d9eb47254499bba14f1c00abc6bf493efd91
    BIP144: Serialization, hashes, relay (sender side)
2018-04-19 05:01:47 +01:00
Jack Grigg 68a1a592ca
Remove nType and nVersion from Zcash-specific code 2018-04-17 13:09:47 +01:00
Pieter Wuille 242f1421db
Get rid of nType and nVersion
Remove the nType and nVersion as parameters to all serialization methods
and functions. There is only one place where it's read and has an impact
(in CAddress), and even there it does not impact any of the recursively
invoked serializers.

Instead, the few places that need nType or nVersion are changed to read
it directly from the stream object, through GetType() and GetVersion()
methods which are added to all stream classes.
2018-04-17 13:09:28 +01:00
Pieter Wuille 7f4acac433
Make nType and nVersion private and sometimes const
Make the various stream implementations' nType and nVersion private
and const (except in CDataStream where we really need a setter).
2018-04-16 07:38:37 -06:00
Pieter Wuille 1315591c85
Make streams' read and write return void
The stream implementations had two cascading layers (the upper one
with operator<< and operator>>, and a lower one with read and write).
The lower layer's functions are never cascaded (nor should they, as
they should only be used from the higher layer), so make them return
void instead.
2018-04-16 07:38:37 -06:00
Pieter Wuille 29a8ade782
Prevector type 2018-04-16 07:38:36 -06:00
Ariel 132dc81f7d
add blake2b writer 2018-02-20 04:22:21 +00:00
Cory Fields a574899671 chaincodes: abstract away more chaincode behavior
[squashme] replace struct CCainCode with a typedef uint256 ChainCode
2015-05-06 17:22:46 +02:00
sandakersmann f914f1a746
Added "Core" to copyright headers
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
Pieter Wuille 36fa4a78ac Split up crypto/sha2 2014-11-20 17:22:02 +01:00
Philip Kaufmann b4347f6035 minor code style cleanup after recent merges
- add a missing license header
- correct some header orderings etc.
2014-11-04 14:36:46 +01:00
Cory Fields 78c228c6e5 boost: moveonly: move BIP32Hash to hash.h 2014-10-31 01:13:07 -04:00
Philip Kaufmann 611116d4e3 header include cleanup
- ensures alphabetical ordering for includes etc. in source file headers
2014-09-14 12:43:56 +02:00
Philip Kaufmann 093303a887 add missing header end comments
- ensures a consistent usage in header files
- also add a blank line after the copyright header where missing
- also remove orphan new-lines at the end of some files
2014-08-28 22:25:21 +02:00
Pieter Wuille a0495bb68c Add <Hasher>::OUTPUT_SIZE 2014-06-21 19:47:43 +02:00
Pieter Wuille a5bc9c0917 Add built-in RIPEMD-160 implementation 2014-06-21 19:47:42 +02:00
Pieter Wuille 13b5dfef64 Move crypto implementations to src/crypto/ 2014-06-21 19:47:42 +02:00
Pieter Wuille 7b4737c878 Switch script.cpp and hash.cpp to use sha2.cpp instead of OpenSSL. 2014-06-21 19:47:39 +02:00
Pieter Wuille 977cdadea8 Add a built-in SHA256/SHA512 implementation.
This also moves the HMAC-SHA512 implementation to sha2.cpp.
2014-06-21 19:47:39 +02:00
Brandon Dahler 51ed9ec971 Cleanup code using forward declarations.
Use misc methods of avoiding unnecesary header includes.
Replace int typedefs with int##_t from stdint.h.
Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h.
Normalize QT_VERSION ifs where possible.
Resolve some indirect dependencies as direct ones.
Remove extern declarations from .cpp files.
2013-11-10 09:36:28 -06:00
super3 db0e8ccd90 Bump Year Number to 2013 2013-10-20 15:25:06 -04:00
Pieter Wuille 12dff9801f Add HMAC-SHA512 to hash 2013-06-24 00:56:45 +02:00
Pieter Wuille 5d891489ab Make CPubKey statically allocated 2013-05-30 05:18:42 +02:00
Matt Corallo 7ab026f449 Add MurmurHash3 implementation to hash.h/add hash.cpp. 2013-01-16 12:48:01 -05:00
Pieter Wuille 0fb9073edd Split off hash.h from util.h 2012-12-18 21:39:29 +01:00