File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 7
7
#include < boost/crypt/hash/md5.hpp>
8
8
#include < boost/core/lightweight_test.hpp>
9
9
#include < string>
10
+ #include < array>
10
11
11
12
void basic_tests ()
12
13
{
@@ -71,11 +72,28 @@ void bad_input()
71
72
BOOST_TEST_EQ (message_1_result[3 ], 0x0 );
72
73
}
73
74
75
+ void test_class ()
76
+ {
77
+ boost::crypt::detail::md5 hasher;
78
+ constexpr auto msg = " The quick brown fox jumps over the lazy dog" ;
79
+ hasher.process_bytes (msg, std::strlen (msg));
80
+ std::array<std::uint32_t , 4 > message_1_result {};
81
+ hasher.get_digest (message_1_result.begin (), message_1_result.size ());
82
+
83
+ BOOST_TEST_EQ (message_1_result[0 ], 0x9e107d9d );
84
+ BOOST_TEST_EQ (message_1_result[1 ], 0x372bb682 );
85
+ BOOST_TEST_EQ (message_1_result[2 ], 0x6bd81d35 );
86
+ BOOST_TEST_EQ (message_1_result[3 ], 0x42a419d6 );
87
+ }
88
+
89
+
74
90
int main ()
75
91
{
76
92
basic_tests ();
77
93
string_test ();
78
94
bad_input ();
79
95
96
+ test_class ();
97
+
80
98
return boost::report_errors ();
81
99
}
You can’t perform that action at this time.
0 commit comments