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/modes/aead/chacha20poly1305/chacha20poly1305.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp') diff --git a/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp b/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp index 64169a9b8..e1fd4978c 100644 --- a/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp +++ b/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp @@ -157,7 +157,7 @@ void ChaCha20Poly1305_Decryption::finish(secure_vector& buffer, size_t m_ctext_len = 0; - if(!same_mem(mac.data(), included_tag, tag_size())) + if(!constant_time_compare(mac.data(), included_tag, tag_size())) throw Integrity_Failure("ChaCha20Poly1305 tag check failed"); buffer.resize(offset + remaining); } -- cgit v1.2.3