We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f1f8e53 commit 534c6baCopy full SHA for 534c6ba
1 file changed
src/lib.rs
@@ -286,6 +286,16 @@ pub trait ConstantTimeEq {
286
}
287
288
289
+/// A marker trait indicating that `Eq` equality testing uses `ConstantTimeEq` under the hood.
290
+///
291
+/// Even though `Eq`-based equality testing returns a `bool`, it's a common design pattern
292
+/// to have some types implement this using `ConstantTimeEq`, and then coerce the resulting
293
+/// `Choice` into a `bool`.
294
295
+/// This marker trait should be used if and only if you do this, in order to signal this
296
+/// functionality to implementers.
297
+pub trait EqIsConstantTimeEq {}
298
+
299
impl<T: ConstantTimeEq> ConstantTimeEq for [T] {
300
/// Check whether two slices of `ConstantTimeEq` types are equal.
301
///
0 commit comments