(Re)apply local modifications
This commit is contained in:
commit
bd863cc5aa
12
README.md
12
README.md
|
@ -1,3 +1,15 @@
|
||||||
|
# Unsafe Fast Fork
|
||||||
|
## DO NOT USE THIS LIBRARY
|
||||||
|
|
||||||
|
This is an experimental fork with extreme changes that **intentionally break important security mechanisms and functionality** in favor of speed for certain security research workloads.
|
||||||
|
|
||||||
|
The forked library version is **completely unsuitable for any type of production use** and receives no support or maintenance of any kind.
|
||||||
|
It is published primarily as a reference for other researchers. You have been warned.
|
||||||
|
|
||||||
|
The original documentation content and other references are kept as-is to limit the repository differences to upstream. However, be aware that none of the contact information, usage guidance or security guarantees still applies since this is a deliberately broken variant of the project.
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<h1>Rust Bitcoin</h1>
|
<h1>Rust Bitcoin</h1>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "bitcoin"
|
name = "bitcoin"
|
||||||
version = "0.33.0-alpha.0"
|
# fake version for vendoring
|
||||||
|
version = "0.99.0"
|
||||||
authors = ["Andrew Poelstra <apoelstra@wpsoftware.net>"]
|
authors = ["Andrew Poelstra <apoelstra@wpsoftware.net>"]
|
||||||
license = "CC0-1.0"
|
license = "CC0-1.0"
|
||||||
repository = "https://github.com/rust-bitcoin/rust-bitcoin/"
|
repository = "https://github.com/rust-bitcoin/rust-bitcoin/"
|
||||||
|
@ -33,7 +34,7 @@ hex = { package = "hex-conservative", version = "0.3.0", default-features = fals
|
||||||
internals = { package = "bitcoin-internals", path = "../internals", features = ["alloc", "hex"] }
|
internals = { package = "bitcoin-internals", path = "../internals", features = ["alloc", "hex"] }
|
||||||
io = { package = "bitcoin-io", path = "../io", default-features = false, features = ["alloc", "hashes"] }
|
io = { package = "bitcoin-io", path = "../io", default-features = false, features = ["alloc", "hashes"] }
|
||||||
primitives = { package = "bitcoin-primitives", path = "../primitives", default-features = false, features = ["alloc", "hex"] }
|
primitives = { package = "bitcoin-primitives", path = "../primitives", default-features = false, features = ["alloc", "hex"] }
|
||||||
secp256k1 = { version = "0.30.0", default-features = false, features = ["hashes", "alloc", "rand"] }
|
secp256k1 = { version = "0.99.0", default-features = false, features = ["hashes", "alloc", "rand"] } # ensure the internal version is actually used
|
||||||
units = { package = "bitcoin-units", path = "../units", default-features = false, features = ["alloc"] }
|
units = { package = "bitcoin-units", path = "../units", default-features = false, features = ["alloc"] }
|
||||||
|
|
||||||
arbitrary = { version = "1.4", optional = true }
|
arbitrary = { version = "1.4", optional = true }
|
||||||
|
|
|
@ -805,10 +805,14 @@ impl Xpriv {
|
||||||
let tweaked =
|
let tweaked =
|
||||||
sk.add_tweak(&self.private_key.into()).expect("statistically impossible to hit");
|
sk.add_tweak(&self.private_key.into()).expect("statistically impossible to hit");
|
||||||
|
|
||||||
|
// BREAKING CHANGE
|
||||||
|
// parent_fingerprint: self.fingerprint(secp),
|
||||||
|
// this brings a strong performance improvement
|
||||||
|
// TODO check performance impact of error handling
|
||||||
Ok(Xpriv {
|
Ok(Xpriv {
|
||||||
network: self.network,
|
network: self.network,
|
||||||
depth: self.depth.checked_add(1).ok_or(DerivationError::MaximumDepthExceeded)?,
|
depth: self.depth.checked_add(1).ok_or(DerivationError::MaximumDepthExceeded)?,
|
||||||
parent_fingerprint: self.fingerprint(secp),
|
parent_fingerprint: Default::default(),
|
||||||
child_number: i,
|
child_number: i,
|
||||||
private_key: tweaked,
|
private_key: tweaked,
|
||||||
chain_code: ChainCode::from_hmac(hmac),
|
chain_code: ChainCode::from_hmac(hmac),
|
||||||
|
@ -963,10 +967,14 @@ impl Xpub {
|
||||||
let tweaked =
|
let tweaked =
|
||||||
self.public_key.add_exp_tweak(secp, &sk.into()).expect("cryptographically unreachable");
|
self.public_key.add_exp_tweak(secp, &sk.into()).expect("cryptographically unreachable");
|
||||||
|
|
||||||
|
// BREAKING CHANGE
|
||||||
|
// parent_fingerprint: self.fingerprint(),
|
||||||
|
// this brings less of a performance improvement
|
||||||
|
// TODO check performance impact of error handling
|
||||||
Ok(Xpub {
|
Ok(Xpub {
|
||||||
network: self.network,
|
network: self.network,
|
||||||
depth: self.depth.checked_add(1).ok_or(DerivationError::MaximumDepthExceeded)?,
|
depth: self.depth.checked_add(1).ok_or(DerivationError::MaximumDepthExceeded)?,
|
||||||
parent_fingerprint: self.fingerprint(),
|
parent_fingerprint: Default::default(),
|
||||||
child_number: i,
|
child_number: i,
|
||||||
public_key: tweaked,
|
public_key: tweaked,
|
||||||
chain_code,
|
chain_code,
|
||||||
|
|
Loading…
Reference in New Issue