- Fix broken deserialization logic of
KeyPairthat previously always panicked. After the patch deserialization only panics if neither theglobal-contextnor 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
randdependency to 0.8 KeyPair::from_secret_keyborrows SecretKey instead of taking ownershipSerializedSignatureno longer implementsDefault
- Several convenience/conversion methods between keys
sign_ecdsa_with_noncedataandsign_ecdsa_recoverable_with_noncedatacan 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
TryFromforParity - The alloc feature can be used on targets with allocators without a standard library
SharedSecretcan be created from a slice, parsed from a hex string, or (de)serialized using serdeSerializedSignatureimplementsIntoIterator(both owned and shared reference)- We now derive
std::hash::HashforSignature
global-contextfeature 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
SharedSecretfrom byte serialization
- Disable
bitcoin_hashes/stdby default; addbitcoin-hashes-stdfeature to re-enable it - Rename more
schnorrsigmethods toschnorr - Obfuscate
SharedSecretstring serialization - Simplify
SharedSecretAPI to use a 32-byte buffer; users of custom hashes should now use bare arrays rather than this type. - Change serde serialization of
Parityfromi32tou8; clean up error handling
- Several documentation improvements (#366, #365, #373, #381, #369, #389, #391, #397, #399, #340)
- Deprecate the
generate_schnorrsig_keypairmethod (unclear value) - Add serde traits to
KeyPair - Redo the API of the new
Paritytype 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-securefeature accordingly. - Improve the global context API
- Fix the
Debugimpl forRecoverableSignature - Implement
LowerHexandDisplay
- Fix
KeyPair::from_seckey_sliceerror return value - Reduce the
lowmemoryprecomp table size - Add
KeyPair::serialize_sec - Increase
bitcoin_hashesversion to 0.10; renamesecp256k1::bitcoin_hashesmodule tosecp256k1::hashesto align withbitcoincrate naming - Add new error variant for
PublicKey::combine_keys - Change
DisplayandDebugfor secret keys to only output a truncated hash - Improve documentation
- Implement
Hashforschnorrsig::Signature - Refactor modules to put Schnorr and ECDSA on more equal footing
- Add serde traits for
KeyPairtype - Fix context bound requirements for a few methods
- Add a static immutable-zero aligned type
- Change
tweak_add_assignandtweak_add_checkto use an opaqueParitytype rather than a boolean
- Fix
SecretKeyvalidation infrom_str - Add
global-context-less-securefeature which creates a non-randomized global context (and does not requirerandorstd) - Add
schnorrsig::KeyPair::from_secret_keyconvenience function - Add
combine_keysfunction toPublicKey - Reduce symbol visibility in C compilation to allow LTO to work
- Add
allocfeature 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
#derives toError - Add serde support for Schnorr signatures and for deserializing from owned types
- remove
ffi::PublicKey::blankand replace with unsafeffi::PublicKey::newandffi::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
PublicKeywhich 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
AlignedTypein 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
RUSTFLAGSinstead - 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_hashesdependency andThirtyTwoByteHashtrait - 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
fuzztargetfeature.
- Correctly prefix the secp256k1-sys links field in Cargo.toml.
- Move FFI into secp256k1-sys crate.
- Add
external-symbolsfeature 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-stdfeature. - Pin the cc build-dep version to
< 1.0.42to remain compatible with rustc 1.22.0. - Changed all
as_*ptr()to a new saferCPtrtrait
- Add feature
lowmemorythat 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
ccdependency requirements - Add links manifest key to prevent cross-version linkage
- Implemented FFI functions:
secp256k1_context_createandsecp256k1_context_destroyin 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_derfunction withSerializedSignaturestruct. - Allow building without a standard library (
no_std).stdfeature is on by default. - Add human readable serialization to
SignaturesandSecretKeys. - Stop displaying 0 bytes if a
Signatureis less than 72 bytes. - Only compile recovery module if feature
recoveryis set (non-default). - Update
randdependency from 0.4 to 0.6 and addrand_core0.4 dependency. - Relax
ccdependency requirements.
- Fuzzer bug fix
- Minor bug fixes
- Fixed
cccrate version to maintain minimum compiler version without breakage - Removed
libcdependency as it our uses have been subsumed into stdlib
- Overhaul API to remove context object when no precomputation is needed
- Add
ThirtyTwoByteHashtrait which allows infallible conversions toMessages - Disallow 0-valued
Messageobjects since signatures on them are forgeable for all keys - Remove
ops::Indeximplementations forSignature - Remove depecated constants and unsafe
ZERO_KEYconstant
- Use
pub extern crateto export dependencies whose types are exported
- Add
FromStrandDisplayforSignatureand both key types - Fix
build.rsfor Windows and rustfmt configuration for docs.rs - Correct endianness issue for
SignatureDebugoutput
- No changes, just fixed docs.rs configuration
- Correct endianness issue in RFC6979 nonce generation
- Put
PublicKey::combineback because it is currently needed to implement Lightning BOLT 3
- Update
randto 0.4 andgcc0.3 tocc1.0. (rand0.5 exists but has a lot of breaking changes and no longer compiles with 1.14.0.) - Remove
PublicKey::combinefrom 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()sincenewwas unsafe and it should now be impossible to create invalidPublicKeyobjects through the API - Reintroduce serde support behind a feature gate using serde 1.0
- Clean up build process and various typos