summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2022-11-09 17:45:55 +0000
committerjsing <>2022-11-09 17:45:55 +0000
commitdd0d13fab9d0e821943537de1c73526273de215e (patch)
treee76aa3722ce7f15e986778b12b086e55334ed4c5
parentb20429423f8d9e40cd60842bbbb5fa6cb9281287 (diff)
downloadopenbsd-dd0d13fab9d0e821943537de1c73526273de215e.tar.gz
openbsd-dd0d13fab9d0e821943537de1c73526273de215e.tar.bz2
openbsd-dd0d13fab9d0e821943537de1c73526273de215e.zip
Make X25519_public_from_private() internally reachable.
-rw-r--r--src/lib/libcrypto/curve25519/curve25519.c8
-rw-r--r--src/lib/libcrypto/curve25519/curve25519_internal.h5
2 files changed, 8 insertions, 5 deletions
diff --git a/src/lib/libcrypto/curve25519/curve25519.c b/src/lib/libcrypto/curve25519/curve25519.c
index 2618e1a3e7..c35863ef87 100644
--- a/src/lib/libcrypto/curve25519/curve25519.c
+++ b/src/lib/libcrypto/curve25519/curve25519.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: curve25519.c,v 1.12 2022/11/09 17:40:51 jsing Exp $ */ 1/* $OpenBSD: curve25519.c,v 1.13 2022/11/09 17:45:55 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2015, Google Inc. 3 * Copyright (c) 2015, Google Inc.
4 * 4 *
@@ -4866,8 +4866,8 @@ x25519_public_from_private_generic(uint8_t out_public_key[32],
4866#endif 4866#endif
4867 4867
4868void 4868void
4869x25519_public_from_private(uint8_t out_public_key[32], 4869X25519_public_from_private(uint8_t out_public_key[X25519_KEY_LENGTH],
4870 const uint8_t private_key[32]) 4870 const uint8_t private_key[X25519_KEY_LENGTH])
4871{ 4871{
4872 static const uint8_t kMongomeryBasePoint[32] = {9}; 4872 static const uint8_t kMongomeryBasePoint[32] = {9};
4873 4873
@@ -4897,7 +4897,7 @@ X25519_keypair(uint8_t out_public_key[X25519_KEY_LENGTH],
4897 out_private_key[31] &= 63; 4897 out_private_key[31] &= 63;
4898 out_private_key[31] |= 128; 4898 out_private_key[31] |= 128;
4899 4899
4900 x25519_public_from_private(out_public_key, out_private_key); 4900 X25519_public_from_private(out_public_key, out_private_key);
4901} 4901}
4902 4902
4903int 4903int
diff --git a/src/lib/libcrypto/curve25519/curve25519_internal.h b/src/lib/libcrypto/curve25519/curve25519_internal.h
index 0a98781651..abfaaaf52b 100644
--- a/src/lib/libcrypto/curve25519/curve25519_internal.h
+++ b/src/lib/libcrypto/curve25519/curve25519_internal.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: curve25519_internal.h,v 1.5 2022/11/09 17:39:29 jsing Exp $ */ 1/* $OpenBSD: curve25519_internal.h,v 1.6 2022/11/09 17:45:55 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2015, Google Inc. 3 * Copyright (c) 2015, Google Inc.
4 * 4 *
@@ -97,6 +97,9 @@ void x25519_scalar_mult_generic(uint8_t out[32], const uint8_t scalar[32],
97void ED25519_public_from_private(uint8_t out_public_key[32], 97void ED25519_public_from_private(uint8_t out_public_key[32],
98 const uint8_t private_key[32]); 98 const uint8_t private_key[32]);
99 99
100void X25519_public_from_private(uint8_t out_public_key[32],
101 const uint8_t private_key[32]);
102
100__END_HIDDEN_DECLS 103__END_HIDDEN_DECLS
101 104
102#endif /* HEADER_CURVE25519_INTERNAL_H */ 105#endif /* HEADER_CURVE25519_INTERNAL_H */