From: Weili Qian <qianweili@huawei.com> X25519_KEYBITS (256) was used for both hardware session setup and get_params, but OpenSSL expects 253 (RFC 7748 clamps the top 3 bits of the X25519 scalar). Add a separate X25519_BITS (253) macro for get_params, keeping X25519_KEYBITS for uadk_prov_ecx_alloc_sess(). Signed-off-by: Weili Qian <qianweili@huawei.com> --- src/uadk_prov_ecx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/uadk_prov_ecx.c b/src/uadk_prov_ecx.c index 1818219..3515573 100644 --- a/src/uadk_prov_ecx.c +++ b/src/uadk_prov_ecx.c @@ -38,6 +38,7 @@ #define X25519_KEYBITS 256 #define X25519_KEYLEN 32 #define X25519_SECURITY_BITS 128 +#define X25519_BITS 253 #define ECX_POSSIBLE_SELECTIONS (OSSL_KEYMGMT_SELECT_KEYPAIR) @@ -1484,7 +1485,7 @@ static const char *uadk_keymgmt_x25519_query_operation_name(int operation_id) static int uadk_keymgmt_x25519_get_params(void *key, OSSL_PARAM params[]) { - return uadk_prov_ecx_get_params(key, params, X25519_KEYBITS, X25519_SECURITY_BITS, + return uadk_prov_ecx_get_params(key, params, X25519_BITS, X25519_SECURITY_BITS, X25519_KEYLEN); } -- 2.43.0