X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/157dd8c553a7c9abfafc8df801a096ee2346058a..bfff260d2465d42b5916640dc70e91953b967b56:/symm/chacha.c diff --git a/symm/chacha.c b/symm/chacha.c index 84b6c36f..a30516de 100644 --- a/symm/chacha.c +++ b/symm/chacha.c @@ -152,6 +152,8 @@ static void populate(chacha_matrix a, const void *key, size_t ksz) /*----- ChaCha implementation ---------------------------------------------*/ +static const octet zerononce[XCHACHA_NONCESZ]; + /* --- @chacha_init@ --- * * * Arguments: @chacha_ctx *ctx@ = context to fill in @@ -167,8 +169,6 @@ static void populate(chacha_matrix a, const void *key, size_t ksz) void chacha_init(chacha_ctx *ctx, const void *key, size_t ksz, const void *nonce) { - static const octet zerononce[CHACHA_NONCESZ]; - populate(ctx->a, key, ksz); chacha_setnonce(ctx, nonce ? nonce : zerononce); } @@ -403,8 +403,6 @@ CHACHA_VARS(DEFHCHACHA) void XCHACHA_INIT(r, XCHACHA_CTX(r) *ctx, \ const void *key, size_t ksz, const void *nonce) \ { \ - static const octet zerononce[XCHACHA_NONCESZ]; \ - \ populate(ctx->k, key, ksz); \ ctx->s.a[ 0] = CHACHA_A256; \ ctx->s.a[ 1] = CHACHA_B256; \