You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
new(), diffie_hellman(), pubkey computation etc. are all the same. This leads to a bit of an awkward use of the API downstream, as e.g. noise-rust-crypto is basically picking one of the two types arbitrarily to perform diffie hellman, or to compute a pubkey.
It would be great to have a `SecretKey`` that implements all those things, and have the two special secret types just wrap it.
The text was updated successfully, but these errors were encountered:
Hmm, an EphemeralSecret is just a StaticSecret where the compiler enforces at compile-time that the key is only used once. If you don't want to have two code paths, this means that you're OK with relaxing this compile-time verification. So it seems like an alternate solution would be to do
type SecretKey = x25519_dalek::StaticSecret;
and use that SecretKey type for both static and ephemeral keys. Would that work?
Maybe, maybe not! I think that for a known protocol like Noise that already handles the static/ephemeral distinction, it may not be helpful to have two code paths with two different types. If it's not, you can use the type alias as above, but if it is, you can have two code paths.
new()
,diffie_hellman()
, pubkey computation etc. are all the same. This leads to a bit of an awkward use of the API downstream, as e.g. noise-rust-crypto is basically picking one of the two types arbitrarily to perform diffie hellman, or to compute a pubkey.It would be great to have a `SecretKey`` that implements all those things, and have the two special secret types just wrap it.
The text was updated successfully, but these errors were encountered: