mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
Clarify that ed25519.generateDeterministic() can be used outside tests
Fixes #22946
This commit is contained in:
parent
d0e288ab18
commit
541d54a37d
1 changed files with 3 additions and 2 deletions
|
|
@ -247,7 +247,7 @@ pub const Ed25519 = struct {
|
|||
|
||||
/// Deterministically derive a key pair from a cryptograpically secure secret seed.
|
||||
///
|
||||
/// Except in tests, applications should generally call `generate()` instead of this function.
|
||||
/// To create a new key, applications should generally call `generate()` instead of this function.
|
||||
///
|
||||
/// As in RFC 8032, an Ed25519 public key is generated by hashing
|
||||
/// the secret key using the SHA-512 function, and interpreting the
|
||||
|
|
@ -290,7 +290,8 @@ pub const Ed25519 = struct {
|
|||
/// 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()`.
|
||||
/// `key_pair.secret_key.seed()`, and the secret key can then be
|
||||
/// recomputed using `SecretKey.generateDeterministic()`.
|
||||
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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue