From c3e7a9026b73aac4ee66ddaebc969ec5aefde2a2 Mon Sep 17 00:00:00 2001 From: Yawning Angel Date: Mon, 18 May 2026 14:35:55 +0900 Subject: [PATCH] core/crypto/ed25519: Add `private_key_public_bytes` --- core/crypto/ed25519/ed25519.odin | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/crypto/ed25519/ed25519.odin b/core/crypto/ed25519/ed25519.odin index 164e9805b..9f2d2b330 100644 --- a/core/crypto/ed25519/ed25519.odin +++ b/core/crypto/ed25519/ed25519.odin @@ -120,6 +120,12 @@ private_key_bytes :: proc(priv_key: ^Private_Key, dst: []byte) { copy(dst, priv_key._b[:]) } +// private_key_public_bytes sets dst to the byte-encoding of the public +// key corresponding to priv_key. +private_key_public_bytes :: proc(priv_key: ^Private_Key, dst: []byte) { + public_key_bytes(&priv_key._pub_key, dst) +} + // private_key_clear clears priv_key to the uninitialized state. private_key_clear :: proc "contextless" (priv_key: ^Private_Key) { crypto.zero_explicit(priv_key, size_of(Private_Key))