26 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
e1c165a373 for testing, destAddr is just some string 2016-01-15 19:20:27 -08:00
Olaoluwa Osuntokun
15fd3085dd hack: restrict AES keySize to 16
* original security partaker was 16 so it didn’t matter. But it’s 20
now, so this is a quick hack/fix. In future should intelligently “round
down”
2016-01-15 19:20:27 -08:00
Olaoluwa Osuntokun
2e89e5a4be don't need the final identifier to create forwarding message
* Final ID is implicitly the last node in the path
2016-01-15 19:20:27 -08:00
Olaoluwa Osuntokun
4b304adf2a expand filler bytes to full size, avoids panic 2016-01-15 19:20:27 -08:00
Olaoluwa Osuntokun
066f72e6ec add default net for future testing
* testnet-L vs mainnet vs tesnet etcc
2016-01-15 19:20:27 -08:00
Olaoluwa Osuntokun
9d39ffbdd8 derive nodeID/addr from the nodes pubKey 2016-01-15 19:20:27 -08:00
Olaoluwa Osuntokun
2edf9209f6 update comments, tests forthcoming 2016-01-15 19:20:27 -08:00
Olaoluwa Osuntokun
e75d0c4f6a node ID's are now Hash160's
* also update all the constants to reflect the new security parameter
2016-01-15 19:20:26 -08:00
Olaoluwa Osuntokun
deeb6128d9 Implement node processing of mix headers
* Final step at this point is to erect an adequate set of unit and
integration tests to ensure mix-net correctness.

* the processMsgAction is a temporary hack and should be replaced with
a better interface once sphinx is integrated into the final daemon.
2016-01-15 19:20:26 -08:00
Olaoluwa Osuntokun
ada9fc7082 update routingInfoSize to use the consts
* Also start using the LightningAddress type as a place holder
2016-01-15 19:20:26 -08:00
Olaoluwa Osuntokun
c6d8f6c5f3 add sphinx payload struct back so hornet.go can compile 2016-01-15 19:20:26 -08:00
Olaoluwa Osuntokun
3838b2333b Flesh out doc string for ForwardingMessage and a few others
* Next step is to write the logic for processing mix messages
2016-01-15 19:20:26 -08:00
Olaoluwa Osuntokun
1b98267ca4 Adding comments for MixHeader, create New method 2016-01-15 19:20:26 -08:00
Olaoluwa Osuntokun
037b1f47ee flesh out comment for generateHeaderPadding 2016-01-15 19:20:26 -08:00
Olaoluwa Osuntokun
4efb397ade Update constants at top to reflect new k value 2016-01-15 19:20:26 -08:00
Olaoluwa Osuntokun
cbfefdf0f4 adds comments to the lioness block cipher implementation 2016-01-15 19:20:26 -08:00
Olaoluwa Osuntokun
98b228d77e finish lioness implementation, add basic test 2016-01-15 19:20:25 -08:00
Olaoluwa Osuntokun
05d034e3ef generateRandBytes -> generateCipherStream 2016-01-15 19:20:25 -08:00
Olaoluwa Osuntokun
b1dfeb3724 switch default securityParamter to 32 bytes
* Node ID’s can only be as long as the security parameter k. Using 16
gives us much smaller overhead for routing messages. However, this
means all node ID’s would have to be 16 bytes.

* So with this change a node-id is the SHA-256 of a node’s public key.
The public key MUST be serialized in compressed form. This node-id
could then possibly be encoded as a bitcoin address (Base58Check).

* It’s assumed senders have a way to retrieve a node’s public key given
the node id.
2016-01-15 19:20:25 -08:00
Olaoluwa Osuntokun
a67603051c Further flesh out sphinx implementation
* Over head is quite small, at just 225 bytes if assuming 5 hops
* Most likely also don’t even need the message at all?
  * What would it contain?

* Bunch of TODO’s still left in the code, need to write the portion for
processing and forwarding mix headers received by the nodes.

* After the processing stuff, need to write an extensive set of tests
to ensure correctness.

* Also, need to figure out the division between nodeID and lightning
address. For sphinx, they must be “prefix free”.
2016-01-15 19:20:25 -08:00
Olaoluwa Osuntokun
90316e6426 Yep, secret derivation checks it out sage math
* Meaning the way we calculate the shared secret
* They get M = (G * x_us) * b_0, they calc the secret with M * x_them
   * M * x_them = G * x_us * b_ * x_them
* We have H = (G * x_them), we calc with H * (x_us * b_0 mod n))
  * H * (x_us * b_0) = G * x_them * x_us * b_0
2016-01-15 19:20:25 -08:00
Olaoluwa Osuntokun
032c24824a start of sphinx implementation, need to verify in sage tho 2016-01-15 19:20:25 -08:00
Olaoluwa Osuntokun
32db5f7dfe moving sphinx stuff to diff file 2016-01-15 19:20:25 -08:00
Olaoluwa Osuntokun
7a42591826 move notes to self to new files 2016-01-15 19:20:22 -08:00
Olaoluwa Osuntokun
6c11bcd0ce HMAC is part of AHDR not the FS 2015-10-06 14:36:18 -07:00
Olaoluwa Osuntokun
f16691a98f Initial brain dump of ln-hornet 2015-10-06 14:34:26 -07:00