From 83932f30ff02d285c8a7e2a363601f460d55d268 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Sat, 16 Sep 2017 14:45:52 -0400 Subject: Use constant_time_compare instead of same_mem New name, same great operation --- src/lib/misc/tss/tss.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib/misc/tss') 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& shares) hash->update(secret.data(), secret_len); secure_vector 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(secret.cbegin(), secret.cbegin() + secret_len); } -- cgit v1.2.3