From 896e6c7f2dc3db8d3b94f94601de030e42f051ce Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 3 May 2023 11:37:07 +1000 Subject: [PATCH] Introduce SPDX license identifiers Licenses are boring as hell, so is are all the comments at the top of each file. This patch makes no comment on the merit of license comments in each file, rather this patch reduces the license comment to the minimum possible with no loss of meaning - an SPDX license identifier. Note also please that we remove the "written by" comments as well for the following reasons (discussed recently on rust-bitcoin repo): - they are not descriptive because many devs contributed - they have a tendency to include the wrong date because of cut'n'pasta - all this info is in the git history ref: https://spdx.dev/ids/#how --- no_std_test/src/main.rs | 14 +------------- secp256k1-sys/build.rs | 14 +------------- secp256k1-sys/src/lib.rs | 16 ++-------------- secp256k1-sys/src/macros.rs | 15 +-------------- secp256k1-sys/src/recovery.rs | 15 +-------------- secp256k1-sys/src/types.rs | 2 ++ src/constants.rs | 15 +-------------- src/context.rs | 2 ++ src/ecdh.rs | 14 +------------- src/ecdsa/mod.rs | 2 ++ src/ecdsa/recovery.rs | 15 +-------------- src/ecdsa/serialized_signature.rs | 2 ++ src/key.rs | 15 +-------------- src/lib.rs | 15 +-------------- src/macros.rs | 15 +-------------- src/scalar.rs | 2 ++ src/schnorr.rs | 2 ++ src/secret.rs | 14 +------------- src/serde_util.rs | 2 ++ 19 files changed, 27 insertions(+), 164 deletions(-) diff --git a/no_std_test/src/main.rs b/no_std_test/src/main.rs index c0e114a..d98276c 100644 --- a/no_std_test/src/main.rs +++ b/no_std_test/src/main.rs @@ -1,16 +1,4 @@ -// Bitcoin secp256k1 bindings -// Written in 2019 by -// Elichai Turkel -// -// 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 //! # secp256k1 no-std test. //! This binary is a short smallest rust code to produce a working binary *without libstd*. diff --git a/secp256k1-sys/build.rs b/secp256k1-sys/build.rs index 2d9f844..c151217 100644 --- a/secp256k1-sys/build.rs +++ b/secp256k1-sys/build.rs @@ -1,16 +1,4 @@ -// Bitcoin secp256k1 bindings -// Written in 2015 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 //! # Build script diff --git a/secp256k1-sys/src/lib.rs b/secp256k1-sys/src/lib.rs index 87f9f6a..e8faa1c 100644 --- a/secp256k1-sys/src/lib.rs +++ b/secp256k1-sys/src/lib.rs @@ -1,17 +1,5 @@ -// Bitcoin secp256k1 bindings -// Written in 2014 by -// Dawid Ciężarkiewicz -// 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 + //! # secp256k1-sys FFI bindings //! Direct bindings to the underlying C library functions. These should //! not be needed for most users. diff --git a/secp256k1-sys/src/macros.rs b/secp256k1-sys/src/macros.rs index 3f97245..ec225ab 100644 --- a/secp256k1-sys/src/macros.rs +++ b/secp256k1-sys/src/macros.rs @@ -1,17 +1,4 @@ -// Bitcoin secp256k1 bindings -// Written in 2014 by -// Dawid Ciężarkiewicz -// 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 /// Implement methods and traits for types that contain an inner array. #[macro_export] diff --git a/secp256k1-sys/src/recovery.rs b/secp256k1-sys/src/recovery.rs index 8899dc6..85db59e 100644 --- a/secp256k1-sys/src/recovery.rs +++ b/secp256k1-sys/src/recovery.rs @@ -1,17 +1,4 @@ -// Bitcoin secp256k1 bindings -// Written in 2014 by -// Dawid Ciężarkiewicz -// 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 //! # FFI of the recovery module diff --git a/secp256k1-sys/src/types.rs b/secp256k1-sys/src/types.rs index e457ec4..28ef0fb 100644 --- a/secp256k1-sys/src/types.rs +++ b/secp256k1-sys/src/types.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + #![allow(non_camel_case_types)] pub type c_int = i32; diff --git a/src/constants.rs b/src/constants.rs index 4b506f9..661ebaf 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -1,17 +1,4 @@ -// Bitcoin secp256k1 bindings -// Written in 2014 by -// Dawid Ciężarkiewicz -// 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 //! Constants related to the API and the underlying curve. //! diff --git a/src/context.rs b/src/context.rs index c59017b..f5a8396 100644 --- a/src/context.rs +++ b/src/context.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + use core::marker::PhantomData; use core::mem::ManuallyDrop; use core::ptr::NonNull; diff --git a/src/ecdh.rs b/src/ecdh.rs index c0e1576..5f762d9 100644 --- a/src/ecdh.rs +++ b/src/ecdh.rs @@ -1,16 +1,4 @@ -// Bitcoin secp256k1 bindings -// Written in 2015 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 //! Support for shared secret computations. //! diff --git a/src/ecdsa/mod.rs b/src/ecdsa/mod.rs index c7083a1..f3ae5c0 100644 --- a/src/ecdsa/mod.rs +++ b/src/ecdsa/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! Structs and functionality related to the ECDSA signature algorithm. //! diff --git a/src/ecdsa/recovery.rs b/src/ecdsa/recovery.rs index 003b7e1..abc6809 100644 --- a/src/ecdsa/recovery.rs +++ b/src/ecdsa/recovery.rs @@ -1,17 +1,4 @@ -// Bitcoin secp256k1 bindings -// Written in 2014 by -// Dawid Ciężarkiewicz -// 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 //! Provides a signing function that allows recovering the public key from the //! signature. diff --git a/src/ecdsa/serialized_signature.rs b/src/ecdsa/serialized_signature.rs index ab1f9e4..1b2a65a 100644 --- a/src/ecdsa/serialized_signature.rs +++ b/src/ecdsa/serialized_signature.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! Implements [`SerializedSignature`] and related types. //! //! DER-serialized signatures have the issue that they can have different lengths. diff --git a/src/key.rs b/src/key.rs index afa837e..c33637d 100644 --- a/src/key.rs +++ b/src/key.rs @@ -1,17 +1,4 @@ -// Bitcoin secp256k1 bindings -// Written in 2014 by -// Dawid Ciężarkiewicz -// 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 //! Public and secret keys. //! diff --git a/src/lib.rs b/src/lib.rs index b53ce4a..36dca7d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,17 +1,4 @@ -// Bitcoin secp256k1 bindings -// Written in 2014 by -// Dawid Ciężarkiewicz -// 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 bindings for Pieter Wuille's secp256k1 library, which is used for //! fast and accurate manipulation of ECDSA signatures on the secp256k1 diff --git a/src/macros.rs b/src/macros.rs index d5b78e9..4111b3f 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1,17 +1,4 @@ -// Bitcoin secp256k1 bindings -// Written in 2014 by -// Dawid Ciężarkiewicz -// 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 /// Implement methods and traits for types that contain an inner array. #[macro_export] diff --git a/src/scalar.rs b/src/scalar.rs index 57d1e25..4b2d0fc 100644 --- a/src/scalar.rs +++ b/src/scalar.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! Provides [`Scalar`] and related types. //! //! In elliptic curve cryptography scalars are non-point values that can be used to multiply diff --git a/src/schnorr.rs b/src/schnorr.rs index c29bb57..a8b7d67 100644 --- a/src/schnorr.rs +++ b/src/schnorr.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + //! Support for schnorr signatures. //! diff --git a/src/secret.rs b/src/secret.rs index 4faa152..f73bcd4 100644 --- a/src/secret.rs +++ b/src/secret.rs @@ -1,16 +1,4 @@ -// Bitcoin secp256k1 bindings -// Written in 2021 by -// Maxim Orlovsky -// -// 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 //! Helpers for displaying secret values diff --git a/src/serde_util.rs b/src/serde_util.rs index e2751dd..3b851b2 100644 --- a/src/serde_util.rs +++ b/src/serde_util.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: CC0-1.0 + use core::fmt; use core::marker::PhantomData; use core::str::{self, FromStr};