| ... | @@ -269,6 +269,10 @@ pub const Ed25519 = struct { | ... | @@ -269,6 +269,10 @@ pub const Ed25519 = struct { |
| 269 | } | 269 | } |
| 270 | | 270 | |
| 271 | /// Create a KeyPair from a secret key. | 271 | /// 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()`. |
| 272 | pub fn fromSecretKey(secret_key: SecretKey) (NonCanonicalError || EncodingError || IdentityElementError)!KeyPair { | 276 | pub fn fromSecretKey(secret_key: SecretKey) (NonCanonicalError || EncodingError || IdentityElementError)!KeyPair { |
| 273 | // It is critical for EdDSA to use the correct public key. | 277 | // It is critical for EdDSA to use the correct public key. |
| 274 | // In order to enforce this, a SecretKey implicitly includes a copy of the public key. | 278 | // In order to enforce this, a SecretKey implicitly includes a copy of the public key. |