From 2877062cabd27719f3976ef5d185b9fc0bac90e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niels=20M=C3=B6ller?= Date: Mon, 28 Apr 2025 20:03:32 +0200 Subject: [PATCH] Delete old salsa20 compatibility aliases. --- ChangeLog | 7 +++++++ salsa20.h | 4 ---- testsuite/salsa20-test.c | 22 +++++++++++----------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e5a6836..df9ad2a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2025-04-28 Niels Möller + + * salsa20.h (salsa20_set_iv, SALSA20_IV_SIZE): Delete backwards + compatibility aliases. + * testsuite/salsa20-test.c: Update to consistently use "nonce" + names. + 2025-04-27 Niels Möller * powerpc64/p8/sha256-compress-n.asm: Use 64-bit unsigned compare diff --git a/salsa20.h b/salsa20.h index 9f731f26..f8b1aad0 100644 --- a/salsa20.h +++ b/salsa20.h @@ -50,15 +50,11 @@ extern "C" { #define salsa20r12_crypt nettle_salsa20r12_crypt -/* Alias for backwards compatibility */ -#define salsa20_set_iv nettle_salsa20_set_nonce - /* In octets.*/ #define SALSA20_128_KEY_SIZE 16 #define SALSA20_256_KEY_SIZE 32 #define SALSA20_BLOCK_SIZE 64 #define SALSA20_NONCE_SIZE 8 -#define SALSA20_IV_SIZE SALSA20_NONCE_SIZE /* Aliases */ #define SALSA20_MIN_KEY_SIZE 16 diff --git a/testsuite/salsa20-test.c b/testsuite/salsa20-test.c index d633c3a5..8f7ae029 100644 --- a/testsuite/salsa20-test.c +++ b/testsuite/salsa20-test.c @@ -30,12 +30,12 @@ test_salsa20_stream(const struct tstring *key, uint8_t xor[SALSA20_BLOCK_SIZE]; size_t j; - ASSERT (iv->length == SALSA20_IV_SIZE); + ASSERT (iv->length == SALSA20_NONCE_SIZE); ASSERT (ciphertext->length == 4*SALSA20_BLOCK_SIZE); ASSERT (xor_ref->length == SALSA20_BLOCK_SIZE); salsa20_set_key(&ctx, key->length, key->data); - salsa20_set_iv(&ctx, iv->data); + salsa20_set_nonce(&ctx, iv->data); memset(stream, 0, STREAM_LENGTH + 1); salsa20_crypt(&ctx, STREAM_LENGTH, stream, stream); if (stream[STREAM_LENGTH]) @@ -92,7 +92,7 @@ test_salsa20_stream(const struct tstring *key, for (j = 1; j <= STREAM_LENGTH; j++) { memset(data, 0, STREAM_LENGTH + 1); - salsa20_set_iv(&ctx, iv->data); + salsa20_set_nonce(&ctx, iv->data); salsa20_crypt(&ctx, j, data, data); if (!MEMEQ(j, data, stream)) @@ -192,7 +192,7 @@ typedef void salsa20_func(struct salsa20_ctx *ctx, static void _test_salsa20(salsa20_func *crypt, const struct tstring *key, - const struct tstring *iv, + const struct tstring *nonce, const struct tstring *cleartext, const struct tstring *ciphertext) { @@ -203,12 +203,12 @@ _test_salsa20(salsa20_func *crypt, ASSERT (cleartext->length == ciphertext->length); length = cleartext->length; - ASSERT (iv->length == SALSA20_IV_SIZE); + ASSERT (nonce->length == SALSA20_NONCE_SIZE); data = xalloc(length + 1); salsa20_set_key(&ctx, key->length, key->data); - salsa20_set_iv(&ctx, iv->data); + salsa20_set_nonce(&ctx, nonce->data); data[length] = 17; crypt(&ctx, length, data, cleartext->data); if (data[length] != 17) @@ -231,7 +231,7 @@ _test_salsa20(salsa20_func *crypt, FAIL(); } salsa20_set_key(&ctx, key->length, key->data); - salsa20_set_iv(&ctx, iv->data); + salsa20_set_nonce(&ctx, nonce->data); crypt(&ctx, length, data, data); if (!MEMEQ(length, data, cleartext->data)) @@ -249,11 +249,11 @@ _test_salsa20(salsa20_func *crypt, free(data); } -#define test_salsa20(key, iv, cleartext, ciphertext) \ - _test_salsa20 (salsa20_crypt, (key), (iv), (cleartext), (ciphertext)) +#define test_salsa20(key, nonce, cleartext, ciphertext) \ + _test_salsa20 (salsa20_crypt, (key), (nonce), (cleartext), (ciphertext)) -#define test_salsa20r12(key, iv, cleartext, ciphertext) \ - _test_salsa20 (salsa20r12_crypt, (key), (iv), (cleartext), (ciphertext)) +#define test_salsa20r12(key, nonce, cleartext, ciphertext) \ + _test_salsa20 (salsa20r12_crypt, (key), (nonce), (cleartext), (ciphertext)) void -- 2.47.2