* dsa-internal.h: Likewise.
* gost28147-internal.h: Likewise.
* poly1305-internal.h: Likewise.
+ * salsa20-internal.h: Likewise.
2020-11-26 Niels Möller <nisse@lysator.liu.se>
} while(0)
void
-_salsa20_core(uint32_t *dst, const uint32_t *src, unsigned rounds)
+_nettle_salsa20_core(uint32_t *dst, const uint32_t *src, unsigned rounds)
{
uint32_t x[_SALSA20_INPUT_LENGTH];
unsigned i;
#include "memxor.h"
#if HAVE_NATIVE_salsa20_2core
-#undef _salsa20_crypt_2core
-#define _salsa20_crypt_2core _salsa20_crypt
+#define _nettle_salsa20_crypt_2core _nettle_salsa20_crypt
#elif !HAVE_NATIVE_fat_salsa20_2core
-#undef _salsa20_crypt_1core
-#define _salsa20_crypt_1core _salsa20_crypt
+#define _nettle_salsa20_crypt_1core _nettle_salsa20_crypt
#endif
#if HAVE_NATIVE_salsa20_2core || HAVE_NATIVE_fat_salsa20_2core
void
-_salsa20_crypt_2core(struct salsa20_ctx *ctx, unsigned rounds,
- size_t length, uint8_t *dst,
- const uint8_t *src)
+_nettle_salsa20_crypt_2core(struct salsa20_ctx *ctx, unsigned rounds,
+ size_t length, uint8_t *dst,
+ const uint8_t *src)
{
uint32_t x[2*_SALSA20_INPUT_LENGTH];
while (length > SALSA20_BLOCK_SIZE)
{
- _salsa20_2core (x, ctx->input, rounds);
+ _nettle_salsa20_2core (x, ctx->input, rounds);
ctx->input[8] += 2;
ctx->input[9] += (ctx->input[8] < 2);
if (length <= 2 * SALSA20_BLOCK_SIZE)
dst += 2*SALSA20_BLOCK_SIZE;
src += 2*SALSA20_BLOCK_SIZE;
}
- _salsa20_core (x, ctx->input, rounds);
+ _nettle_salsa20_core (x, ctx->input, rounds);
ctx->input[9] += (++ctx->input[8] == 0);
memxor3 (dst, src, x, length);
}
#if !HAVE_NATIVE_salsa20_2core
void
-_salsa20_crypt_1core(struct salsa20_ctx *ctx, unsigned rounds,
- size_t length,
- uint8_t *dst,
- const uint8_t *src)
+_nettle_salsa20_crypt_1core(struct salsa20_ctx *ctx, unsigned rounds,
+ size_t length,
+ uint8_t *dst,
+ const uint8_t *src)
{
for (;;)
{
uint32_t x[_SALSA20_INPUT_LENGTH];
- _salsa20_core (x, ctx->input, rounds);
+ _nettle_salsa20_core (x, ctx->input, rounds);
ctx->input[9] += (++ctx->input[8] == 0);
if (!length)
return;
- _salsa20_crypt (ctx, 20, length, c, m);
+ _nettle_salsa20_crypt (ctx, 20, length, c, m);
}
#include "nettle-types.h"
#include "salsa20.h"
-#define _salsa20_core _nettle_salsa20_core
-#define _salsa20_2core _nettle_salsa20_2core
-#define _salsa20_crypt _nettle_salsa20_crypt
-#define _salsa20_crypt_1core _nettle_salsa20_crypt_1core
-#define _salsa20_crypt_2core _nettle_salsa20_crypt_2core
-
void
-_salsa20_core(uint32_t *dst, const uint32_t *src, unsigned rounds);
+_nettle_salsa20_core(uint32_t *dst, const uint32_t *src, unsigned rounds);
void
-_salsa20_crypt(struct salsa20_ctx *ctx, unsigned rounds,
- size_t length, uint8_t *dst,
- const uint8_t *src);
+_nettle_salsa20_crypt(struct salsa20_ctx *ctx, unsigned rounds,
+ size_t length, uint8_t *dst,
+ const uint8_t *src);
/* Functions available only in some configurations */
void
-_salsa20_2core(uint32_t *dst, const uint32_t *src, unsigned rounds);
+_nettle_salsa20_2core(uint32_t *dst, const uint32_t *src, unsigned rounds);
void
-_salsa20_crypt_1core(struct salsa20_ctx *ctx, unsigned rounds,
- size_t length, uint8_t *dst,
- const uint8_t *src);
+_nettle_salsa20_crypt_1core(struct salsa20_ctx *ctx, unsigned rounds,
+ size_t length, uint8_t *dst,
+ const uint8_t *src);
void
-_salsa20_crypt_2core(struct salsa20_ctx *ctx, unsigned rounds,
- size_t length, uint8_t *dst,
- const uint8_t *src);
+_nettle_salsa20_crypt_2core(struct salsa20_ctx *ctx, unsigned rounds,
+ size_t length, uint8_t *dst,
+ const uint8_t *src);
#endif /* NETTLE_SALSA20_INTERNAL_H_INCLUDED */
if (!length)
return;
- _salsa20_crypt (ctx, 12, length, c, m);
+ _nettle_salsa20_crypt (ctx, 12, length, c, m);
}