Commit Graph

11 Commits

Author SHA1 Message Date
Rusty Russell ed46dd355d test_onion: split encode and decode, drive from cmdline.
This lets us test interaction with python code, for example.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-10-06 12:03:53 +10:30
Rusty Russell 7c36a3e058 test_onion: get rid of dummy crypto options.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-10-06 12:03:31 +10:30
Rusty Russell 9aa8907e38 test_onion: Rename struct pubkey to struct onion_pubkey.
And move to onion_key.h for next patch.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-10-06 12:03:03 +10:30
Rusty Russell f693060068 test_onion: fix random padding.
Randomness is now at start; thanks valgrind!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-10-06 12:00:12 +10:30
Anthony Towns b2c86c650a test_onion: dump more output 2015-10-04 15:02:30 +10:00
Rusty Russell e165d0009c test_onion: Switch from AES256 to AES128.
AFAICT, if SHA256 is good enough, and secp256k1 is good enough, AES128
is good enough.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-10-02 15:16:44 +09:30
Rusty Russell 927bc28c8e test_onion: always generate 0x2 keys.
This means they're 32 bytes, which works better for everything.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-10-02 15:04:33 +09:30
Rusty Russell 90794d8ebf test_onion: generate onion in place.
Rather than keeping each hop, we can generate it in place since we only
need the first hop result.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-10-02 15:04:04 +09:30
Rusty Russell 6aae8d6257 test_onion: keep hmacs rather than padding.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-10-02 15:03:21 +09:30
Rusty Russell 154b917680 test_onion: put padding at the front.
This means we can save the partial HMAC of the padding for each step,
rather than the padding itself, when generating it.

Each step now takes the *last*, not *first* part of the onion array.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-10-02 15:02:53 +09:30
Rusty Russell 81d35294f4 test/test_onion: demo program to show onion routing crypto.
We can make this more efficient, but this works for now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-09-30 16:39:02 +09:30