- Stop using deprecated (and probably
not cryptographically secure) exp/rand, switch to crypto/rand instead
- Reduce code duplicacy by defining `buildAesStaticKey()` method
- Properly handle pointer to `crypto.AESSymmetricKey` struct
to prevent nil pointer dereferences
- go mod tidy
Re: the tests, this happens largely because when you can check for errors changes fundamentally
based on whether or not you're just reading some bytes and storing them for later or whether
you're reading them and then immediately trying to store them in some intelligible datastructure.
The old code, before I started refactoring it, sort of split the difference by putting everything
into slices of bytes, but hanging functions off those byte slices to parse intellible structures
on the fly. The tests were largely designed around testing this format. Updating them has been
a menace. It is very difficult to tell which tests are necessary and how the necessary tests need
to be changed. A handful of high-level tests in router_info_test currently won't compile. I think
those are the only remaining broken tests.
Since I turned out to be implementing parts of Noise which I did not need to implement, I'm taking a different approach, and doing an unmodified Noise transport first and then making our modifications to it. That should reduce what I need to do to message pre-processing mostly, I think.