summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2024-05-09 20:40:43 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2024-05-09 20:40:43 +0000
commit5f9ca94646410da11f514def0e5cf6c2084e74d7 (patch)
tree8398e775ae483bc4f8ccdb9db0ee4dc4885e5491 /lib
parentd949dedb5af069a3c6455086a3d5db976d8db11a (diff)
Move public API and DH_METHOD to the bottom of the file
no functional change
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/dh/dh_key.c69
1 files changed, 31 insertions, 38 deletions
diff --git a/lib/libcrypto/dh/dh_key.c b/lib/libcrypto/dh/dh_key.c
index 050d1143f8f..ea17f549892 100644
--- a/lib/libcrypto/dh/dh_key.c
+++ b/lib/libcrypto/dh/dh_key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dh_key.c,v 1.40 2023/08/03 18:53:55 tb Exp $ */
+/* $OpenBSD: dh_key.c,v 1.41 2024/05/09 20:40:42 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -65,43 +65,6 @@
#include "bn_local.h"
#include "dh_local.h"
-static int generate_key(DH *dh);
-static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
-static int dh_bn_mod_exp(const DH *dh, BIGNUM *r, const BIGNUM *a,
- const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
-static int dh_init(DH *dh);
-static int dh_finish(DH *dh);
-
-int
-DH_generate_key(DH *dh)
-{
- return dh->meth->generate_key(dh);
-}
-LCRYPTO_ALIAS(DH_generate_key);
-
-int
-DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
-{
- return dh->meth->compute_key(key, pub_key, dh);
-}
-LCRYPTO_ALIAS(DH_compute_key);
-
-static DH_METHOD dh_ossl = {
- .name = "OpenSSL DH Method",
- .generate_key = generate_key,
- .compute_key = compute_key,
- .bn_mod_exp = dh_bn_mod_exp,
- .init = dh_init,
- .finish = dh_finish,
-};
-
-const DH_METHOD *
-DH_OpenSSL(void)
-{
- return &dh_ossl;
-}
-LCRYPTO_ALIAS(DH_OpenSSL);
-
static int
generate_key(DH *dh)
{
@@ -245,3 +208,33 @@ dh_finish(DH *dh)
BN_MONT_CTX_free(dh->method_mont_p);
return 1;
}
+
+int
+DH_generate_key(DH *dh)
+{
+ return dh->meth->generate_key(dh);
+}
+LCRYPTO_ALIAS(DH_generate_key);
+
+int
+DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
+{
+ return dh->meth->compute_key(key, pub_key, dh);
+}
+LCRYPTO_ALIAS(DH_compute_key);
+
+static DH_METHOD dh_ossl = {
+ .name = "OpenSSL DH Method",
+ .generate_key = generate_key,
+ .compute_key = compute_key,
+ .bn_mod_exp = dh_bn_mod_exp,
+ .init = dh_init,
+ .finish = dh_finish,
+};
+
+const DH_METHOD *
+DH_OpenSSL(void)
+{
+ return &dh_ossl;
+}
+LCRYPTO_ALIAS(DH_OpenSSL);