11
11
#include < test/util/setup_common.h>
12
12
#include < util/strencodings.h>
13
13
14
+ #include < algorithm>
14
15
#include < array>
15
16
#include < cstddef>
16
17
#include < cstdint>
@@ -62,9 +63,9 @@ void TestBIP324PacketVector(
62
63
BOOST_CHECK (cipher);
63
64
64
65
// Compare session variables.
65
- BOOST_CHECK (Span{ out_session_id} == cipher.GetSessionID ());
66
- BOOST_CHECK (Span{ mid_send_garbage} == cipher.GetSendGarbageTerminator ());
67
- BOOST_CHECK (Span{ mid_recv_garbage} == cipher.GetReceiveGarbageTerminator ());
66
+ BOOST_CHECK (std::ranges::equal ( out_session_id, cipher.GetSessionID () ));
67
+ BOOST_CHECK (std::ranges::equal ( mid_send_garbage, cipher.GetSendGarbageTerminator () ));
68
+ BOOST_CHECK (std::ranges::equal ( mid_recv_garbage, cipher.GetReceiveGarbageTerminator () ));
68
69
69
70
// Vector of encrypted empty messages, encrypted in order to seek to the right position.
70
71
std::vector<std::vector<std::byte>> dummies (in_idx);
@@ -89,7 +90,7 @@ void TestBIP324PacketVector(
89
90
BOOST_CHECK (out_ciphertext == ciphertext);
90
91
} else {
91
92
BOOST_CHECK (ciphertext.size () >= out_ciphertext_endswith.size ());
92
- BOOST_CHECK (Span{ out_ciphertext_endswith} == Span{ciphertext}.last (out_ciphertext_endswith.size ()));
93
+ BOOST_CHECK (std::ranges::equal ( out_ciphertext_endswith, Span{ciphertext}.last (out_ciphertext_endswith.size () )));
93
94
}
94
95
95
96
for (unsigned error = 0 ; error <= 12 ; ++error) {
@@ -109,9 +110,9 @@ void TestBIP324PacketVector(
109
110
BOOST_CHECK (dec_cipher);
110
111
111
112
// Compare session variables.
112
- BOOST_CHECK ((Span{ out_session_id} == dec_cipher.GetSessionID ()) == (error != 1 ));
113
- BOOST_CHECK ((Span{ mid_send_garbage} == dec_cipher.GetSendGarbageTerminator ()) == (error != 1 ));
114
- BOOST_CHECK ((Span{ mid_recv_garbage} == dec_cipher.GetReceiveGarbageTerminator ()) == (error != 1 ));
113
+ BOOST_CHECK (std::ranges::equal ( out_session_id, dec_cipher.GetSessionID ()) == (error != 1 ));
114
+ BOOST_CHECK (std::ranges::equal ( mid_send_garbage, dec_cipher.GetSendGarbageTerminator ()) == (error != 1 ));
115
+ BOOST_CHECK (std::ranges::equal ( mid_recv_garbage, dec_cipher.GetReceiveGarbageTerminator ()) == (error != 1 ));
115
116
116
117
// Seek to the numbered packet.
117
118
if (in_idx == 0 && error == 12 ) continue ;
0 commit comments