diff --git a/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c b/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c index bffac865..362beb01 100644 --- a/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +++ b/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c @@ -417,6 +417,7 @@ int blake2b_salt_personal( uint8_t *out, const void *in, const void *key, const int blake2b_pick_best_implementation(void) { +/* LCOV_EXCL_START */ #if (defined(HAVE_AVX2INTRIN_H) && defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H)) || \ (defined(_MSC_VER) && (defined(_M_X64) || defined(_M_AMD64))) if (sodium_runtime_has_avx2()) { @@ -441,4 +442,5 @@ blake2b_pick_best_implementation(void) blake2b_compress = blake2b_compress_ref; return 0; +/* LCOV_EXCL_STOP */ } diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-core.c b/src/libsodium/crypto_pwhash/argon2/argon2-core.c index 84129aa7..4ba2ec53 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-core.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2-core.c @@ -547,6 +547,7 @@ int initialize(argon2_instance_t *instance, argon2_context *context) { int argon2_pick_best_implementation(void) { +/* LCOV_EXCL_START */ #if (defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H)) || \ (defined(_MSC_VER) && (defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86))) if (sodium_runtime_has_ssse3()) { @@ -557,4 +558,5 @@ int argon2_pick_best_implementation(void) fill_segment = fill_segment_ref; return 0; +/* LCOV_EXCL_STOP */ } diff --git a/test/default/pwhash.c b/test/default/pwhash.c index 41eb1e69..7be6f293 100644 --- a/test/default/pwhash.c +++ b/test/default/pwhash.c @@ -244,6 +244,29 @@ int main(void) assert(crypto_pwhash_memlimit_sensitive() > 0U); assert(strcmp(crypto_pwhash_primitive(), "argon2i") == 0); + assert(crypto_pwhash_opslimit_interactive() == crypto_pwhash_OPSLIMIT_INTERACTIVE); + assert(crypto_pwhash_memlimit_interactive() == crypto_pwhash_MEMLIMIT_INTERACTIVE); + assert(crypto_pwhash_opslimit_moderate() == crypto_pwhash_OPSLIMIT_MODERATE); + assert(crypto_pwhash_memlimit_moderate() == crypto_pwhash_MEMLIMIT_MODERATE); + assert(crypto_pwhash_opslimit_sensitive() == crypto_pwhash_OPSLIMIT_SENSITIVE); + assert(crypto_pwhash_memlimit_sensitive() == crypto_pwhash_MEMLIMIT_SENSITIVE); + + assert(crypto_pwhash_argon2i_saltbytes() == crypto_pwhash_saltbytes()); + assert(crypto_pwhash_argon2i_strbytes() == crypto_pwhash_strbytes()); + assert(strcmp(crypto_pwhash_argon2i_strprefix(), crypto_pwhash_strprefix()) == 0); + assert(crypto_pwhash_argon2i_opslimit_interactive() == + crypto_pwhash_opslimit_interactive()); + assert(crypto_pwhash_argon2i_opslimit_moderate() == + crypto_pwhash_opslimit_moderate()); + assert(crypto_pwhash_argon2i_opslimit_sensitive() == + crypto_pwhash_opslimit_sensitive()); + assert(crypto_pwhash_argon2i_memlimit_interactive() == + crypto_pwhash_memlimit_interactive()); + assert(crypto_pwhash_argon2i_memlimit_moderate() == + crypto_pwhash_memlimit_moderate()); + assert(crypto_pwhash_argon2i_memlimit_sensitive() == + crypto_pwhash_memlimit_sensitive()); + sodium_free(salt); sodium_free(str_out); sodium_free(str_out2); diff --git a/test/default/sign.c b/test/default/sign.c index 944d77ea..eea0c99e 100644 --- a/test/default/sign.c +++ b/test/default/sign.c @@ -1181,6 +1181,14 @@ int main(void) printf("detached signature verification should have failed\n"); } + memset(sig, 0xff, 32); + sig[0] = 0xdb; + if (crypto_sign_verify_detached(sig, + (const unsigned char *)test_data[i].m, + i, pk) != -1) { + printf("detached signature verification should have failed\n"); + } + if (crypto_sign_keypair(pk, sk) != 0) { printf("crypto_sign_keypair() failure\n"); }