A Bitcoin Lightning implementation in Rust.
Still super-early code-dump quality and is missing large chunks. See README in git repo for suggested projects if you want to contribute. Don't have to bother telling you not to use this for anything serious, because you'd have to finish building it to even try.
"""
+build = "build.rs"
[features]
# Supports tracking channels with a non-bitcoin chain hashes. Currently enables all kinds of fun DoS attacks.
rand = "0.4"
secp256k1 = "0.9"
+[build-dependencies]
+gcc = "0.3"
+
[dev-dependencies.bitcoin]
version = "0.13"
features = ["bitcoinconsensus"]
--- /dev/null
+extern crate gcc;
+
+fn main() {
+ #[cfg(not(any(target_arch = "x86", target_arch = "x86_64", target_arch = "arm")))]
+ {
+ let mut cfg = gcc::Build::new();
+ cfg.file("src/util/rust_crypto_nonstd_arch.c");
+ cfg.compile("lib_rust_crypto_nonstd_arch.a");
+ }
+}
version = "0.0.1"
authors = ["Automatically generated"]
publish = false
+# Because the function is unused it gets dropped before we link lightning, so
+# we have to duplicate build.rs here. Note that this is only required for
+# fuzztarget mode.
+build = "../build.rs"
[package.metadata]
cargo-fuzz = true
honggfuzz = { version = "0.5", optional = true }
afl = { version = "0.3", optional = true }
+[build-dependencies]
+gcc = "0.3"
+
# Prevent this from interfering with workspaces
[workspace]
members = ["."]
--- /dev/null
+../../../src/util/rust_crypto_nonstd_arch.c
\ No newline at end of file
--- /dev/null
+#include <stdint.h>
+#include <stdlib.h>
+
+uint32_t rust_crypto_util_fixed_time_eq_asm(uint8_t* lhsp, uint8_t* rhsp, size_t count) {
+ if (count == 0) {
+ return 1;
+ }
+ uint8_t result = 0;
+ for (size_t i = 0; i < count; i++) {
+ result |= (lhsp[i] ^ rhsp[i]);
+ }
+ return result;
+}