[noise] MixKey during initialization

Trevor Perrin trevp at trevp.net
Mon Aug 31 09:07:33 PDT 2015


On Mon, Aug 31, 2015 at 6:23 AM, Jason A. Donenfeld <Jason at zx2c4.com> wrote:
> session.Initialize() first calls kernel.Initialize(), which sets k and
> n to all zeros. Then it calls kernel.MixKey(). MixKey in turn calls
> KDF, which in turn calls GETKEY which in turn calls ENCRYPT.
>
> Because k is all zeros, GETKEY winds up encrypting a block of zeros
> using a key of all zeros. The result isn't exactly zero, since with
> ChaCha we're having the block counter start at 1, but still, it might
> as well be. I seem to remember before you specifying, "If GETKEY is
> called and k is empty, return empty." Is this still the current
> intention?


No, this isn't special-cased currently.  But note that without a
pre-shared key, this calculates a constant for k, so you're welcome to
store the constant and skip the calculation.

Trevor


More information about the Noise mailing list