From ab3ec570303cab596f4d663d61e0b5321a4292c3 Mon Sep 17 00:00:00 2001 From: jsing Date: Wed, 9 Nov 2022 17:45:55 +0000 Subject: [PATCH] Make X25519_public_from_private() internally reachable. --- lib/libcrypto/curve25519/curve25519.c | 8 ++++---- lib/libcrypto/curve25519/curve25519_internal.h | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/libcrypto/curve25519/curve25519.c b/lib/libcrypto/curve25519/curve25519.c index 2618e1a3e7c..c35863ef87a 100644 --- a/lib/libcrypto/curve25519/curve25519.c +++ b/lib/libcrypto/curve25519/curve25519.c @@ -1,4 +1,4 @@ -/* $OpenBSD: curve25519.c,v 1.12 2022/11/09 17:40:51 jsing Exp $ */ +/* $OpenBSD: curve25519.c,v 1.13 2022/11/09 17:45:55 jsing Exp $ */ /* * Copyright (c) 2015, Google Inc. * @@ -4866,8 +4866,8 @@ x25519_public_from_private_generic(uint8_t out_public_key[32], #endif void -x25519_public_from_private(uint8_t out_public_key[32], - const uint8_t private_key[32]) +X25519_public_from_private(uint8_t out_public_key[X25519_KEY_LENGTH], + const uint8_t private_key[X25519_KEY_LENGTH]) { static const uint8_t kMongomeryBasePoint[32] = {9}; @@ -4897,7 +4897,7 @@ X25519_keypair(uint8_t out_public_key[X25519_KEY_LENGTH], out_private_key[31] &= 63; out_private_key[31] |= 128; - x25519_public_from_private(out_public_key, out_private_key); + X25519_public_from_private(out_public_key, out_private_key); } int diff --git a/lib/libcrypto/curve25519/curve25519_internal.h b/lib/libcrypto/curve25519/curve25519_internal.h index 0a987816512..abfaaaf52b7 100644 --- a/lib/libcrypto/curve25519/curve25519_internal.h +++ b/lib/libcrypto/curve25519/curve25519_internal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: curve25519_internal.h,v 1.5 2022/11/09 17:39:29 jsing Exp $ */ +/* $OpenBSD: curve25519_internal.h,v 1.6 2022/11/09 17:45:55 jsing Exp $ */ /* * Copyright (c) 2015, Google Inc. * @@ -97,6 +97,9 @@ void x25519_scalar_mult_generic(uint8_t out[32], const uint8_t scalar[32], void ED25519_public_from_private(uint8_t out_public_key[32], const uint8_t private_key[32]); +void X25519_public_from_private(uint8_t out_public_key[32], + const uint8_t private_key[32]); + __END_HIDDEN_DECLS #endif /* HEADER_CURVE25519_INTERNAL_H */ -- 2.20.1