From 62f8cce22ec5250bff3d4aaa540494f06de9d7a6 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 25 Jun 2023 19:17:43 +0000 Subject: Move ECDH_size() to ech_key.c This way the public ECDH API that will remain in libcrypto is in one file and the public ECDH API that will go is in the other one. --- src/lib/libcrypto/ecdh/ech_key.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/ecdh/ech_key.c') diff --git a/src/lib/libcrypto/ecdh/ech_key.c b/src/lib/libcrypto/ecdh/ech_key.c index 5f68b01860..208a4b328e 100644 --- a/src/lib/libcrypto/ecdh/ech_key.c +++ b/src/lib/libcrypto/ecdh/ech_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ech_key.c,v 1.16 2023/06/25 19:04:35 tb Exp $ */ +/* $OpenBSD: ech_key.c,v 1.17 2023/06/25 19:17:43 tb Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -199,3 +199,9 @@ ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, ECerror(EC_R_NOT_IMPLEMENTED); return 0; } + +int +ECDH_size(const EC_KEY *d) +{ + return ((EC_GROUP_get_degree(EC_KEY_get0_group(d)) + 7) / 8); +} -- cgit v1.2.3-55-g6feb