practicalswift
98f49c0837
Remove include in file foo.c that is already included in foo.h
7 years ago
Rusty Russell
f42f34b82d
external: new subdirectory for all external libraries and submodules.
You will want to 'make distclean' after this.
I also removed libsecp; we use the one in in libwally anyway.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
85ff95e829
common: new directory for any shared objects.
To avoid everything pulling in HTLCs stuff to the opening daemon, we
split the channel and commit_tx routines into initial_channel and
initial_commit_tx (no HTLC support) and move full HTLC supporting versions
into channeld.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Christian Decker
f10b779c83
pubkey: valgrind was reporting about unset memory in address parsing
This is likely due to `libbase58` implicitly relying on the passed in
buffer to be memset to 0, in order to report the correct decoded
length.
8 years ago
Christian Decker
954b2c4a67
fix: Corrently parse non-testnet p2pkh addresses
The return value of `b58check` is negative on failure, and positive
values are the address version, i.e., 0 in the case of mainnet
addresses.
8 years ago
Rusty Russell
b99c5620ef
struct secret: use everywhere.
We alternated between using a sha256 and using a privkey, but there are
numerous places where we have a random 32 bytes which are neither.
This fixes many of them (plus, struct privkey is now defined in terms of
struct secret).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
e899c47260
bitcoin/base58: don't segv if key_to_base58 / key_from_base58 called first.
We need to initialize b58_sha256_impl here too.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Christian Decker
452656f5a1
base58: Making check-source happy again
Trailing whitespace and include ordering was broken.
8 years ago
Lucas Betschart
3e6bb958eb
Add libbase58 as git submodule
Pointing to the latest release (0.1.4)
8 years ago
Rusty Russell
a4fdaab5b3
Use global secp256k1_ctx instead of passing it around.
If I'd known how large this patch would be (though trivial), I'd
have done it in parts.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
bcd3e5f60e
base58: fix check-source header order check.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Christian Decker
1f4a056009
Switched base58 to use libbase58.
9 years ago
Rusty Russell
364c2cd2c0
key_from_base58 / pubkey_from_privkey: don't support non-compressed keys.
It just clutters the API, and we don't support them on the wire anyway.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
9aa0eac814
bitcoin: hand in a secp256k1_context to all routines.
We don't want to re-create them internally, ever.
The test-cli tools are patched to generate them all the time, but
they're not performance critical.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
04fd2c861f
bitcoin/base58: p2sh address support.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
9ebbe16b1e
source cleanup: sort include lines into alpha order
This makes merging easier in future.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
242fa1b2dd
pubkey: pubkey_eq helper.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
e7856e6e69
Update libsecp to git@github.com:bitcoin/secp256k1.git 52fd03f
We want the ecdh stuff for onion routing.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
8f64eb90af
Switch over to CCAN's ripemd160.
Avoids handing naked u8 arrays around, too.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
d20ddb5a90
Use libsecp256k1 instead of openssl for crypto.
We still use openssl for bignums (base58) and for ripemd.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
ef9463f6b1
Sort include lines (ignoring hacky cli test utils).
Put ccan first, openssl next, then standard headers, then locals.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
612d713470
Move bitcoin stuff into bitcoin subdir.
It's not very interesting if you're looking for LN code.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
07c7214edb
Explicit pubkey structure.
This checks that the protobuf is the right form, also handles uncompressed
keys (though you shouldn't be using those any more, should you?)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
1c4fdce514
Initial silly cmdline util to create an openchannel packet.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago