Coverage Report

Created: 2020-02-14 15:38

/src/botan/src/lib/hash/rmd160/rmd160.cpp
Line
Count
Source (jump to first uncovered line)
1
/*
2
* RIPEMD-160
3
* (C) 1999-2007 Jack Lloyd
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7
8
#include <botan/rmd160.h>
9
#include <botan/loadstor.h>
10
#include <botan/rotate.h>
11
12
namespace Botan {
13
14
std::unique_ptr<HashFunction> RIPEMD_160::copy_state() const
15
0
   {
16
0
   return std::unique_ptr<HashFunction>(new RIPEMD_160(*this));
17
0
   }
18
19
namespace {
20
21
/*
22
* RIPEMD-160 F1 Function
23
*/
24
template<size_t S>
25
inline void F1(uint32_t& A, uint32_t B, uint32_t& C, uint32_t D, uint32_t E,
26
               uint32_t M)
27
0
   {
28
0
   A += (B ^ C ^ D) + M;
29
0
   A  = rotl<S>(A) + E;
30
0
   C  = rotl<10>(C);
31
0
   }
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F1<11ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F1<14ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F1<15ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F1<12ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F1<5ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F1<8ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F1<7ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F1<9ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F1<13ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F1<6ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
32
33
/*
34
* RIPEMD-160 F2 Function
35
*/
36
template<size_t S>
37
inline void F2(uint32_t& A, uint32_t B, uint32_t& C, uint32_t D, uint32_t E,
38
               uint32_t M)
39
0
   {
40
0
   A += (D ^ (B & (C ^ D))) + M;
41
0
   A  = rotl<S>(A) + E;
42
0
   C  = rotl<10>(C);
43
0
   }
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F2<7ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F2<6ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F2<8ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F2<13ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F2<11ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F2<9ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F2<15ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F2<12ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F2<5ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F2<14ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
44
45
/*
46
* RIPEMD-160 F3 Function
47
*/
48
template<size_t S>
49
inline void F3(uint32_t& A, uint32_t B, uint32_t& C, uint32_t D, uint32_t E,
50
               uint32_t M)
51
0
   {
52
0
   A += (D ^ (B | ~C)) + M;
53
0
   A  = rotl<S>(A) + E;
54
0
   C  = rotl<10>(C);
55
0
   }
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F3<11ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F3<9ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F3<13ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F3<7ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F3<6ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F3<15ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F3<14ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F3<8ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F3<12ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F3<5ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
56
57
/*
58
* RIPEMD-160 F4 Function
59
*/
60
template<size_t S>
61
inline void F4(uint32_t& A, uint32_t B, uint32_t& C, uint32_t D, uint32_t E,
62
               uint32_t M)
63
0
   {
64
0
   A += (C ^ (D & (B ^ C))) + M;
65
0
   A  = rotl<S>(A) + E;
66
0
   C  = rotl<10>(C);
67
0
   }
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F4<9ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F4<13ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F4<15ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F4<7ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F4<12ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F4<8ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F4<11ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F4<6ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F4<14ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F4<5ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
68
69
/*
70
* RIPEMD-160 F5 Function
71
*/
72
template<size_t S>
73
inline void F5(uint32_t& A, uint32_t B, uint32_t& C, uint32_t D, uint32_t E,
74
               uint32_t M)
75
0
   {
76
0
   A += (B ^ (C | ~D)) + M;
77
0
   A  = rotl<S>(A) + E;
78
0
   C  = rotl<10>(C);
79
0
   }
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F5<8ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F5<9ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F5<11ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F5<13ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F5<15ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F5<5ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F5<7ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F5<14ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F5<12ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: rmd160.cpp:void Botan::(anonymous namespace)::F5<6ul>(unsigned int&, unsigned int, unsigned int&, unsigned int, unsigned int, unsigned int)
80
81
}
82
83
/*
84
* RIPEMD-160 Compression Function
85
*/
86
void RIPEMD_160::compress_n(const uint8_t input[], size_t blocks)
87
0
   {
88
0
   const uint32_t MAGIC2 = 0x5A827999, MAGIC3 = 0x6ED9EBA1,
89
0
                  MAGIC4 = 0x8F1BBCDC, MAGIC5 = 0xA953FD4E,
90
0
                  MAGIC6 = 0x50A28BE6, MAGIC7 = 0x5C4DD124,
91
0
                  MAGIC8 = 0x6D703EF3, MAGIC9 = 0x7A6D76E9;
92
0
93
0
   for(size_t i = 0; i != blocks; ++i)
94
0
      {
95
0
      load_le(m_M.data(), input, m_M.size());
96
0
97
0
      uint32_t A1 = m_digest[0], A2 = A1,
98
0
               B1 = m_digest[1], B2 = B1,
99
0
               C1 = m_digest[2], C2 = C1,
100
0
               D1 = m_digest[3], D2 = D1,
101
0
               E1 = m_digest[4], E2 = E1;
102
0
103
0
      F1<11>(A1,B1,C1,D1,E1,m_M[ 0]       );  F5< 8>(A2,B2,C2,D2,E2,m_M[ 5]+MAGIC6);
104
0
      F1<14>(E1,A1,B1,C1,D1,m_M[ 1]       );  F5< 9>(E2,A2,B2,C2,D2,m_M[14]+MAGIC6);
105
0
      F1<15>(D1,E1,A1,B1,C1,m_M[ 2]       );  F5< 9>(D2,E2,A2,B2,C2,m_M[ 7]+MAGIC6);
106
0
      F1<12>(C1,D1,E1,A1,B1,m_M[ 3]       );  F5<11>(C2,D2,E2,A2,B2,m_M[ 0]+MAGIC6);
107
0
      F1< 5>(B1,C1,D1,E1,A1,m_M[ 4]       );  F5<13>(B2,C2,D2,E2,A2,m_M[ 9]+MAGIC6);
108
0
      F1< 8>(A1,B1,C1,D1,E1,m_M[ 5]       );  F5<15>(A2,B2,C2,D2,E2,m_M[ 2]+MAGIC6);
109
0
      F1< 7>(E1,A1,B1,C1,D1,m_M[ 6]       );  F5<15>(E2,A2,B2,C2,D2,m_M[11]+MAGIC6);
110
0
      F1< 9>(D1,E1,A1,B1,C1,m_M[ 7]       );  F5< 5>(D2,E2,A2,B2,C2,m_M[ 4]+MAGIC6);
111
0
      F1<11>(C1,D1,E1,A1,B1,m_M[ 8]       );  F5< 7>(C2,D2,E2,A2,B2,m_M[13]+MAGIC6);
112
0
      F1<13>(B1,C1,D1,E1,A1,m_M[ 9]       );  F5< 7>(B2,C2,D2,E2,A2,m_M[ 6]+MAGIC6);
113
0
      F1<14>(A1,B1,C1,D1,E1,m_M[10]       );  F5< 8>(A2,B2,C2,D2,E2,m_M[15]+MAGIC6);
114
0
      F1<15>(E1,A1,B1,C1,D1,m_M[11]       );  F5<11>(E2,A2,B2,C2,D2,m_M[ 8]+MAGIC6);
115
0
      F1< 6>(D1,E1,A1,B1,C1,m_M[12]       );  F5<14>(D2,E2,A2,B2,C2,m_M[ 1]+MAGIC6);
116
0
      F1< 7>(C1,D1,E1,A1,B1,m_M[13]       );  F5<14>(C2,D2,E2,A2,B2,m_M[10]+MAGIC6);
117
0
      F1< 9>(B1,C1,D1,E1,A1,m_M[14]       );  F5<12>(B2,C2,D2,E2,A2,m_M[ 3]+MAGIC6);
118
0
      F1< 8>(A1,B1,C1,D1,E1,m_M[15]       );  F5< 6>(A2,B2,C2,D2,E2,m_M[12]+MAGIC6);
119
0
120
0
      F2< 7>(E1,A1,B1,C1,D1,m_M[ 7]+MAGIC2);  F4< 9>(E2,A2,B2,C2,D2,m_M[ 6]+MAGIC7);
121
0
      F2< 6>(D1,E1,A1,B1,C1,m_M[ 4]+MAGIC2);  F4<13>(D2,E2,A2,B2,C2,m_M[11]+MAGIC7);
122
0
      F2< 8>(C1,D1,E1,A1,B1,m_M[13]+MAGIC2);  F4<15>(C2,D2,E2,A2,B2,m_M[ 3]+MAGIC7);
123
0
      F2<13>(B1,C1,D1,E1,A1,m_M[ 1]+MAGIC2);  F4< 7>(B2,C2,D2,E2,A2,m_M[ 7]+MAGIC7);
124
0
      F2<11>(A1,B1,C1,D1,E1,m_M[10]+MAGIC2);  F4<12>(A2,B2,C2,D2,E2,m_M[ 0]+MAGIC7);
125
0
      F2< 9>(E1,A1,B1,C1,D1,m_M[ 6]+MAGIC2);  F4< 8>(E2,A2,B2,C2,D2,m_M[13]+MAGIC7);
126
0
      F2< 7>(D1,E1,A1,B1,C1,m_M[15]+MAGIC2);  F4< 9>(D2,E2,A2,B2,C2,m_M[ 5]+MAGIC7);
127
0
      F2<15>(C1,D1,E1,A1,B1,m_M[ 3]+MAGIC2);  F4<11>(C2,D2,E2,A2,B2,m_M[10]+MAGIC7);
128
0
      F2< 7>(B1,C1,D1,E1,A1,m_M[12]+MAGIC2);  F4< 7>(B2,C2,D2,E2,A2,m_M[14]+MAGIC7);
129
0
      F2<12>(A1,B1,C1,D1,E1,m_M[ 0]+MAGIC2);  F4< 7>(A2,B2,C2,D2,E2,m_M[15]+MAGIC7);
130
0
      F2<15>(E1,A1,B1,C1,D1,m_M[ 9]+MAGIC2);  F4<12>(E2,A2,B2,C2,D2,m_M[ 8]+MAGIC7);
131
0
      F2< 9>(D1,E1,A1,B1,C1,m_M[ 5]+MAGIC2);  F4< 7>(D2,E2,A2,B2,C2,m_M[12]+MAGIC7);
132
0
      F2<11>(C1,D1,E1,A1,B1,m_M[ 2]+MAGIC2);  F4< 6>(C2,D2,E2,A2,B2,m_M[ 4]+MAGIC7);
133
0
      F2< 7>(B1,C1,D1,E1,A1,m_M[14]+MAGIC2);  F4<15>(B2,C2,D2,E2,A2,m_M[ 9]+MAGIC7);
134
0
      F2<13>(A1,B1,C1,D1,E1,m_M[11]+MAGIC2);  F4<13>(A2,B2,C2,D2,E2,m_M[ 1]+MAGIC7);
135
0
      F2<12>(E1,A1,B1,C1,D1,m_M[ 8]+MAGIC2);  F4<11>(E2,A2,B2,C2,D2,m_M[ 2]+MAGIC7);
136
0
137
0
      F3<11>(D1,E1,A1,B1,C1,m_M[ 3]+MAGIC3);  F3< 9>(D2,E2,A2,B2,C2,m_M[15]+MAGIC8);
138
0
      F3<13>(C1,D1,E1,A1,B1,m_M[10]+MAGIC3);  F3< 7>(C2,D2,E2,A2,B2,m_M[ 5]+MAGIC8);
139
0
      F3< 6>(B1,C1,D1,E1,A1,m_M[14]+MAGIC3);  F3<15>(B2,C2,D2,E2,A2,m_M[ 1]+MAGIC8);
140
0
      F3< 7>(A1,B1,C1,D1,E1,m_M[ 4]+MAGIC3);  F3<11>(A2,B2,C2,D2,E2,m_M[ 3]+MAGIC8);
141
0
      F3<14>(E1,A1,B1,C1,D1,m_M[ 9]+MAGIC3);  F3< 8>(E2,A2,B2,C2,D2,m_M[ 7]+MAGIC8);
142
0
      F3< 9>(D1,E1,A1,B1,C1,m_M[15]+MAGIC3);  F3< 6>(D2,E2,A2,B2,C2,m_M[14]+MAGIC8);
143
0
      F3<13>(C1,D1,E1,A1,B1,m_M[ 8]+MAGIC3);  F3< 6>(C2,D2,E2,A2,B2,m_M[ 6]+MAGIC8);
144
0
      F3<15>(B1,C1,D1,E1,A1,m_M[ 1]+MAGIC3);  F3<14>(B2,C2,D2,E2,A2,m_M[ 9]+MAGIC8);
145
0
      F3<14>(A1,B1,C1,D1,E1,m_M[ 2]+MAGIC3);  F3<12>(A2,B2,C2,D2,E2,m_M[11]+MAGIC8);
146
0
      F3< 8>(E1,A1,B1,C1,D1,m_M[ 7]+MAGIC3);  F3<13>(E2,A2,B2,C2,D2,m_M[ 8]+MAGIC8);
147
0
      F3<13>(D1,E1,A1,B1,C1,m_M[ 0]+MAGIC3);  F3< 5>(D2,E2,A2,B2,C2,m_M[12]+MAGIC8);
148
0
      F3< 6>(C1,D1,E1,A1,B1,m_M[ 6]+MAGIC3);  F3<14>(C2,D2,E2,A2,B2,m_M[ 2]+MAGIC8);
149
0
      F3< 5>(B1,C1,D1,E1,A1,m_M[13]+MAGIC3);  F3<13>(B2,C2,D2,E2,A2,m_M[10]+MAGIC8);
150
0
      F3<12>(A1,B1,C1,D1,E1,m_M[11]+MAGIC3);  F3<13>(A2,B2,C2,D2,E2,m_M[ 0]+MAGIC8);
151
0
      F3< 7>(E1,A1,B1,C1,D1,m_M[ 5]+MAGIC3);  F3< 7>(E2,A2,B2,C2,D2,m_M[ 4]+MAGIC8);
152
0
      F3< 5>(D1,E1,A1,B1,C1,m_M[12]+MAGIC3);  F3< 5>(D2,E2,A2,B2,C2,m_M[13]+MAGIC8);
153
0
154
0
      F4<11>(C1,D1,E1,A1,B1,m_M[ 1]+MAGIC4);  F2<15>(C2,D2,E2,A2,B2,m_M[ 8]+MAGIC9);
155
0
      F4<12>(B1,C1,D1,E1,A1,m_M[ 9]+MAGIC4);  F2< 5>(B2,C2,D2,E2,A2,m_M[ 6]+MAGIC9);
156
0
      F4<14>(A1,B1,C1,D1,E1,m_M[11]+MAGIC4);  F2< 8>(A2,B2,C2,D2,E2,m_M[ 4]+MAGIC9);
157
0
      F4<15>(E1,A1,B1,C1,D1,m_M[10]+MAGIC4);  F2<11>(E2,A2,B2,C2,D2,m_M[ 1]+MAGIC9);
158
0
      F4<14>(D1,E1,A1,B1,C1,m_M[ 0]+MAGIC4);  F2<14>(D2,E2,A2,B2,C2,m_M[ 3]+MAGIC9);
159
0
      F4<15>(C1,D1,E1,A1,B1,m_M[ 8]+MAGIC4);  F2<14>(C2,D2,E2,A2,B2,m_M[11]+MAGIC9);
160
0
      F4< 9>(B1,C1,D1,E1,A1,m_M[12]+MAGIC4);  F2< 6>(B2,C2,D2,E2,A2,m_M[15]+MAGIC9);
161
0
      F4< 8>(A1,B1,C1,D1,E1,m_M[ 4]+MAGIC4);  F2<14>(A2,B2,C2,D2,E2,m_M[ 0]+MAGIC9);
162
0
      F4< 9>(E1,A1,B1,C1,D1,m_M[13]+MAGIC4);  F2< 6>(E2,A2,B2,C2,D2,m_M[ 5]+MAGIC9);
163
0
      F4<14>(D1,E1,A1,B1,C1,m_M[ 3]+MAGIC4);  F2< 9>(D2,E2,A2,B2,C2,m_M[12]+MAGIC9);
164
0
      F4< 5>(C1,D1,E1,A1,B1,m_M[ 7]+MAGIC4);  F2<12>(C2,D2,E2,A2,B2,m_M[ 2]+MAGIC9);
165
0
      F4< 6>(B1,C1,D1,E1,A1,m_M[15]+MAGIC4);  F2< 9>(B2,C2,D2,E2,A2,m_M[13]+MAGIC9);
166
0
      F4< 8>(A1,B1,C1,D1,E1,m_M[14]+MAGIC4);  F2<12>(A2,B2,C2,D2,E2,m_M[ 9]+MAGIC9);
167
0
      F4< 6>(E1,A1,B1,C1,D1,m_M[ 5]+MAGIC4);  F2< 5>(E2,A2,B2,C2,D2,m_M[ 7]+MAGIC9);
168
0
      F4< 5>(D1,E1,A1,B1,C1,m_M[ 6]+MAGIC4);  F2<15>(D2,E2,A2,B2,C2,m_M[10]+MAGIC9);
169
0
      F4<12>(C1,D1,E1,A1,B1,m_M[ 2]+MAGIC4);  F2< 8>(C2,D2,E2,A2,B2,m_M[14]+MAGIC9);
170
0
171
0
      F5< 9>(B1,C1,D1,E1,A1,m_M[ 4]+MAGIC5);  F1< 8>(B2,C2,D2,E2,A2,m_M[12]       );
172
0
      F5<15>(A1,B1,C1,D1,E1,m_M[ 0]+MAGIC5);  F1< 5>(A2,B2,C2,D2,E2,m_M[15]       );
173
0
      F5< 5>(E1,A1,B1,C1,D1,m_M[ 5]+MAGIC5);  F1<12>(E2,A2,B2,C2,D2,m_M[10]       );
174
0
      F5<11>(D1,E1,A1,B1,C1,m_M[ 9]+MAGIC5);  F1< 9>(D2,E2,A2,B2,C2,m_M[ 4]       );
175
0
      F5< 6>(C1,D1,E1,A1,B1,m_M[ 7]+MAGIC5);  F1<12>(C2,D2,E2,A2,B2,m_M[ 1]       );
176
0
      F5< 8>(B1,C1,D1,E1,A1,m_M[12]+MAGIC5);  F1< 5>(B2,C2,D2,E2,A2,m_M[ 5]       );
177
0
      F5<13>(A1,B1,C1,D1,E1,m_M[ 2]+MAGIC5);  F1<14>(A2,B2,C2,D2,E2,m_M[ 8]       );
178
0
      F5<12>(E1,A1,B1,C1,D1,m_M[10]+MAGIC5);  F1< 6>(E2,A2,B2,C2,D2,m_M[ 7]       );
179
0
      F5< 5>(D1,E1,A1,B1,C1,m_M[14]+MAGIC5);  F1< 8>(D2,E2,A2,B2,C2,m_M[ 6]       );
180
0
      F5<12>(C1,D1,E1,A1,B1,m_M[ 1]+MAGIC5);  F1<13>(C2,D2,E2,A2,B2,m_M[ 2]       );
181
0
      F5<13>(B1,C1,D1,E1,A1,m_M[ 3]+MAGIC5);  F1< 6>(B2,C2,D2,E2,A2,m_M[13]       );
182
0
      F5<14>(A1,B1,C1,D1,E1,m_M[ 8]+MAGIC5);  F1< 5>(A2,B2,C2,D2,E2,m_M[14]       );
183
0
      F5<11>(E1,A1,B1,C1,D1,m_M[11]+MAGIC5);  F1<15>(E2,A2,B2,C2,D2,m_M[ 0]       );
184
0
      F5< 8>(D1,E1,A1,B1,C1,m_M[ 6]+MAGIC5);  F1<13>(D2,E2,A2,B2,C2,m_M[ 3]       );
185
0
      F5< 5>(C1,D1,E1,A1,B1,m_M[15]+MAGIC5);  F1<11>(C2,D2,E2,A2,B2,m_M[ 9]       );
186
0
      F5< 6>(B1,C1,D1,E1,A1,m_M[13]+MAGIC5);  F1<11>(B2,C2,D2,E2,A2,m_M[11]       );
187
0
188
0
      C1          = m_digest[1] + C1 + D2;
189
0
      m_digest[1] = m_digest[2] + D1 + E2;
190
0
      m_digest[2] = m_digest[3] + E1 + A2;
191
0
      m_digest[3] = m_digest[4] + A1 + B2;
192
0
      m_digest[4] = m_digest[0] + B1 + C2;
193
0
      m_digest[0] = C1;
194
0
195
0
      input += hash_block_size();
196
0
      }
197
0
   }
198
199
/*
200
* Copy out the digest
201
*/
202
void RIPEMD_160::copy_out(uint8_t output[])
203
0
   {
204
0
   copy_out_vec_le(output, output_length(), m_digest);
205
0
   }
206
207
/*
208
* Clear memory of sensitive data
209
*/
210
void RIPEMD_160::clear()
211
0
   {
212
0
   MDx_HashFunction::clear();
213
0
   zeroise(m_M);
214
0
   m_digest[0] = 0x67452301;
215
0
   m_digest[1] = 0xEFCDAB89;
216
0
   m_digest[2] = 0x98BADCFE;
217
0
   m_digest[3] = 0x10325476;
218
0
   m_digest[4] = 0xC3D2E1F0;
219
0
   }
220
221
}