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 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2022-11-01 07:26:32+01:00
logddb9eac05cf8c1bc77ecd303db82fe9fa51dd118
treeff784711cefc252f76edb20d2c3955f4fc994dd2
parent9e44710fc441613a85785204808ffa579f10a093

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.