-----
2018/06/16
-- Corrected undefined behaviour in Blake2b
+- Corrected undefined behaviour in BLAKE2b
- Improved the test suite (faster, better coverage)
2.0.2
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.
- 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.
}
////////////////
-/// Blake2 b ///
+/// BLAKE2 b ///
////////////////
static const u64 iv[8] = {
0x6a09e667f3bcc908, 0xbb67ae8584caa73b,
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];
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];
const uint8_t *cipher_text, size_t text_size);
-// General purpose hash (Blake2b)
+// General purpose hash (BLAKE2b)
// ------------------------------
// Direct interface
const uint8_t their_public_key[32]);
-// Signatures (EdDSA with curve25519 + Blake2b)
+// Signatures (EdDSA with curve25519 + BLAKE2b)
// --------------------------------------------
// Generate public key
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");
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");
// 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
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;
}