mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-25 09:02:48 +00:00
test driver: add support for FFDH key agreement
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
parent
359f4625a3
commit
1702d5a1f4
@ -24,6 +24,7 @@
|
|||||||
#include "psa/crypto.h"
|
#include "psa/crypto.h"
|
||||||
#include "psa_crypto_core.h"
|
#include "psa_crypto_core.h"
|
||||||
#include "psa_crypto_ecp.h"
|
#include "psa_crypto_ecp.h"
|
||||||
|
#include "psa_crypto_ffdh.h"
|
||||||
|
|
||||||
#include "test/drivers/key_agreement.h"
|
#include "test/drivers/key_agreement.h"
|
||||||
#include "test/drivers/test_driver.h"
|
#include "test/drivers/test_driver.h"
|
||||||
@ -93,6 +94,37 @@ psa_status_t mbedtls_test_transparent_key_agreement(
|
|||||||
(void) shared_secret_size;
|
(void) shared_secret_size;
|
||||||
(void) shared_secret_length;
|
(void) shared_secret_length;
|
||||||
return PSA_ERROR_NOT_SUPPORTED;
|
return PSA_ERROR_NOT_SUPPORTED;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
if (PSA_ALG_IS_FFDH(alg)) {
|
||||||
|
#if (defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \
|
||||||
|
defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_ALG_FFDH))
|
||||||
|
return libtestdriver1_mbedtls_psa_key_agreement_ffdh(
|
||||||
|
(const libtestdriver1_psa_key_attributes_t *) attributes,
|
||||||
|
key_buffer, key_buffer_size,
|
||||||
|
alg, peer_key, peer_key_length,
|
||||||
|
shared_secret, shared_secret_size,
|
||||||
|
shared_secret_length);
|
||||||
|
#elif defined(MBEDTLS_PSA_BUILTIN_ALG_FFDH)
|
||||||
|
return mbedtls_psa_key_agreement_ffdh(
|
||||||
|
attributes,
|
||||||
|
peer_key,
|
||||||
|
peer_key_length,
|
||||||
|
key_buffer,
|
||||||
|
key_buffer_size,
|
||||||
|
shared_secret,
|
||||||
|
shared_secret_size,
|
||||||
|
shared_secret_length);
|
||||||
|
#else
|
||||||
|
(void) attributes;
|
||||||
|
(void) key_buffer;
|
||||||
|
(void) key_buffer_size;
|
||||||
|
(void) peer_key;
|
||||||
|
(void) peer_key_length;
|
||||||
|
(void) shared_secret;
|
||||||
|
(void) shared_secret_size;
|
||||||
|
(void) shared_secret_length;
|
||||||
|
return PSA_ERROR_NOT_SUPPORTED;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
return PSA_ERROR_INVALID_ARGUMENT;
|
return PSA_ERROR_INVALID_ARGUMENT;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user