Closed AnomalRoil closed 2 years ago
These can't be unexported since they implement the tlock Encrypter interface. It will be better to implement these in a more practical way. I will add the comment suggested for now until we can talk more about a better implementation.
Could we have these as /internal
packages then?
If we move the encoding and encryption to the app level, this solves the problem.
Actually this is now solved in #16 too
Having a null nonce is a very dangerous thing when you're re-using the key, so I would much prefer these to be unexported internal functions. And to comment about having a null nonce being fine beause we're generating a new random key for each encryption.
https://github.com/drand/tlock/blob/1208bcd28b6bdd57c3a4637d80626d0152e05aad/encrypters/aead/aead.go#L16-L38