At the moment (in v1.2.0) there is the to_bytes for PublicKey, StaticSecret and SharedSecret, thus allowing one to convert that key into [u8; _]. However there is also as_bytes available (allowing one to borrow the bytes and perhaps use them), but that is only available for PublicKey and SharedSecret, but not for StaticSecret.
Thus, I'm proposing to also add as_bytes to StaticSecret.
I don't think this violates in any manner the current API philosophy, because there is already to_bytes that allows exporting the underlying key.
Just for reference, there seems to be another pull request #96, similar to my own proposed one #102, although mine is perhaps simpler, just adding the as_bytes function.
At the moment (in
v1.2.0
) there is theto_bytes
forPublicKey
,StaticSecret
andSharedSecret
, thus allowing one to convert that key into[u8; _]
. However there is alsoas_bytes
available (allowing one to borrow the bytes and perhaps use them), but that is only available forPublicKey
andSharedSecret
, but not forStaticSecret
.Thus, I'm proposing to also add
as_bytes
toStaticSecret
.I don't think this violates in any manner the current API philosophy, because there is already
to_bytes
that allows exporting the underlying key.