x/crypto/chacha20: It should be possible to reinitialise a chacha20 primitive to avoid unnecessary allocations #44449
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
The chacha20 package tries to allow the Cipher allocation to be inlined and put upon the stack in NewUnauthenticatedCipher(), but it does not provide any way to use an existing Cipher and reinitialise it. This can result in workers that are on hot paths doing unnecessary allocations instead of being able to allocate the memory for the Cipher up front and simply initialise it with the correct key + nonce during operation.
I have a simple patch which adds an Init() method to allow this which I intend to submit shortly.
The text was updated successfully, but these errors were encountered: