authorgravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2025-02-19 22:34:52+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-02-20 09:01:13+01:00
log541d54a37d7dddefdb09d5f05d38f704c95f3be4
treeb5cbd391ca598903aac9b4be4b4c438ac130056b
parentd0e288ab1856a02d0556b9ceadd6fc6337ada905

Clarify that ed25519.generateDeterministic() can be used outside tests

Fixes #22946

1 files changed, 3 insertions(+), 2 deletions(-)

lib/std/crypto/25519/ed25519.zig+3-2
......@@ -247,7 +247,7 @@ pub const Ed25519 = struct {
247247
248248 /// Deterministically derive a key pair from a cryptograpically secure secret seed.
249249 ///
250 /// Except in tests, applications should generally call `generate()` instead of this function.
250 /// To create a new key, applications should generally call `generate()` instead of this function.
251251 ///
252252 /// As in RFC 8032, an Ed25519 public key is generated by hashing
253253 /// the secret key using the SHA-512 function, and interpreting the
......@@ -290,7 +290,8 @@ pub const Ed25519 = struct {
290290 /// Note that with EdDSA, storing the seed, and recovering the key pair
291291 /// from it is recommended over storing the entire secret key.
292292 /// The seed of an exiting key pair can be obtained with
293 /// `key_pair.secret_key.seed()`.
293 /// `key_pair.secret_key.seed()`, and the secret key can then be
294 /// recomputed using `SecretKey.generateDeterministic()`.
294295 pub fn fromSecretKey(secret_key: SecretKey) (NonCanonicalError || EncodingError || IdentityElementError)!KeyPair {
295296 // It is critical for EdDSA to use the correct public key.
296297 // In order to enforce this, a SecretKey implicitly includes a copy of the public key.