From 984fe694489f75c3f895cb677edad28f2396053c Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 1 May 2023 09:19:35 +1000 Subject: [PATCH 1/3] bitcoin: Remove attribution from all files Currently we have a mishmash of attribution lines accompanying the SPDX identifier. These lines are basically meaningless because: - The date is often wrong - The original author attributed is not the only contributor to a file - The term "rust bitcoin developers" is basically just noise Just remove all the attribution lines and be done with it. While we are at it add an SPDX line to the few files missing it, whether this license nonsense is even needed is left as an argument for another day. --- bitcoin/src/address.rs | 1 - bitcoin/src/base58.rs | 1 - bitcoin/src/bip158.rs | 1 - bitcoin/src/bip32.rs | 1 - bitcoin/src/blockdata/block.rs | 1 - bitcoin/src/blockdata/constants.rs | 1 - bitcoin/src/blockdata/fee_rate.rs | 2 ++ bitcoin/src/blockdata/locktime/absolute.rs | 1 - bitcoin/src/blockdata/locktime/mod.rs | 1 - bitcoin/src/blockdata/locktime/relative.rs | 1 - bitcoin/src/blockdata/mod.rs | 1 - bitcoin/src/blockdata/opcodes.rs | 1 - bitcoin/src/blockdata/script/borrowed.rs | 1 - bitcoin/src/blockdata/script/builder.rs | 1 - bitcoin/src/blockdata/script/instruction.rs | 1 - bitcoin/src/blockdata/script/mod.rs | 1 - bitcoin/src/blockdata/script/owned.rs | 1 - bitcoin/src/blockdata/script/push_bytes.rs | 2 ++ bitcoin/src/blockdata/script/tests.rs | 2 ++ bitcoin/src/blockdata/transaction.rs | 1 - bitcoin/src/blockdata/weight.rs | 2 ++ bitcoin/src/consensus/encode.rs | 1 - bitcoin/src/consensus/params.rs | 1 - bitcoin/src/consensus/serde.rs | 2 ++ bitcoin/src/crypto/ecdsa.rs | 1 - bitcoin/src/crypto/key.rs | 1 - bitcoin/src/crypto/mod.rs | 1 - bitcoin/src/crypto/taproot.rs | 1 - bitcoin/src/error.rs | 2 ++ bitcoin/src/hash_types.rs | 1 - bitcoin/src/internal_macros.rs | 1 - bitcoin/src/lib.rs | 1 - bitcoin/src/merkle_tree/block.rs | 1 - bitcoin/src/merkle_tree/mod.rs | 1 - bitcoin/src/network/address.rs | 1 - bitcoin/src/network/constants.rs | 1 - bitcoin/src/network/message.rs | 1 - bitcoin/src/network/message_blockdata.rs | 1 - bitcoin/src/network/message_compact_blocks.rs | 2 ++ bitcoin/src/network/message_network.rs | 1 - bitcoin/src/network/mod.rs | 1 - bitcoin/src/parse.rs | 2 ++ bitcoin/src/policy.rs | 1 - bitcoin/src/pow.rs | 1 - bitcoin/src/sign_message.rs | 1 - bitcoin/src/test_macros.rs | 1 - bitcoin/src/util/mod.rs | 1 - 47 files changed, 16 insertions(+), 39 deletions(-) diff --git a/bitcoin/src/address.rs b/bitcoin/src/address.rs index 533a83ef..606f5ac4 100644 --- a/bitcoin/src/address.rs +++ b/bitcoin/src/address.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin addresses. diff --git a/bitcoin/src/base58.rs b/bitcoin/src/base58.rs index 99321c10..98fea7cf 100644 --- a/bitcoin/src/base58.rs +++ b/bitcoin/src/base58.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Base58 encoder and decoder. diff --git a/bitcoin/src/bip158.rs b/bitcoin/src/bip158.rs index b7009fe8..2f794ca8 100644 --- a/bitcoin/src/bip158.rs +++ b/bitcoin/src/bip158.rs @@ -1,4 +1,3 @@ -// Written in 2019 by Tammas Blummer. // SPDX-License-Identifier: CC0-1.0 // This module was largely copied from https://github.com/rust-bitcoin/murmel/blob/master/src/blockfilter.rs diff --git a/bitcoin/src/bip32.rs b/bitcoin/src/bip32.rs index f30f0d03..31d7fce3 100644 --- a/bitcoin/src/bip32.rs +++ b/bitcoin/src/bip32.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! BIP32 implementation. diff --git a/bitcoin/src/blockdata/block.rs b/bitcoin/src/blockdata/block.rs index 0065903f..b496787a 100644 --- a/bitcoin/src/blockdata/block.rs +++ b/bitcoin/src/blockdata/block.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin blocks. diff --git a/bitcoin/src/blockdata/constants.rs b/bitcoin/src/blockdata/constants.rs index b88eeb12..3e55e8dd 100644 --- a/bitcoin/src/blockdata/constants.rs +++ b/bitcoin/src/blockdata/constants.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Blockdata constants. diff --git a/bitcoin/src/blockdata/fee_rate.rs b/bitcoin/src/blockdata/fee_rate.rs index a0686bda..45f83322 100644 --- a/bitcoin/src/blockdata/fee_rate.rs +++ b/bitcoin/src/blockdata/fee_rate.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! Implements `FeeRate` and assoctiated features. use core::fmt; diff --git a/bitcoin/src/blockdata/locktime/absolute.rs b/bitcoin/src/blockdata/locktime/absolute.rs index a755d065..957a50e0 100644 --- a/bitcoin/src/blockdata/locktime/absolute.rs +++ b/bitcoin/src/blockdata/locktime/absolute.rs @@ -1,4 +1,3 @@ -// Rust Bitcoin Library - Written by the rust-bitcoin developers. // SPDX-License-Identifier: CC0-1.0 //! Provides type [`LockTime`] that implements the logic around nLockTime/OP_CHECKLOCKTIMEVERIFY. diff --git a/bitcoin/src/blockdata/locktime/mod.rs b/bitcoin/src/blockdata/locktime/mod.rs index 5100d702..c09d3323 100644 --- a/bitcoin/src/blockdata/locktime/mod.rs +++ b/bitcoin/src/blockdata/locktime/mod.rs @@ -1,4 +1,3 @@ -// Rust Bitcoin Library - Written by the rust-bitcoin developers. // SPDX-License-Identifier: CC0-1.0 //! Provides absolute and relative locktimes. diff --git a/bitcoin/src/blockdata/locktime/relative.rs b/bitcoin/src/blockdata/locktime/relative.rs index 21fb237e..4d596acc 100644 --- a/bitcoin/src/blockdata/locktime/relative.rs +++ b/bitcoin/src/blockdata/locktime/relative.rs @@ -1,4 +1,3 @@ -// Rust Bitcoin Library - Written by the rust-bitcoin developers. // SPDX-License-Identifier: CC0-1.0 //! Provides type [`LockTime`] that implements the logic around nSequence/OP_CHECKSEQUENCEVERIFY. diff --git a/bitcoin/src/blockdata/mod.rs b/bitcoin/src/blockdata/mod.rs index 12cc342a..234f1623 100644 --- a/bitcoin/src/blockdata/mod.rs +++ b/bitcoin/src/blockdata/mod.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin block data. diff --git a/bitcoin/src/blockdata/opcodes.rs b/bitcoin/src/blockdata/opcodes.rs index 296e8a65..76ddbce8 100644 --- a/bitcoin/src/blockdata/opcodes.rs +++ b/bitcoin/src/blockdata/opcodes.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin script opcodes. diff --git a/bitcoin/src/blockdata/script/borrowed.rs b/bitcoin/src/blockdata/script/borrowed.rs index b9807138..aad2f557 100644 --- a/bitcoin/src/blockdata/script/borrowed.rs +++ b/bitcoin/src/blockdata/script/borrowed.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 use core::convert::{TryFrom, TryInto}; diff --git a/bitcoin/src/blockdata/script/builder.rs b/bitcoin/src/blockdata/script/builder.rs index 56f4fef0..15eaee44 100644 --- a/bitcoin/src/blockdata/script/builder.rs +++ b/bitcoin/src/blockdata/script/builder.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 #[cfg(feature = "bitcoinconsensus")] diff --git a/bitcoin/src/blockdata/script/instruction.rs b/bitcoin/src/blockdata/script/instruction.rs index 25e241ba..8d824807 100644 --- a/bitcoin/src/blockdata/script/instruction.rs +++ b/bitcoin/src/blockdata/script/instruction.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 use core::convert::TryInto; diff --git a/bitcoin/src/blockdata/script/mod.rs b/bitcoin/src/blockdata/script/mod.rs index 596f8918..c3cab10f 100644 --- a/bitcoin/src/blockdata/script/mod.rs +++ b/bitcoin/src/blockdata/script/mod.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin scripts. diff --git a/bitcoin/src/blockdata/script/owned.rs b/bitcoin/src/blockdata/script/owned.rs index feaf27f7..0eea4896 100644 --- a/bitcoin/src/blockdata/script/owned.rs +++ b/bitcoin/src/blockdata/script/owned.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 #[cfg(doc)] diff --git a/bitcoin/src/blockdata/script/push_bytes.rs b/bitcoin/src/blockdata/script/push_bytes.rs index 141c012c..ac2b9138 100644 --- a/bitcoin/src/blockdata/script/push_bytes.rs +++ b/bitcoin/src/blockdata/script/push_bytes.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! Contains `PushBytes` & co use core::borrow::{Borrow, BorrowMut}; diff --git a/bitcoin/src/blockdata/script/tests.rs b/bitcoin/src/blockdata/script/tests.rs index 1675649e..464c121f 100644 --- a/bitcoin/src/blockdata/script/tests.rs +++ b/bitcoin/src/blockdata/script/tests.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + use core::str::FromStr; use hashes::Hash; diff --git a/bitcoin/src/blockdata/transaction.rs b/bitcoin/src/blockdata/transaction.rs index feebd93d..62b28f61 100644 --- a/bitcoin/src/blockdata/transaction.rs +++ b/bitcoin/src/blockdata/transaction.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin transactions. diff --git a/bitcoin/src/blockdata/weight.rs b/bitcoin/src/blockdata/weight.rs index 99168fbf..949ecbac 100644 --- a/bitcoin/src/blockdata/weight.rs +++ b/bitcoin/src/blockdata/weight.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! Implements `Weight` and associated features. use core::fmt; diff --git a/bitcoin/src/consensus/encode.rs b/bitcoin/src/consensus/encode.rs index ccd90103..6fc6a588 100644 --- a/bitcoin/src/consensus/encode.rs +++ b/bitcoin/src/consensus/encode.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin consensus-encodable types. diff --git a/bitcoin/src/consensus/params.rs b/bitcoin/src/consensus/params.rs index 07b5ff8d..cd9cb5bc 100644 --- a/bitcoin/src/consensus/params.rs +++ b/bitcoin/src/consensus/params.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin consensus parameters. diff --git a/bitcoin/src/consensus/serde.rs b/bitcoin/src/consensus/serde.rs index 01f3de07..c2393635 100644 --- a/bitcoin/src/consensus/serde.rs +++ b/bitcoin/src/consensus/serde.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! Serde serialization via consensus encoding //! //! This provides functions for (de)serializing any type as consensus-encoded bytes. diff --git a/bitcoin/src/crypto/ecdsa.rs b/bitcoin/src/crypto/ecdsa.rs index 68743ee3..65f94446 100644 --- a/bitcoin/src/crypto/ecdsa.rs +++ b/bitcoin/src/crypto/ecdsa.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! ECDSA Bitcoin signatures. diff --git a/bitcoin/src/crypto/key.rs b/bitcoin/src/crypto/key.rs index 14f23e1b..5182c47a 100644 --- a/bitcoin/src/crypto/key.rs +++ b/bitcoin/src/crypto/key.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin keys. diff --git a/bitcoin/src/crypto/mod.rs b/bitcoin/src/crypto/mod.rs index a567fc68..82c41279 100644 --- a/bitcoin/src/crypto/mod.rs +++ b/bitcoin/src/crypto/mod.rs @@ -1,4 +1,3 @@ -// Rust Bitcoin Library - Written by the rust-bitcoin developers. // SPDX-License-Identifier: CC0-1.0 //! Cryptography diff --git a/bitcoin/src/crypto/taproot.rs b/bitcoin/src/crypto/taproot.rs index eddc911d..ffb34c63 100644 --- a/bitcoin/src/crypto/taproot.rs +++ b/bitcoin/src/crypto/taproot.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin taproot keys. diff --git a/bitcoin/src/error.rs b/bitcoin/src/error.rs index 3d3fb4c8..0dbc6199 100644 --- a/bitcoin/src/error.rs +++ b/bitcoin/src/error.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! Contains error types and other error handling tools. use core::fmt; diff --git a/bitcoin/src/hash_types.rs b/bitcoin/src/hash_types.rs index 4fbb8507..b9b9f989 100644 --- a/bitcoin/src/hash_types.rs +++ b/bitcoin/src/hash_types.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin hash types. diff --git a/bitcoin/src/internal_macros.rs b/bitcoin/src/internal_macros.rs index c48893f8..ae0e54f6 100644 --- a/bitcoin/src/internal_macros.rs +++ b/bitcoin/src/internal_macros.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Internal macros. diff --git a/bitcoin/src/lib.rs b/bitcoin/src/lib.rs index 6013d45a..1a6f2ea1 100644 --- a/bitcoin/src/lib.rs +++ b/bitcoin/src/lib.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! # Rust Bitcoin Library diff --git a/bitcoin/src/merkle_tree/block.rs b/bitcoin/src/merkle_tree/block.rs index 5cd470a4..1de353ca 100644 --- a/bitcoin/src/merkle_tree/block.rs +++ b/bitcoin/src/merkle_tree/block.rs @@ -1,4 +1,3 @@ -// Written by John L. Jegutanis // SPDX-License-Identifier: CC0-1.0 // // This code was translated from merkleblock.h, merkleblock.cpp and pmt_tests.cpp diff --git a/bitcoin/src/merkle_tree/mod.rs b/bitcoin/src/merkle_tree/mod.rs index f01c2ef1..c120d8fa 100644 --- a/bitcoin/src/merkle_tree/mod.rs +++ b/bitcoin/src/merkle_tree/mod.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin merkle tree functions. diff --git a/bitcoin/src/network/address.rs b/bitcoin/src/network/address.rs index d9544b5c..3dec4f14 100644 --- a/bitcoin/src/network/address.rs +++ b/bitcoin/src/network/address.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin network addresses. diff --git a/bitcoin/src/network/constants.rs b/bitcoin/src/network/constants.rs index 1259cb5a..aceb274d 100644 --- a/bitcoin/src/network/constants.rs +++ b/bitcoin/src/network/constants.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin network constants. diff --git a/bitcoin/src/network/message.rs b/bitcoin/src/network/message.rs index 1406f7e3..c083945d 100644 --- a/bitcoin/src/network/message.rs +++ b/bitcoin/src/network/message.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin network messages. diff --git a/bitcoin/src/network/message_blockdata.rs b/bitcoin/src/network/message_blockdata.rs index a1a63aba..64273b7b 100644 --- a/bitcoin/src/network/message_blockdata.rs +++ b/bitcoin/src/network/message_blockdata.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin blockdata network messages. diff --git a/bitcoin/src/network/message_compact_blocks.rs b/bitcoin/src/network/message_compact_blocks.rs index 8827e543..66246052 100644 --- a/bitcoin/src/network/message_compact_blocks.rs +++ b/bitcoin/src/network/message_compact_blocks.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! //! BIP152 Compact Blocks network messages //! diff --git a/bitcoin/src/network/message_network.rs b/bitcoin/src/network/message_network.rs index 16c41f0c..b49974f5 100644 --- a/bitcoin/src/network/message_network.rs +++ b/bitcoin/src/network/message_network.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin network-related network messages. diff --git a/bitcoin/src/network/mod.rs b/bitcoin/src/network/mod.rs index 18855f72..2e379686 100644 --- a/bitcoin/src/network/mod.rs +++ b/bitcoin/src/network/mod.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin network support. diff --git a/bitcoin/src/parse.rs b/bitcoin/src/parse.rs index 4da00428..777a5038 100644 --- a/bitcoin/src/parse.rs +++ b/bitcoin/src/parse.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + use core::convert::TryFrom; use core::fmt; use core::str::FromStr; diff --git a/bitcoin/src/policy.rs b/bitcoin/src/policy.rs index 8390061a..6bda6608 100644 --- a/bitcoin/src/policy.rs +++ b/bitcoin/src/policy.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin policy. diff --git a/bitcoin/src/pow.rs b/bitcoin/src/pow.rs index 7feb8f3f..9630ed50 100644 --- a/bitcoin/src/pow.rs +++ b/bitcoin/src/pow.rs @@ -1,4 +1,3 @@ -// Rust Bitcoin Library - Written by the rust-bitcoin developers. // SPDX-License-Identifier: CC0-1.0 //! Proof-of-work related integer types. diff --git a/bitcoin/src/sign_message.rs b/bitcoin/src/sign_message.rs index e4cba47f..52f445a4 100644 --- a/bitcoin/src/sign_message.rs +++ b/bitcoin/src/sign_message.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Signature diff --git a/bitcoin/src/test_macros.rs b/bitcoin/src/test_macros.rs index 542ffa2d..cbcbd4bd 100644 --- a/bitcoin/src/test_macros.rs +++ b/bitcoin/src/test_macros.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Bitcoin serde macros. diff --git a/bitcoin/src/util/mod.rs b/bitcoin/src/util/mod.rs index 7f73179d..537e35ac 100644 --- a/bitcoin/src/util/mod.rs +++ b/bitcoin/src/util/mod.rs @@ -1,4 +1,3 @@ -// Written in 2014 by Andrew Poelstra // SPDX-License-Identifier: CC0-1.0 //! Utility functions. From 99673ab5c4b822038e7a1c31590adc334015a3f5 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 1 May 2023 09:26:36 +1000 Subject: [PATCH 2/3] hashes: Introduce SPDX license identifiers Whether or not every file needs an explicit license comment is out of scope for this patch; in the `bitcoin` crate we use SPDX identifiers because they are a single line with no loss of "benefit" over any longer form. Use SPDX identifiers in `hashes`. Drop the mention of re-licensing code from Apache to CC0-1 (because the original code was written by Andrew as well as the copied code then if the argument ever comes up it can be easily countered). --- hashes/src/cmp.rs | 2 ++ hashes/src/error.rs | 14 +------------- hashes/src/hash160.rs | 14 +------------- hashes/src/hex.rs | 14 +------------- hashes/src/hmac.rs | 14 +------------- hashes/src/impls.rs | 14 +------------- hashes/src/internal_macros.rs | 2 ++ hashes/src/lib.rs | 14 +------------- hashes/src/ripemd160.rs | 19 +------------------ hashes/src/serde_macros.rs | 14 +------------- hashes/src/sha1.rs | 14 +------------- hashes/src/sha256.rs | 14 +------------- hashes/src/sha256d.rs | 14 +------------- hashes/src/sha256t.rs | 14 +------------- hashes/src/sha512.rs | 19 +------------------ hashes/src/sha512_256.rs | 19 +------------------ hashes/src/siphash24.rs | 19 +------------------ hashes/src/util.rs | 14 +------------- 18 files changed, 20 insertions(+), 228 deletions(-) diff --git a/hashes/src/cmp.rs b/hashes/src/cmp.rs index 05b430d9..d84b31c0 100644 --- a/hashes/src/cmp.rs +++ b/hashes/src/cmp.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! Useful comparison functions. /// Compare two slices for equality in fixed time. Panics if the slices are of non-equal length. diff --git a/hashes/src/error.rs b/hashes/src/error.rs index 016a7797..79108887 100644 --- a/hashes/src/error.rs +++ b/hashes/src/error.rs @@ -1,16 +1,4 @@ -// Bitcoin Hashes Library -// Written in 2018 by -// Andrew Poelstra -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// +// SPDX-License-Identifier: CC0-1.0 //! Crate error type. //! diff --git a/hashes/src/hash160.rs b/hashes/src/hash160.rs index 47559c6b..66d30b86 100644 --- a/hashes/src/hash160.rs +++ b/hashes/src/hash160.rs @@ -1,17 +1,5 @@ -// Bitcoin Hashes Library -// Written in 2018 by -// Andrew Poelstra +// SPDX-License-Identifier: CC0-1.0 // -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// - // This module is largely copied from the rust-crypto ripemd.rs file; // while rust-crypto is licensed under Apache, that file specifically // was written entirely by Andrew Poelstra, who is re-licensing its diff --git a/hashes/src/hex.rs b/hashes/src/hex.rs index fd613abe..31845a75 100644 --- a/hashes/src/hex.rs +++ b/hashes/src/hex.rs @@ -1,16 +1,4 @@ -// Bitcoin Hashes Library -// Written in 2018 by -// Andrew Poelstra -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// +// SPDX-License-Identifier: CC0-1.0 //! Hex encoding and decoding. //! diff --git a/hashes/src/hmac.rs b/hashes/src/hmac.rs index d5d2aae7..425eb1d0 100644 --- a/hashes/src/hmac.rs +++ b/hashes/src/hmac.rs @@ -1,16 +1,4 @@ -// Bitcoin Hashes Library -// Written in 2018 by -// Andrew Poelstra -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// +// SPDX-License-Identifier: CC0-1.0 // This module is largely copied from the rust-crypto ripemd.rs file; // while rust-crypto is licensed under Apache, that file specifically diff --git a/hashes/src/impls.rs b/hashes/src/impls.rs index 18bb2373..5ff0179d 100644 --- a/hashes/src/impls.rs +++ b/hashes/src/impls.rs @@ -1,16 +1,4 @@ -// Bitcoin Hashes Library -// Written in 2019 by -// Andrew Poelstra -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// +// SPDX-License-Identifier: CC0-1.0 //! `std` / `core2` Impls. //! diff --git a/hashes/src/internal_macros.rs b/hashes/src/internal_macros.rs index 5bd5aff2..660ccf61 100644 --- a/hashes/src/internal_macros.rs +++ b/hashes/src/internal_macros.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! Non-public macros macro_rules! arr_newtype_fmt_impl { diff --git a/hashes/src/lib.rs b/hashes/src/lib.rs index 4cc74cb1..7c5dfdc2 100644 --- a/hashes/src/lib.rs +++ b/hashes/src/lib.rs @@ -1,16 +1,4 @@ -// Bitcoin Hashes Library -// Written in 2018 by -// Andrew Poelstra -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// +// SPDX-License-Identifier: CC0-1.0 //! Rust hashes library. //! diff --git a/hashes/src/ripemd160.rs b/hashes/src/ripemd160.rs index 2d4dc68d..52994e44 100644 --- a/hashes/src/ripemd160.rs +++ b/hashes/src/ripemd160.rs @@ -1,21 +1,4 @@ -// Bitcoin Hashes Library -// Written in 2018 by -// Andrew Poelstra -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// - -// This module is largely copied from the rust-crypto ripemd.rs file; -// while rust-crypto is licensed under Apache, that file specifically -// was written entirely by Andrew Poelstra, who is re-licensing its -// contents here as CC0. +// SPDX-License-Identifier: CC0-1.0 //! RIPEMD160 implementation. //! diff --git a/hashes/src/serde_macros.rs b/hashes/src/serde_macros.rs index b60dbe4c..223ef538 100644 --- a/hashes/src/serde_macros.rs +++ b/hashes/src/serde_macros.rs @@ -1,16 +1,4 @@ -// Bitcoin Hashes Library -// Written in 2018 by -// Andrew Poelstra -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// +// SPDX-License-Identifier: CC0-1.0 //! Macros for serde trait implementations, and supporting code. //! diff --git a/hashes/src/sha1.rs b/hashes/src/sha1.rs index c5557e09..d7237a2c 100644 --- a/hashes/src/sha1.rs +++ b/hashes/src/sha1.rs @@ -1,16 +1,4 @@ -// Bitcoin Hashes Library -// Written in 2018 by -// Andrew Poelstra -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// +// SPDX-License-Identifier: CC0-1.0 //! SHA1 implementation. //! diff --git a/hashes/src/sha256.rs b/hashes/src/sha256.rs index 5a020b4e..64279409 100644 --- a/hashes/src/sha256.rs +++ b/hashes/src/sha256.rs @@ -1,16 +1,4 @@ -// Bitcoin Hashes Library -// Written in 2018 by -// Andrew Poelstra -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// +// SPDX-License-Identifier: CC0-1.0 //! SHA256 implementation. //! diff --git a/hashes/src/sha256d.rs b/hashes/src/sha256d.rs index e60b15c3..427a46a3 100644 --- a/hashes/src/sha256d.rs +++ b/hashes/src/sha256d.rs @@ -1,16 +1,4 @@ -// Bitcoin Hashes Library -// Written in 2018 by -// Andrew Poelstra -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// +// SPDX-License-Identifier: CC0-1.0 //! SHA256d implementation (double SHA256). //! diff --git a/hashes/src/sha256t.rs b/hashes/src/sha256t.rs index 3c7e83a0..8d802415 100644 --- a/hashes/src/sha256t.rs +++ b/hashes/src/sha256t.rs @@ -1,16 +1,4 @@ -// Bitcoin Hashes Library -// Written in 2019 by -// The rust-bitcoin developers. -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// +// SPDX-License-Identifier: CC0-1.0 //! SHA256t implementation (tagged SHA256). //! diff --git a/hashes/src/sha512.rs b/hashes/src/sha512.rs index cb53c113..1f3ad713 100644 --- a/hashes/src/sha512.rs +++ b/hashes/src/sha512.rs @@ -1,21 +1,4 @@ -// Bitcoin Hashes Library -// Written in 2018 by -// Andrew Poelstra -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// - -// This module is largely copied from the rust-crypto ripemd.rs file; -// while rust-crypto is licensed under Apache, that file specifically -// was written entirely by Andrew Poelstra, who is re-licensing its -// contents here as CC0. +// SPDX-License-Identifier: CC0-1.0 //! SHA512 implementation. //! diff --git a/hashes/src/sha512_256.rs b/hashes/src/sha512_256.rs index 82bf1557..664eece3 100644 --- a/hashes/src/sha512_256.rs +++ b/hashes/src/sha512_256.rs @@ -1,21 +1,4 @@ -// Bitcoin Hashes Library -// Written in 2022 by -// The rust-bitcoin developers. -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// - -// This module is largely copied from the rust-crypto ripemd.rs file; -// while rust-crypto is licensed under Apache, that file specifically -// was written entirely by Andrew Poelstra, who is re-licensing its -// contents here as CC0. +// SPDX-License-Identifier: CC0-1.0 //! SHA512_256 implementation. //! diff --git a/hashes/src/siphash24.rs b/hashes/src/siphash24.rs index 6b9b9eb9..a2dd13bf 100644 --- a/hashes/src/siphash24.rs +++ b/hashes/src/siphash24.rs @@ -1,21 +1,4 @@ -// Bitcoin Hashes Library -// Written in 2019 by -// The rust-bitcoin developers -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// - -// This module is largely copied from the rust-siphash sip.rs file; -// while rust-siphash is licensed under Apache, that file specifically -// was written entirely by Steven Roose, who is re-licensing its -// contents here as CC0. +// SPDX-License-Identifier: CC0-1.0 //! SipHash 2-4 implementation. //! diff --git a/hashes/src/util.rs b/hashes/src/util.rs index 7ee657ca..cf43e8b8 100644 --- a/hashes/src/util.rs +++ b/hashes/src/util.rs @@ -1,16 +1,4 @@ -// Bitcoin Hashes Library -// Written in 2018 by -// Andrew Poelstra -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to -// the public domain worldwide. This software is distributed without -// any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. -// If not, see . -// +// SPDX-License-Identifier: CC0-1.0 #[macro_export] /// Adds hexadecimal formatting implementation of a trait `$imp` to a given type `$ty`. From 1c3bbd4bf242ef92b9a2e35392ea72f86e4ceb41 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 1 May 2023 09:31:42 +1000 Subject: [PATCH 3/3] internals: Remove attribution from all files As we did for the `bitcoin` crate, remove attribution from all files in the `internals` crate. While we are at it add an SPDX line to the few files missing it, whether this license nonsense is even needed is left as an argument for another day. Justification: Currently we have a mishmash of attribution lines accompanying the SPDX identifier. These lines are basically meaningless because: - The date is often wrong - The original author attributed is not the only contributor to a file - The term "rust bitcoin developers" is basically just noise Just remove all the attribution lines and be done with it. --- internals/src/error.rs | 1 - internals/src/hex/buf_encoder.rs | 2 ++ internals/src/hex/display.rs | 2 ++ internals/src/hex/mod.rs | 2 ++ internals/src/lib.rs | 1 - internals/src/macros.rs | 2 ++ 6 files changed, 8 insertions(+), 2 deletions(-) diff --git a/internals/src/error.rs b/internals/src/error.rs index 2f213377..ff596734 100644 --- a/internals/src/error.rs +++ b/internals/src/error.rs @@ -1,4 +1,3 @@ -// Written by the Rust Bitcoin developers. // SPDX-License-Identifier: CC0-1.0 //! # Error diff --git a/internals/src/hex/buf_encoder.rs b/internals/src/hex/buf_encoder.rs index d72cdea1..2d6793d9 100644 --- a/internals/src/hex/buf_encoder.rs +++ b/internals/src/hex/buf_encoder.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! Implements a buffered encoder. //! //! The main type of this module is [`BufEncoder`] which provides buffered hex encoding. Such is diff --git a/internals/src/hex/display.rs b/internals/src/hex/display.rs index 81450d00..6a75864a 100644 --- a/internals/src/hex/display.rs +++ b/internals/src/hex/display.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! Helpers for displaying bytes as hex strings. //! //! This module provides a trait for displaying things as hex as well as an implementation for diff --git a/internals/src/hex/mod.rs b/internals/src/hex/mod.rs index 0d55ec8e..54fd0465 100644 --- a/internals/src/hex/mod.rs +++ b/internals/src/hex/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! Helpers for encoding bytes as hex strings. pub mod buf_encoder; diff --git a/internals/src/lib.rs b/internals/src/lib.rs index 75b2ddf0..9e794aed 100644 --- a/internals/src/lib.rs +++ b/internals/src/lib.rs @@ -1,4 +1,3 @@ -// Written by the Rust Bitcoin developers. // SPDX-License-Identifier: CC0-1.0 //! # Rust Bitcoin Internal diff --git a/internals/src/macros.rs b/internals/src/macros.rs index 2df33c92..799730f0 100644 --- a/internals/src/macros.rs +++ b/internals/src/macros.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! Various macros used by the Rust Bitcoin ecosystem. //!