mbedtls_ecjpake_setup() function
Set up an ECJPAKE context for use.
Arguments
ctx
The ECJPAKE context to set up. This must be initialized.
role
The role of the caller. This must be either #MBEDTLS_ECJPAKE_CLIENT or #MBEDTLS_ECJPAKE_SERVER.
hash
The identifier of the hash function to use, for example #MBEDTLS_MD_SHA256.
curve
The identifier of the elliptic curve to use, for example #MBEDTLS_ECP_DP_SECP256R1.
secret
The pre-shared secret (passphrase). This must be a readable not empty buffer of length \p len Bytes. It need only be valid for the duration of this call.
len
The length of the pre-shared secret \p secret.
Return value
\c 0 if successful. A negative error code on failure.
Notes
Currently the only values for hash/curve allowed by the standard are #MBEDTLS_MD_SHA256/#MBEDTLS_ECP_DP_SECP256R1.
mbedtls_ecjpake_setup() is called by 3 functions and calls 4 functions:
![]()
mbedtls_ecjpake_setup()
mbedtls_ecjpake_setup() reads 2 variables and writes 2 variables:
![]()
mbedtls_ecjpake_setup()