X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/157dd8c553a7c9abfafc8df801a096ee2346058a..bfff260d2465d42b5916640dc70e91953b967b56:/symm/salsa20.c diff --git a/symm/salsa20.c b/symm/salsa20.c index e78baf05..cc01cf75 100644 --- a/symm/salsa20.c +++ b/symm/salsa20.c @@ -161,6 +161,8 @@ static void populate(salsa20_matrix a, const void *key, size_t ksz) /*----- Salsa20 implementation --------------------------------------------*/ +static const octet zerononce[XSALSA20_NONCESZ]; + /* --- @salsa20_init@ --- * * * Arguments: @salsa20_ctx *ctx@ = context to fill in @@ -176,8 +178,6 @@ static void populate(salsa20_matrix a, const void *key, size_t ksz) void salsa20_init(salsa20_ctx *ctx, const void *key, size_t ksz, const void *nonce) { - static const octet zerononce[SALSA20_NONCESZ]; - populate(ctx->a, key, ksz); salsa20_setnonce(ctx, nonce ? nonce : zerononce); } @@ -421,8 +421,6 @@ SALSA20_VARS(DEFHSALSA20) void XSALSA20_INIT(r, XSALSA20_CTX(r) *ctx, \ const void *key, size_t ksz, const void *nonce) \ { \ - static const octet zerononce[XSALSA20_NONCESZ]; \ - \ populate(ctx->k, key, ksz); \ ctx->s.a[ 0] = SALSA20_A256; \ ctx->s.a[ 1] = SALSA20_B256; \