From 219e74cc9837673aa56ad5e5208d5a2fe8207eb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Fri, 12 Feb 2021 17:13:22 +0100 Subject: [PATCH] src: improve a few comments (#1032) --- .../crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c | 4 ++-- src/libsodium/crypto_secretbox/crypto_secretbox_easy.c | 4 ++-- .../xchacha20poly1305/secretbox_xchacha20poly1305.c | 4 ++-- src/libsodium/include/sodium/utils.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c b/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c index 4c347485..a81c4834 100644 --- a/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +++ b/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c @@ -364,7 +364,7 @@ mulv(__m128i A, __m128i B) */ \ MAKE4(RED_MUL_MID); \ \ - /* substracts x1*h1 and x0*h0 */ \ + /* subtracts x1*h1 and x0*h0 */ \ tmp0 = _mm_xor_si128(tmp0, lo); \ tmp0 = _mm_xor_si128(tmp0, hi); \ tmp0 = _mm_xor_si128(tmp1, tmp0); \ @@ -453,7 +453,7 @@ mulv(__m128i A, __m128i B) */ \ MAKE8(RED_MUL_MID); \ \ - /* substracts x1*h1 and x0*h0 */ \ + /* subtracts x1*h1 and x0*h0 */ \ tmp0 = _mm_xor_si128(tmp0, lo); \ tmp0 = _mm_xor_si128(tmp0, hi); \ tmp0 = _mm_xor_si128(tmp1, tmp0); \ diff --git a/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c b/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c index 213de5af..29023f94 100644 --- a/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c +++ b/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c @@ -28,7 +28,7 @@ crypto_secretbox_detached(unsigned char *c, unsigned char *mac, crypto_core_hsalsa20(subkey, n, k, NULL); /* - * Allow the m and and c buffer to partially overlap, by calling + * Allow the m and c buffers to partially overlap, by calling * memmove() if necessary. * * Note that there is no fully portable way to compare pointers. @@ -117,7 +117,7 @@ crypto_secretbox_open_detached(unsigned char *m, const unsigned char *c, } /* - * Allow the m and and c buffer to partially overlap, by calling + * Allow the m and c buffers to partially overlap, by calling * memmove() if necessary. * * Note that there is no fully portable way to compare pointers. diff --git a/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c b/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c index 4c7f2a38..129ab0f9 100644 --- a/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c +++ b/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c @@ -32,7 +32,7 @@ crypto_secretbox_xchacha20poly1305_detached(unsigned char *c, crypto_core_hchacha20(subkey, n, k, NULL); /* - * Allow the m and and c buffer to partially overlap, by calling + * Allow the m and c buffers to partially overlap, by calling * memmove() if necessary. * * Note that there is no fully portable way to compare pointers. @@ -126,7 +126,7 @@ crypto_secretbox_xchacha20poly1305_open_detached(unsigned char *m, } /* - * Allow the m and and c buffer to partially overlap, by calling + * Allow the m and c buffers to partially overlap, by calling * memmove() if necessary. * * Note that there is no fully portable way to compare pointers. diff --git a/src/libsodium/include/sodium/utils.h b/src/libsodium/include/sodium/utils.h index ac801512..f9b36979 100644 --- a/src/libsodium/include/sodium/utils.h +++ b/src/libsodium/include/sodium/utils.h @@ -134,7 +134,7 @@ int sodium_munlock(void * const addr, const size_t len) * either 357 or 361 bytes. For this reason, when using sodium_malloc() to * allocate a crypto_generichash_state structure, padding must be added in * order to ensure proper alignment. crypto_generichash_statebytes() - * returns the rounded up structure size, and should be prefered to sizeof(): + * returns the rounded up structure size, and should be preferred to sizeof(): * state = sodium_malloc(crypto_generichash_statebytes()); */