aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/misc/tss
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/misc/tss')
-rw-r--r--src/lib/misc/tss/tss.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/misc/tss/tss.cpp b/src/lib/misc/tss/tss.cpp
index a7b0c4eac..2039e5fea 100644
--- a/src/lib/misc/tss/tss.cpp
+++ b/src/lib/misc/tss/tss.cpp
@@ -250,9 +250,12 @@ RTSS_Share::reconstruct(const std::vector<RTSS_Share>& shares)
hash->update(secret.data(), secret_len);
secure_vector<uint8_t> hash_check = hash->final();
- if(!same_mem(hash_check.data(),
- &secret[secret_len], hash->output_length()))
+ if(!constant_time_compare(hash_check.data(),
+ &secret[secret_len],
+ hash->output_length()))
+ {
throw Decoding_Error("RTSS hash check failed");
+ }
return secure_vector<uint8_t>(secret.cbegin(), secret.cbegin() + secret_len);
}