authorgravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2022-11-01 07:26:32+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-11-02 14:09:24-07:00
log5e4000ee692529758d7d2aab35a485bdbe4b6862
tree45a10399c3cfffa0d9175c384f2dc77158bbfa85
parent26e7d4c9a37d170896b5f5b9170ccdee077d229f

ed25519: recommend using the seed to recover a key pair


1 files changed, 4 insertions(+), 0 deletions(-)

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