[noise] Aligning with Chrome and IETF's ChaCha20/Poly1305

Jonathan Rudenberg jonathan at titanous.com
Mon Jul 14 00:25:02 PDT 2014


On Jul 14, 2014, at 12:14 AM, Trevor Perrin <trevp at trevp.net> wrote:

> Nice!, looks like you got everything.
> 
> (I found handling of the keystream buffer a little hard to follow, I'm
> not sure why that needs to be part of noise255Ctx, instead of stored
> in local vars?)
> 
> Trevor

Yeah, the reason the backing array is in the context instead of a local variable is to avoid a heap allocation for each rekey. I’ll see if I can come up with a way of making it clearer (perhaps adding some comments would help).

My current goal is to make an efficient implementation that creates as little garbage as possible as opposed to a clean reference implementation, so readability is currently suffering in some areas.

Jonathan


More information about the Noise mailing list