yann2192/wormhole — pull request #4 by TomCrypto (2014-01-02 05:56:57+00:00)
Title: Added packet encryption (+ gofmt)

I have added node-router packet encryption following the specification (except the part about sending `ID(router)` to the destination node in the `dst_id` field). I have moved all the code as methods of Header, which take the private key of the router and the public key of the node.

I think we should not have a uint16 service ID inside the header, because we have to convert it back and forth to big endian byte arrays for fingerprinting/encryption. maybe the uint16 version should be inside Packet?

Also, maybe we should precalculate the ECC shared secret in the RouteHandler so that we don't have to calculate it for every packet. What do you think, could it cause problems later on?