-
Deprecate
ThirtyTwoByteHash
#686This trait turned out to be problematic during upgrade because we support a ranged dependency for
bitcoin_hashes
. Consider implementingFrom<T> for Message
for your type iff your type is a 32 byte hash (ie, output from a hash algorithm that produces a 32 byte digest like sha256). When using the impl, consider usingMessage::from
instead ofhash.into()
because we will be introducing generics in a future version and the compiler will not be able to work out the target type. -
Bump MSRV to Rust
v1.56.1
#693 -
Upgrade
hashes
using range dependencyversion = ">= 0.12, <= 0.14"
#690 -
Depend on latest
secp256k1-sys
(vendorssecp256k1 v0.4.1
) #688
- Implement
Hash
forScalar
#674 - Implement
Ord
andPartialOrd
forRecoverableSignature
#611 - Add byte accessors to
ElligatorSwiftSharedSecret
#676
- Update secp265k1-sys to 0.9.2 (contains some fixes for WASM and a FFI binding fix)
- Various improvements to the
SerializedSignature
type #658 #659
- Add bindings to the ElligatorSwift implementation #627
- Depend on recent release of
bitcoin_hashes
v0.13.0 #621 - Add a verify function to
PublicKey
#618 - Add serialize function for schnorr::Signature #607
- Bump MSRV to 1.48 #595
- Remove implementations of
PartialEq
,Eq
,PartialOrd
,Ord
, andHash
from theimpl_array_newtype
macro. Users will now need to derive these traits if they are wanted.
- Depend on newly release
bitcoin_hashes
v0.12. - Implement
Debug
trait forScalar
type. - Implement
insecure-erase
.
- Update libsecp25k1 to v0.2.0
- Fix soundness issue with
preallocated_gen_new
- Update to
secp256k1-sys
v0.7.0 - Use type system to improve safety.
- Change secp256k1-sys symbol names to 0_6_1.
- Introduce
rustfmt
to the codebase. - Make all raw pointer methods go through the CPtr trait.
- Make comparison functions stable.
- Remove public constant
ONE_KEY
(consider usingFromStr
as a replacement).
- Fix broken deserialization logic of
KeyPair
that previously always panicked. After the patch deserialization only panics if neither theglobal-context
nor thealloc
(default) feature is active.
- Upgrade to new release of bitcoin_hashes.
Enable "rand/std_rng" feature when the crate's "rnd-std" feature is enabled.
The major change in this version is the increase of the Minimum Supported Rust Version (MSRV) from 1.29 to 1.41.1, this is a big change because it introduces Rust Edition 2018 to the codebase along with all the benefits that brings.
- MSRV bumped to 1.41.1 and edition changed to 2018
- serde implements serialize fixed-width arrays as tuples in binary formats to avoid encoding the length
- Key tweaking methods renamed and refactored to use a more functional-style, they now accept a new Scalar type instead of raw slices
- Update
rand
dependency to 0.8 KeyPair::from_secret_key
borrows SecretKey instead of taking ownershipSerializedSignature
no longer implementsDefault
- Several convenience/conversion methods between keys
sign_ecdsa_with_noncedata
andsign_ecdsa_recoverable_with_noncedata
can be used to add additional entropy to ECDSA signatures- Errors now display their sources if std is unavailable, with std they rely on the consumer to use the source() method
- Implemented
TryFrom
forParity
- The alloc feature can be used on targets with allocators without a standard library
SharedSecret
can be created from a slice, parsed from a hex string, or (de)serialized using serdeSerializedSignature
implementsIntoIterator
(both owned and shared reference)- We now derive
std::hash::Hash
forSignature
global-context
feature now activatesglobal-context-less-secure
.githooks/
directory added for contributors- Clippy is now used in CI and the code is clippy-compliant
- Various documentation improvements
- Various CI/development improvements
- Various code quality improvements/refactors
- Reintroduce accidentally removed possibility to create
SharedSecret
from byte serialization
- Disable
bitcoin_hashes/std
by default; addbitcoin-hashes-std
feature to re-enable it - Rename more
schnorrsig
methods toschnorr
- Obfuscate
SharedSecret
string serialization - Simplify
SharedSecret
API to use a 32-byte buffer; users of custom hashes should now use bare arrays rather than this type. - Change serde serialization of
Parity
fromi32
tou8
; clean up error handling
- Several documentation improvements (#366, #365, #373, #381, #369, #389, #391, #397, #399, #340)
- Deprecate the
generate_schnorrsig_keypair
method (unclear value) - Add serde traits to
KeyPair
- Redo the API of the new
Parity
type to more clearly match our desired semantics; theFrom<i32>
impl on this type is now deprecated. Also #400. - Randomize the global context on creation when possible; weaken
global-context-less-secure
feature accordingly. - Improve the global context API
- Fix the
Debug
impl forRecoverableSignature
- Implement
LowerHex
andDisplay
- Fix
KeyPair::from_seckey_slice
error return value - Reduce the
lowmemory
precomp table size - Add
KeyPair::serialize_sec
- Increase
bitcoin_hashes
version to 0.10; renamesecp256k1::bitcoin_hashes
module tosecp256k1::hashes
to align withbitcoin
crate naming - Add new error variant for
PublicKey::combine_keys
- Change
Display
andDebug
for secret keys to only output a truncated hash - Improve documentation
- Implement
Hash
forschnorrsig::Signature
- Refactor modules to put Schnorr and ECDSA on more equal footing
- Add serde traits for
KeyPair
type - Fix context bound requirements for a few methods
- Add a static immutable-zero aligned type
- Change
tweak_add_assign
andtweak_add_check
to use an opaqueParity
type rather than a boolean
- Fix
SecretKey
validation infrom_str
- Add
global-context-less-secure
feature which creates a non-randomized global context (and does not requirerand
orstd
) - Add
schnorrsig::KeyPair::from_secret_key
convenience function - Add
combine_keys
function toPublicKey
- Reduce symbol visibility in C compilation to allow LTO to work
- Add
alloc
feature requiring rustc 1.36+ to enable context creation without std - Rewrite stubbed-out-for-fuzzing version of the library to improve fuzzer accessibility
- Fix some WASM build issues
- Add some missing
#derive
s toError
- Add serde support for Schnorr signatures and for deserializing from owned types
- remove
ffi::PublicKey::blank
and replace with unsafeffi::PublicKey::new
andffi::PublicKey::from_array_unchecked
; similar for all other FFI types - support wasm32-wasi target
- make the global-context feature depend on the rand-std feature
- add a lexicographic ordering to
PublicKey
which does not match the ordering used by Bitcoin Core (matching this would be impossible as it requires tracking a compressedness flag, which libsecp256k1 does not have) - implement BIP340 Schnorr signatures
- require use of new
AlignedType
in preallocated-context API to enforce alignment requirements; previously it was possible to get UB by using misaligned memory stores - enforce correct alignment when using preallocated context API
- stop using cargo features for dangerous build-breaking options, require setting
RUSTFLAGS
instead - implement low-R signing and function to grind even smaller signatures
- remove endomorphism feature, following upstream in enabling it by default
- Update MSRV to 1.29.0
- Add feature-gated
bitcoin_hashes
dependency andThirtyTwoByteHash
trait - Add feature-gated global static context
- Allow all-zero messages to be constructed
- Bump rust-secp-sys to 0.2.0
- Fix linking in the
fuzztarget
feature.
- Correctly prefix the secp256k1-sys links field in Cargo.toml.
- Move FFI into secp256k1-sys crate.
- Add
external-symbols
feature for not building upstream. - Add functions to create a context from a raw pointer.
- Support passing custom hash functions to ECDH.
- Wrap Secp256k1 from raw context in a ManuallyDrop.
- Add
rand-std
feature. - Pin the cc build-dep version to
< 1.0.42
to remain compatible with rustc 1.22.0. - Changed all
as_*ptr()
to a new saferCPtr
trait
- Add feature
lowmemory
that reduces the EC mult window size to require significantly less memory for the validation context (~680B instead of ~520kB), at the cost of slower validation. It does not affect the speed of signing, nor the size of the signing context.
- Implement hex human-readable serde for PublicKey
- Implement fmt::LowerHex for SecretKey and PublicKey
- Relax
cc
dependency requirements - Add links manifest key to prevent cross-version linkage
- Implemented FFI functions:
secp256k1_context_create
andsecp256k1_context_destroy
in rust.
- Feature-gate endormorphism optimization because of a lack of clarity with respect to patents
- Got full no-std support including eliminating all use of libc in C bindings. PR 1 PR 2. This library should be usable in bare-metal environments and with rust-wasm. Thanks to Elichai Turkel for driving this forward!
- Update upstream libsecp256k1 version to 143dc6e9ee31852a60321b23eea407d2006171da
- Update minimum supported rust compiler 1.22.
- Replace
serialize_der
function withSerializedSignature
struct. - Allow building without a standard library (
no_std
).std
feature is on by default. - Add human readable serialization to
Signatures
andSecretKeys
. - Stop displaying 0 bytes if a
Signature
is less than 72 bytes. - Only compile recovery module if feature
recovery
is set (non-default). - Update
rand
dependency from 0.4 to 0.6 and addrand_core
0.4 dependency. - Relax
cc
dependency requirements.
- Fuzzer bug fix
- Minor bug fixes
- Fixed
cc
crate version to maintain minimum compiler version without breakage - Removed
libc
dependency as it our uses have been subsumed into stdlib
- Overhaul API to remove context object when no precomputation is needed
- Add
ThirtyTwoByteHash
trait which allows infallible conversions toMessage
s - Disallow 0-valued
Message
objects since signatures on them are forgeable for all keys - Remove
ops::Index
implementations forSignature
- Remove depecated constants and unsafe
ZERO_KEY
constant
- Use
pub extern crate
to export dependencies whose types are exported
- Add
FromStr
andDisplay
forSignature
and both key types - Fix
build.rs
for Windows and rustfmt configuration for docs.rs - Correct endianness issue for
Signature
Debug
output
- No changes, just fixed docs.rs configuration
- Correct endianness issue in RFC6979 nonce generation
- Put
PublicKey::combine
back because it is currently needed to implement Lightning BOLT 3
- Update
rand
to 0.4 andgcc
0.3 tocc
1.0. (rand
0.5 exists but has a lot of breaking changes and no longer compiles with 1.14.0.) - Remove
PublicKey::combine
from API since it cannot be used with anything else in the API - Detect whether 64-bit compilation is possible, and do it if we can (big performance improvement)
- A complete API overhaul to move many runtime errors into compiletime errors
- Update libsecp256k1 to
1e6f1f5ad5e7f1e3ef79313ec02023902bf8
. Should be no visible changes. - Remove
PublicKey::new()
andPublicKey::is_valid()
sincenew
was unsafe and it should now be impossible to create invalidPublicKey
objects through the API - Reintroduce serde support behind a feature gate using serde 1.0
- Clean up build process and various typos