mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
add EVP_blake2xyyy
This commit is contained in:
20
tests/api.c
20
tests/api.c
@ -45928,6 +45928,25 @@ static void test_wolfSSL_ERR_strings()
|
||||
AssertIntEQ((*err == ('\0')), 1);
|
||||
#endif
|
||||
printf(resultFmt, passed);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void test_EVP_blake2()
|
||||
{
|
||||
#if defined(OPENSSL_EXTRA)
|
||||
printf(testingFmt, "test_EVP_blake2");
|
||||
|
||||
const EVP_MD* md = NULL;
|
||||
|
||||
md = EVP_blake2b512();
|
||||
AssertTrue(md != NULL);
|
||||
AssertIntEQ(XSTRNCMP(md, "BLAKE2b512", XSTRLEN("BLAKE2b512")), 0);
|
||||
|
||||
md = EVP_blake2s256();
|
||||
AssertTrue(md != NULL);
|
||||
AssertIntEQ(XSTRNCMP(md, "BLAKE2s256", XSTRLEN("BLAKE2s256")), 0);
|
||||
|
||||
printf(resultFmt, passed);
|
||||
|
||||
#endif
|
||||
}
|
||||
@ -45952,6 +45971,7 @@ void ApiTest(void)
|
||||
test_for_double_Free();
|
||||
#endif
|
||||
test_wolfSSL_ERR_strings();
|
||||
test_EVP_blake2();
|
||||
test_wolfSSL_CTX_use_certificate_file();
|
||||
AssertIntEQ(test_wolfSSL_CTX_use_certificate_buffer(), WOLFSSL_SUCCESS);
|
||||
test_wolfSSL_CTX_use_PrivateKey_file();
|
||||
|
@ -7151,6 +7151,23 @@ int wolfSSL_EVP_PKEY_assign_DH(EVP_PKEY* pkey, WOLFSSL_DH* key)
|
||||
}
|
||||
#endif /* !NO_DH */
|
||||
|
||||
/* return EVP_MD
|
||||
* @param none
|
||||
* @return "BLAKE2b512"
|
||||
*/
|
||||
const WOLFSSL_EVP_MD* wolfSSL_EVP_blake2b512()
|
||||
{
|
||||
return (const WOLFSSL_EVP_MD*)"BLAKE2b512";
|
||||
}
|
||||
/* return EVP_MD
|
||||
* @param none
|
||||
* @return "BLAKE2s256"
|
||||
*/
|
||||
const WOLFSSL_EVP_MD* wolfSSL_EVP_blake2s256()
|
||||
{
|
||||
return (const WOLFSSL_EVP_MD*)"BLAKE2s256";
|
||||
}
|
||||
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
|
||||
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
|
||||
|
@ -414,6 +414,9 @@ WOLFSSL_API int wolfSSL_EVP_DecodeFinal(WOLFSSL_EVP_ENCODE_CTX* ctx,
|
||||
unsigned char*out, int *outl);
|
||||
#endif /* WOLFSSL_BASE64_DECODE */
|
||||
|
||||
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_blake2b512(void);
|
||||
WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_blake2s256(void);
|
||||
|
||||
typedef int WOLFSSL_ENGINE ;
|
||||
typedef WOLFSSL_ENGINE ENGINE;
|
||||
typedef WOLFSSL_EVP_PKEY_CTX EVP_PKEY_CTX;
|
||||
@ -1008,6 +1011,9 @@ typedef WOLFSSL_ASN1_PCTX ASN1_PCTX;
|
||||
#define EVP_DecodeFinal wolfSSL_EVP_DecodeFinal
|
||||
#endif /* WOLFSSL_BASE64_DECODE */
|
||||
|
||||
#define EVP_blake2b512 wolfSSL_EVP_blake2b512
|
||||
#define EVP_blake2s256 wolfSSL_EVP_blake2s256
|
||||
|
||||
WOLFSSL_API void printPKEY(WOLFSSL_EVP_PKEY *k);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Reference in New Issue
Block a user