From cbeb2e7cbc00c9160e150b08ed4595bfbee8129b Mon Sep 17 00:00:00 2001 From: Loup Vaillant Date: Fri, 14 Jan 2022 22:46:41 +0100 Subject: [PATCH] Rename 'Blake2' to 'BLAKE2' --- CHANGELOG.md | 6 +++--- src/monocypher.c | 4 ++-- src/monocypher.h | 6 +++--- tests/speed/speed-sodium.c | 2 +- tests/speed/speed.c | 2 +- tests/test.c | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1662408..18022b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -89,7 +89,7 @@ ----- 2018/06/16 -- Corrected undefined behaviour in Blake2b +- Corrected undefined behaviour in BLAKE2b - Improved the test suite (faster, better coverage) 2.0.2 @@ -144,7 +144,7 @@ boundaries. The API changes increase consistency. 2017/07/23 - Optimised the loading and unloading code of the symmetric crypto - (Blake2b, sha512, Chacha20, and Poly1305). + (BLAKE2b, sha512, Chacha20, and Poly1305). - Fused self contained tests together for easier analysis with Frama-C and the TIS interpreter. @@ -175,7 +175,7 @@ boundaries. The API changes increase consistency. - Slightly changed the authenticated encryption API. Functions are now all in "detached" mode. The reason is better support for authenticated encryption _without_ additional data. -- Rewrote Blake2b from spec, so it can use the same licence as +- Rewrote BLAKE2b from spec, so it can use the same licence as everything else. - Added random tests that compare Monocypher with libsodium and ed25519-donna. diff --git a/src/monocypher.c b/src/monocypher.c index 30642e6..08e4729 100644 --- a/src/monocypher.c +++ b/src/monocypher.c @@ -451,7 +451,7 @@ void crypto_poly1305(u8 mac[16], const u8 *message, } //////////////// -/// Blake2 b /// +/// BLAKE2 b /// //////////////// static const u64 iv[8] = { 0x6a09e667f3bcc908, 0xbb67ae8584caa73b, @@ -665,7 +665,7 @@ static void wipe_block(block *b) ZERO(a, 128); } -// updates a Blake2 hash with a 32 bit word, little endian. +// updates a BLAKE2 hash with a 32 bit word, little endian. static void blake_update_32(crypto_blake2b_ctx *ctx, u32 input) { u8 buf[4]; diff --git a/src/monocypher.h b/src/monocypher.h index 50f0fcb..54b3af2 100644 --- a/src/monocypher.h +++ b/src/monocypher.h @@ -90,7 +90,7 @@ typedef struct { size_t c_idx; // How many bytes are there in the chunk. } crypto_poly1305_ctx; -// Hash (Blake2b) +// Hash (BLAKE2b) typedef struct { uint64_t hash[8]; uint64_t input_offset[2]; @@ -160,7 +160,7 @@ int crypto_unlock_aead(uint8_t *plain_text, const uint8_t *cipher_text, size_t text_size); -// General purpose hash (Blake2b) +// General purpose hash (BLAKE2b) // ------------------------------ // Direct interface @@ -209,7 +209,7 @@ void crypto_key_exchange(uint8_t shared_key [32], const uint8_t their_public_key[32]); -// Signatures (EdDSA with curve25519 + Blake2b) +// Signatures (EdDSA with curve25519 + BLAKE2b) // -------------------------------------------- // Generate public key diff --git a/tests/speed/speed-sodium.c b/tests/speed/speed-sodium.c index 8111cba..857308a 100644 --- a/tests/speed/speed-sodium.c +++ b/tests/speed/speed-sodium.c @@ -180,7 +180,7 @@ int main() print("Chacha20 ",chacha20() *MUL,"megabytes per second"); print("Poly1305 ",poly1305() *MUL,"megabytes per second"); print("Auth'd encryption",authenticated()*MUL,"megabytes per second"); - print("Blake2b ",blake2b() *MUL,"megabytes per second"); + print("BLAKE2b ",blake2b() *MUL,"megabytes per second"); print("Sha512 ",sha512() *MUL,"megabytes per second"); print("Argon2i, 3 passes",argon2i() *MUL,"megabytes per second"); print("x25519 ",x25519() ,"exchanges per second"); diff --git a/tests/speed/speed.c b/tests/speed/speed.c index b02fff0..ee64bb8 100644 --- a/tests/speed/speed.c +++ b/tests/speed/speed.c @@ -207,7 +207,7 @@ int main() print("Chacha20 ",chacha20() *MUL ,"megabytes per second"); print("Poly1305 ",poly1305() *MUL ,"megabytes per second"); print("Auth'd encryption ",authenticated()*MUL ,"megabytes per second"); - print("Blake2b ",blake2b() *MUL ,"megabytes per second"); + print("BLAKE2b ",blake2b() *MUL ,"megabytes per second"); print("Sha512 ",sha512() *MUL ,"megabytes per second"); print("Argon2i, 3 passes ",argon2i() *MUL ,"megabytes per second"); print("x25519 ",x25519() ,"exchanges per second"); diff --git a/tests/test.c b/tests/test.c index 33c60ce..fa427c3 100644 --- a/tests/test.c +++ b/tests/test.c @@ -537,11 +537,11 @@ static int p_blake2b() // Compare the results (must be the same) status |= memcmp(hash_chunk, hash_whole, 64); } - printf("%s: Blake2b (incremental)\n", status != 0 ? "FAILED" : "OK"); + printf("%s: BLAKE2b (incremental)\n", status != 0 ? "FAILED" : "OK"); return status; } -// Tests that the input and output buffers of Blake2b can overlap. +// Tests that the input and output buffers of BLAKE2b can overlap. static int p_blake2b_overlap() { #undef INPUT_SIZE @@ -554,7 +554,7 @@ static int p_blake2b_overlap() crypto_blake2b(input+i, input + 64, BLAKE2B_BLOCK_SIZE); status |= memcmp(hash, input + i, 64); } - printf("%s: Blake2b (overlapping i/o)\n", status != 0 ? "FAILED" : "OK"); + printf("%s: BLAKE2b (overlapping i/o)\n", status != 0 ? "FAILED" : "OK"); return status; } -- 2.47.3