Add tests for chacha20-poly1305 EVP integration

This commit is contained in:
Disyer
2022-07-28 17:16:34 +03:00
parent 52cc73a6a4
commit e3dd7677c8

View File

@@ -4462,6 +4462,10 @@ static int test_wolfSSL_EVP_get_cipherbynid(void)
#endif #endif
#endif /* !NO_DES3 */ #endif /* !NO_DES3 */
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
AssertNotNull(strcmp("EVP_CHACHA20_POLY13O5", EVP_get_cipherbynid(1018)));
#endif
/* test for nid is out of range */ /* test for nid is out of range */
AssertNull(wolfSSL_EVP_get_cipherbynid(1)); AssertNull(wolfSSL_EVP_get_cipherbynid(1));
@@ -45587,6 +45591,10 @@ static int test_wolfSSL_EVP_CIPHER_block_size(void)
AssertIntEQ(EVP_CIPHER_block_size(wolfSSL_EVP_rc4()), 1); AssertIntEQ(EVP_CIPHER_block_size(wolfSSL_EVP_rc4()), 1);
#endif #endif
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
AssertIntEQ(EVP_CIPHER_block_size(wolfSSL_EVP_chacha20_poly1305()), 1);
#endif
return 0; return 0;
} }
@@ -45636,6 +45644,9 @@ static int test_wolfSSL_EVP_CIPHER_iv_length(void)
NID_des_cbc, NID_des_cbc,
NID_des_ede3_cbc, NID_des_ede3_cbc,
#endif #endif
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
NID_chacha20_poly1305,
#endif
}; };
int iv_lengths[] = { int iv_lengths[] = {
@@ -45679,6 +45690,9 @@ static int test_wolfSSL_EVP_CIPHER_iv_length(void)
DES_BLOCK_SIZE, DES_BLOCK_SIZE,
DES_BLOCK_SIZE, DES_BLOCK_SIZE,
#endif #endif
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
CHACHA20_POLY1305_AEAD_IV_SIZE,
#endif
}; };
printf(testingFmt, "wolfSSL_EVP_CIPHER_iv_length"); printf(testingFmt, "wolfSSL_EVP_CIPHER_iv_length");