Skip to content

Commit 541d54a

Browse files
jedisct1alexrp
authored andcommitted
Clarify that ed25519.generateDeterministic() can be used outside tests
Fixes #22946
1 parent d0e288a commit 541d54a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/std/crypto/25519/ed25519.zig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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.

0 commit comments

Comments
 (0)