Commit Graph

5 Commits

Author SHA1 Message Date
Tobin C. Harding 941083ec4e Remove rand-std dev-dependency from secp256k1
In order to get better test coverage we should not enable the secp26k1
feature "rand-std" in dev-dependencies but instead feature gate tests
that depend on this feature.
2022-12-23 08:33:21 +11:00
Tobin C. Harding 2df51dae15 Create crypto module
Done as part of flattening util.

Currently in `util` module we have a bunch of modules that provide
cryptography related functionality.

Create a `crypto` module and move into it the following:

- ecdsa
- schnorr
- key

To improve uniformity and ergonomics, do the following re-names while we
are at it:

- EcdsaSig -> ecdsa::Signature
- SchnorrSig -> schnorr::Signature
- EcdsaSigError -> ecdsa::Error
- SchnorrSigError -> schnorr::Error
- InvalidSchnorrSigSize -> InvalidSignatureSize  (this is an error enum variant)
2022-11-22 14:09:33 +11:00
Tobin C. Harding 1050fe9cae Remove unnecessary borrow
Clippy emits:

 warning: the borrowed expression implements the required traits

As suggested, remove the unnecessary explicit borrow.
2022-11-04 11:49:14 +11:00
Tobin C. Harding e24c91e9ca sign_message: Run cargo fmt
We just renamed and moved the `util::misc` module to
`crate::sign_message`, doing so prevents `rustfmt` from ignoring it.

run `cargo +nighly fmt`.
2022-09-19 16:44:05 +10:00
Tobin C. Harding 041d6a8097 Move and deprecate script_find_and_remove
Done as part of flattening the `util` module.

We have a function in `util::misc` that operates on scripts, it is an
implementation of `FindAndDelete` from Bitcoin Core and is primarily
useful for supporting `CODESEPARATOR`, which we do not support.

Move the public `script_find_and_remove` function out of `util/misc.rs` and into
`util/mod.rs`, delete the testing and deprecate the function.
2022-09-19 16:44:04 +10:00
Renamed from bitcoin/src/util/misc.rs (Browse further)