motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 5e4000ee692529758d7d2aab35a485bdbe4b6862 (tree)
parent 26e7d4c9a37d170896b5f5b9170ccdee077d229f
Author: Frank Denis <github@pureftpd.org>
Date:   Tue,  1 Nov 2022 07:26:32 +0100

ed25519: recommend using the seed to recover a key pair

Diffstat:
Mlib/std/crypto/25519/ed25519.zig | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/std/crypto/25519/ed25519.zig b/lib/std/crypto/25519/ed25519.zig @@ -269,6 +269,10 @@ pub const Ed25519 = struct { } /// Create a KeyPair from a secret key. + /// Note that with EdDSA, storing the seed, and recovering the key pair + /// from it is recommended over storing the entire secret key. + /// The seed of an exiting key pair can be obtained with + /// `key_pair.secret_key.seed()`. pub fn fromSecretKey(secret_key: SecretKey) (NonCanonicalError || EncodingError || IdentityElementError)!KeyPair { // It is critical for EdDSA to use the correct public key. // In order to enforce this, a SecretKey implicitly includes a copy of the public key.