From 694ea772ceaba6fc169fd7cc922697e7d380f50f Mon Sep 17 00:00:00 2001 From: David Palm Date: Thu, 22 Aug 2024 11:59:44 +0200 Subject: [PATCH] Make `Choice` and `CtOption` be `Hash` --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b6e42c4..839aabd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -116,7 +116,7 @@ use core::hint::black_box; /// /// [rust-timing-shield]: /// https://www.chosenplaintext.ca/open-source/rust-timing-shield/security -#[derive(Copy, Clone, Debug)] +#[derive(Copy, Clone, Debug, Hash)] pub struct Choice(u8); impl Choice { @@ -642,7 +642,7 @@ where /// from these functions makes it difficult for the caller to reason /// about the result in constant time, and returning an incorrect /// value burdens the caller and increases the chance of bugs. -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, Hash)] pub struct CtOption { value: T, is_some: Choice,