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
It seems to be intentional that SecretKey does not have Eq defined for it.
But the reasoning is not part of the type documentation.
Nor was I able to find a discussion elsewhere.
There's functionality in the subtle crate for comparing the equality of two equally-sized byte arrays in constant time, if you need to check if two secret keys are the same.
Is it the case that nobody just connected the crates, to use subtle as an implementation of Eq for SecretKey?
Or is there more to it?
I think it would be nice to have an explanation. Either as an issue or directly in the doc-comment.
I would imagine, I might not be the only person looking for Eq.
The text was updated successfully, but these errors were encountered:
They return different types. ConstantTimeEq's ct_eq returns a Choice, to prevent things like the following toy example from leaking timing information by short circuiting, or through other side channels if (secret_key1 == key1) && (secret_key2 == key2) { ... }
It seems to be intentional that
SecretKey
does not haveEq
defined for it.But the reasoning is not part of the type documentation.
Nor was I able to find a discussion elsewhere.
This issue seems related: #52
It says:
Is it the case that nobody just connected the crates, to use
subtle
as an implementation ofEq
forSecretKey
?Or is there more to it?
I think it would be nice to have an explanation. Either as an issue or directly in the doc-comment.
I would imagine, I might not be the only person looking for
Eq
.The text was updated successfully, but these errors were encountered: