mirror of
https://github.com/saymrwulf/risc0-curve25519-dalek-source.git
synced 2026-09-04 20:03:40 +00:00
Document that ReusableSecret is preferrable for Noise protocols.
This commit is contained in:
parent
588e48f8f2
commit
edb9ec984e
1 changed files with 4 additions and 9 deletions
|
|
@ -102,6 +102,10 @@ impl<'a> From<&'a EphemeralSecret> for PublicKey {
|
|||
/// Diffie-Hellman operation multiple times throughout the protocol, while the
|
||||
/// protocol run at a higher level is only conducted once per key.
|
||||
///
|
||||
/// Similarly to [`EphemeralSecret`], this type does _not_ have serialisation
|
||||
/// methods, in order to discourage long-term usage of secret key material. (For
|
||||
/// long-term secret keys, see [`StaticSecret`].)
|
||||
///
|
||||
/// # Warning
|
||||
///
|
||||
/// If you're uncertain about whether you should use this, then you likely
|
||||
|
|
@ -147,15 +151,6 @@ impl<'a> From<&'a ReusableSecret> for PublicKey {
|
|||
/// serialization methods to save and load key material. This means that the secret may be used
|
||||
/// multiple times (but does not *have to be*).
|
||||
///
|
||||
/// Some protocols, such as Noise, already handle the static/ephemeral distinction, so the
|
||||
/// additional guarantees provided by [`EphemeralSecret`] are not helpful or would cause duplicate
|
||||
/// code paths. In this case, it may be useful to
|
||||
/// ```rust,ignore
|
||||
/// use x25519_dalek::StaticSecret as SecretKey;
|
||||
/// ```
|
||||
/// since the only difference between the two is that [`StaticSecret`] does not enforce at
|
||||
/// compile-time that the key is only used once.
|
||||
///
|
||||
/// # Warning
|
||||
///
|
||||
/// If you're uncertain about whether you should use this, then you likely
|
||||
|
|
|
|||
Loading…
Reference in a new issue