From: Niels Möller Date: Mon, 30 Nov 2020 19:05:31 +0000 (+0100) Subject: Delete _nettle_chacha_crypt_2core and _nettle_chacha_crypt32_2core. X-Git-Tag: nettle_3.7rc1~13^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42443755a94ccb0c99ce5dde6432ad4311c1ca5d;p=thirdparty%2Fnettle.git Delete _nettle_chacha_crypt_2core and _nettle_chacha_crypt32_2core. --- diff --git a/ChangeLog b/ChangeLog index d47c138e..67003aa4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * chacha-crypt.c: (_nettle_chacha_crypt_4core) (_nettle_chacha_crypt32_4core): New functions. + (_nettle_chacha_crypt_2core, _nettle_chacha_crypt32_2core): + Deleted, no longer needed. * chacha-internal.h: Add prototypes for _nettle_chacha_4core and related functions. * configure.ac (asm_nettle_optional_list): Add chacha-4core.asm. diff --git a/chacha-crypt.c b/chacha-crypt.c index d3af5f58..081ebcf4 100644 --- a/chacha-crypt.c +++ b/chacha-crypt.c @@ -151,41 +151,6 @@ _nettle_chacha_crypt_3core(struct chacha_ctx *ctx, } #endif -#if 0 -void -_nettle_chacha_crypt_2core(struct chacha_ctx *ctx, - size_t length, - uint8_t *dst, - const uint8_t *src) -{ - uint32_t x[2*_CHACHA_STATE_LENGTH]; - - if (!length) - return; - - while (length > CHACHA_BLOCK_SIZE) - { - _nettle_chacha_2core (x, ctx->state, CHACHA_ROUNDS); - ctx->state[12] += 2; - ctx->state[13] += (ctx->state[12] < 2); - if (length <= 2*CHACHA_BLOCK_SIZE) - { - memxor3 (dst, src, x, length); - return; - } - memxor3 (dst, src, x, 2*CHACHA_BLOCK_SIZE); - - length -= 2*CHACHA_BLOCK_SIZE; - dst += 2*CHACHA_BLOCK_SIZE; - src += 2*CHACHA_BLOCK_SIZE; - } - - _nettle_chacha_core (x, ctx->state, CHACHA_ROUNDS); - memxor3 (dst, src, x, length); - ctx->state[13] += (++ctx->state[12] == 0); -} -#endif - #if !(HAVE_NATIVE_chacha_4core || HAVE_NATIVE_chacha_3core) void _nettle_chacha_crypt_1core(struct chacha_ctx *ctx, @@ -302,40 +267,6 @@ _nettle_chacha_crypt32_3core(struct chacha_ctx *ctx, } #endif -#if 0 -void -_nettle_chacha_crypt32_2core(struct chacha_ctx *ctx, - size_t length, - uint8_t *dst, - const uint8_t *src) -{ - uint32_t x[2*_CHACHA_STATE_LENGTH]; - - if (!length) - return; - - while (length > CHACHA_BLOCK_SIZE) - { - _nettle_chacha_2core32 (x, ctx->state, CHACHA_ROUNDS); - ctx->state[12] += 2; - if (length <= 2*CHACHA_BLOCK_SIZE) - { - memxor3 (dst, src, x, length); - return; - } - memxor3 (dst, src, x, 2*CHACHA_BLOCK_SIZE); - - length -= 2*CHACHA_BLOCK_SIZE; - dst += 2*CHACHA_BLOCK_SIZE; - src += 2*CHACHA_BLOCK_SIZE; - } - - _nettle_chacha_core (x, ctx->state, CHACHA_ROUNDS); - memxor3 (dst, src, x, length); - ++ctx->state[12]; -} -#endif - #if !(HAVE_NATIVE_chacha_4core || HAVE_NATIVE_chacha_3core) void _nettle_chacha_crypt32_1core(struct chacha_ctx *ctx,