OpenCores
URL https://opencores.org/ocsvn/md5_pipelined/md5_pipelined/trunk

Subversion Repositories md5_pipelined

[/] [md5_pipelined/] [trunk/] [Md5Core.v] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 JohnLeitch
/*
2
Copyright (C) 2014 John Leitch (johnleitch@outlook.com)
3
 
4
This program is free software: you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation, either version 3 of the License, or
7
(at your option) any later version.
8
 
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
GNU General Public License for more details.
13
 
14
You should have received a copy of the GNU General Public License
15
along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 4 JohnLeitch
 
17
**********************************************************************
18
 
19
This module is an unrolled and pipelined implementation of the main
20 5 JohnLeitch
loop of MD5. Instantiators input a 512-bit message chunk (wb) along
21
with four initialization values (a0, b0, c0, and d0), and the module
22
outputs the results of the 64 MD5 operations (a64, b64, c64, and d64).
23 4 JohnLeitch
 
24 5 JohnLeitch
 Note that this module performs the MD5 operations exclusively; it
25
 does not pad the message, append the length, or perform the
26
 arithmetic operations that follow the four functions.
27 4 JohnLeitch
 
28
**********************************************************************
29
 
30 3 JohnLeitch
*/
31 2 JohnLeitch
`define CopyChunkWords(__lhs, __rhs) \
32
  __lhs[0] <= __rhs[0];         \
33
  __lhs[1] <= __rhs[1];         \
34
  __lhs[2] <= __rhs[2];         \
35
  __lhs[3] <= __rhs[3];         \
36
  __lhs[4] <= __rhs[4];         \
37
  __lhs[5] <= __rhs[5];         \
38
  __lhs[6] <= __rhs[6];         \
39
  __lhs[7] <= __rhs[7];         \
40
  __lhs[8] <= __rhs[8];         \
41
  __lhs[9] <= __rhs[9];         \
42
  __lhs[10] <= __rhs[10];       \
43
  __lhs[11] <= __rhs[11];       \
44
  __lhs[12] <= __rhs[12];       \
45
  __lhs[13] <= __rhs[13];       \
46
  __lhs[14] <= __rhs[14];       \
47
  __lhs[15] <= __rhs[15];       \
48
 
49
`define CopyDigestWords(__lhs1, __rhs1, __lhs2, __rhs2, __lhs3, __rhs3) \
50
  __lhs1 <= __rhs1;                                                     \
51
  __lhs2 <= __rhs2;                                                     \
52
  __lhs3 <= __rhs3;                                                     \
53
 
54
module Md5Core (
55
  input wire clk,
56
  input wire [511:0] wb,
57
  input wire [31:0] a0,
58
  input wire [31:0] b0,
59
  input wire [31:0] c0,
60
  input wire [31:0] d0,
61
  output reg [31:0] a64,
62
  output reg [31:0] b64,
63
  output reg [31:0] c64,
64
  output reg [31:0] d64);
65
 
66
  wire [31:0] w0 [0:15];
67
  assign w0[0] = wb[31:0];
68
  assign w0[1] = wb[63:32];
69
  assign w0[2] = wb[95:64];
70
  assign w0[3] = wb[127:96];
71
  assign w0[4] = wb[159:128];
72
  assign w0[5] = wb[191:160];
73
  assign w0[6] = wb[223:192];
74
  assign w0[7] = wb[255:224];
75
  assign w0[8] = wb[287:256];
76
  assign w0[9] = wb[319:288];
77
  assign w0[10] = wb[351:320];
78
  assign w0[11] = wb[383:352];
79
  assign w0[12] = wb[415:384];
80
  assign w0[13] = wb[447:416];
81
  assign w0[14] = wb[479:448];
82
  assign w0[15] = wb[511:480];
83
 
84
  reg [31:0]
85
  a1, b1, c1, d1,
86
  a2, b2, c2, d2,
87
  a3, b3, c3, d3,
88
  a4, b4, c4, d4,
89
  a5, b5, c5, d5,
90
  a6, b6, c6, d6,
91
  a7, b7, c7, d7,
92
  a8, b8, c8, d8,
93
  a9, b9, c9, d9,
94
  a10, b10, c10, d10,
95
  a11, b11, c11, d11,
96
  a12, b12, c12, d12,
97
  a13, b13, c13, d13,
98
  a14, b14, c14, d14,
99
  a15, b15, c15, d15,
100
  a16, b16, c16, d16,
101
  a17, b17, c17, d17,
102
  a18, b18, c18, d18,
103
  a19, b19, c19, d19,
104
  a20, b20, c20, d20,
105
  a21, b21, c21, d21,
106
  a22, b22, c22, d22,
107
  a23, b23, c23, d23,
108
  a24, b24, c24, d24,
109
  a25, b25, c25, d25,
110
  a26, b26, c26, d26,
111
  a27, b27, c27, d27,
112
  a28, b28, c28, d28,
113
  a29, b29, c29, d29,
114
  a30, b30, c30, d30,
115
  a31, b31, c31, d31,
116
  a32, b32, c32, d32,
117
  a33, b33, c33, d33,
118
  a34, b34, c34, d34,
119
  a35, b35, c35, d35,
120
  a36, b36, c36, d36,
121
  a37, b37, c37, d37,
122
  a38, b38, c38, d38,
123
  a39, b39, c39, d39,
124
  a40, b40, c40, d40,
125
  a41, b41, c41, d41,
126
  a42, b42, c42, d42,
127
  a43, b43, c43, d43,
128
  a44, b44, c44, d44,
129
  a45, b45, c45, d45,
130
  a46, b46, c46, d46,
131
  a47, b47, c47, d47,
132
  a48, b48, c48, d48,
133
  a49, b49, c49, d49,
134
  a50, b50, c50, d50,
135
  a51, b51, c51, d51,
136
  a52, b52, c52, d52,
137
  a53, b53, c53, d53,
138
  a54, b54, c54, d54,
139
  a55, b55, c55, d55,
140
  a56, b56, c56, d56,
141
  a57, b57, c57, d57,
142
  a58, b58, c58, d58,
143
  a59, b59, c59, d59,
144
  a60, b60, c60, d60,
145
  a61, b61, c61, d61,
146
  a62, b62, c62, d62,
147
  a63, b63, c63, d63
148
  ;
149
 
150
  reg [31:0] w1 [0:15];
151
  reg [31:0] w2 [0:15];
152
  reg [31:0] w3 [0:15];
153
  reg [31:0] w4 [0:15];
154
  reg [31:0] w5 [0:15];
155
  reg [31:0] w6 [0:15];
156
  reg [31:0] w7 [0:15];
157
  reg [31:0] w8 [0:15];
158
  reg [31:0] w9 [0:15];
159
  reg [31:0] w10 [0:15];
160
  reg [31:0] w11 [0:15];
161
  reg [31:0] w12 [0:15];
162
  reg [31:0] w13 [0:15];
163
  reg [31:0] w14 [0:15];
164
  reg [31:0] w15 [0:15];
165
  reg [31:0] w16 [0:15];
166
  reg [31:0] w17 [0:15];
167
  reg [31:0] w18 [0:15];
168
  reg [31:0] w19 [0:15];
169
  reg [31:0] w20 [0:15];
170
  reg [31:0] w21 [0:15];
171
  reg [31:0] w22 [0:15];
172
  reg [31:0] w23 [0:15];
173
  reg [31:0] w24 [0:15];
174
  reg [31:0] w25 [0:15];
175
  reg [31:0] w26 [0:15];
176
  reg [31:0] w27 [0:15];
177
  reg [31:0] w28 [0:15];
178
  reg [31:0] w29 [0:15];
179
  reg [31:0] w30 [0:15];
180
  reg [31:0] w31 [0:15];
181
  reg [31:0] w32 [0:15];
182
  reg [31:0] w33 [0:15];
183
  reg [31:0] w34 [0:15];
184
  reg [31:0] w35 [0:15];
185
  reg [31:0] w36 [0:15];
186
  reg [31:0] w37 [0:15];
187
  reg [31:0] w38 [0:15];
188
  reg [31:0] w39 [0:15];
189
  reg [31:0] w40 [0:15];
190
  reg [31:0] w41 [0:15];
191
  reg [31:0] w42 [0:15];
192
  reg [31:0] w43 [0:15];
193
  reg [31:0] w44 [0:15];
194
  reg [31:0] w45 [0:15];
195
  reg [31:0] w46 [0:15];
196
  reg [31:0] w47 [0:15];
197
  reg [31:0] w48 [0:15];
198
  reg [31:0] w49 [0:15];
199
  reg [31:0] w50 [0:15];
200
  reg [31:0] w51 [0:15];
201
  reg [31:0] w52 [0:15];
202
  reg [31:0] w53 [0:15];
203
  reg [31:0] w54 [0:15];
204
  reg [31:0] w55 [0:15];
205
  reg [31:0] w56 [0:15];
206
  reg [31:0] w57 [0:15];
207
  reg [31:0] w58 [0:15];
208
  reg [31:0] w59 [0:15];
209
  reg [31:0] w60 [0:15];
210
  reg [31:0] w61 [0:15];
211
  reg [31:0] w62 [0:15];
212
  reg [31:0] w63 [0:15];
213
 
214
  always @(posedge clk)
215
    begin
216
      `CopyDigestWords(a1, d0, d1, c0, c1, b0)
217
      b1 <= b0 + ((((a0 + ((b0 & c0) | ((~b0) & d0)) + 'hd76aa478 + w0[0]) << 7) | ((a0 + ((b0 & c0) | ((~b0) & d0)) + 'hd76aa478 + w0[0]) >> (32 - 7))));
218
      `CopyChunkWords(w1, w0)
219
 
220
      `CopyDigestWords(a2, d1, d2, c1, c2, b1)
221
      b2 <= b1 + (((a1 + ((b1 & c1) | ((~b1) & d1)) + 'he8c7b756 + w1[1]) << 12) | ((a1 + ((b1 & c1) | ((~b1) & d1)) + 'he8c7b756 + w1[1]) >> (32 - 12)));
222
      `CopyChunkWords(w2, w1)
223
 
224
      `CopyDigestWords(a3, d2, d3, c2, c3, b2)
225
      b3 <= b2 + (((a2 + ((b2 & c2) | ((~b2) & d2)) + 'h242070db + w2[2]) << 17) | ((a2 + ((b2 & c2) | ((~b2) & d2)) + 'h242070db + w2[2]) >> (32 - 17)));
226
      `CopyChunkWords(w3, w2)
227
 
228
      `CopyDigestWords(a4, d3, d4, c3, c4, b3)
229
      b4 <= b3 + (((a3 + ((b3 & c3) | ((~b3) & d3)) + 'hc1bdceee + w3[3]) << 22) | ((a3 + ((b3 & c3) | ((~b3) & d3)) + 'hc1bdceee + w3[3]) >> (32 - 22)));
230
      `CopyChunkWords(w4, w3)
231
 
232
      `CopyDigestWords(a5, d4, d5, c4, c5, b4)
233
      b5 <= b4 + (((a4 + ((b4 & c4) | ((~b4) & d4)) + 'hf57c0faf + w4[4]) << 7) | ((a4 + ((b4 & c4) | ((~b4) & d4)) + 'hf57c0faf + w4[4]) >> (32 - 7)));
234
      `CopyChunkWords(w5, w4)
235
 
236
      `CopyDigestWords(a6, d5, d6, c5, c6, b5)
237
      b6 <= b5 + (((a5 + ((b5 & c5) | ((~b5) & d5)) + 'h4787c62a + w5[5]) << 12) | ((a5 + ((b5 & c5) | ((~b5) & d5)) + 'h4787c62a + w5[5]) >> (32 - 12)));
238
      `CopyChunkWords(w6, w5)
239
 
240
      `CopyDigestWords(a7, d6, d7, c6, c7, b6)
241
      b7 <= b6 + (((a6 + ((b6 & c6) | ((~b6) & d6)) + 'ha8304613 + w6[6]) << 17) | ((a6 + ((b6 & c6) | ((~b6) & d6)) + 'ha8304613 + w6[6]) >> (32 - 17)));
242
      `CopyChunkWords(w7, w6)
243
 
244
      `CopyDigestWords(a8, d7, d8, c7, c8, b7)
245
      b8 <= b7 + (((a7 + ((b7 & c7) | ((~b7) & d7)) + 'hfd469501 + w7[7]) << 22) | ((a7 + ((b7 & c7) | ((~b7) & d7)) + 'hfd469501 + w7[7]) >> (32 - 22)));
246
      `CopyChunkWords(w8, w7)
247
 
248
      `CopyDigestWords(a9, d8, d9, c8, c9, b8)
249
      b9 <= b8 + (((a8 + ((b8 & c8) | ((~b8) & d8)) + 'h698098d8 + w8[8]) << 7) | ((a8 + ((b8 & c8) | ((~b8) & d8)) + 'h698098d8 + w8[8]) >> (32 - 7)));
250
      `CopyChunkWords(w9, w8)
251
 
252
      `CopyDigestWords(a10, d9, d10, c9, c10, b9)
253
      b10 <= b9 + (((a9 + ((b9 & c9) | ((~b9) & d9)) + 'h8b44f7af + w9[9]) << 12) | ((a9 + ((b9 & c9) | ((~b9) & d9)) + 'h8b44f7af + w9[9]) >> (32 - 12)));
254
      `CopyChunkWords(w10, w9)
255
 
256
      `CopyDigestWords(a11, d10, d11, c10, c11, b10)
257
      b11 <= b10 + (((a10 + ((b10 & c10) | ((~b10) & d10)) + 'hffff5bb1 + w10[10]) << 17) | ((a10 + ((b10 & c10) | ((~b10) & d10)) + 'hffff5bb1 + w10[10]) >> (32 - 17)));
258
      `CopyChunkWords(w11, w10)
259
 
260
      `CopyDigestWords(a12, d11, d12, c11, c12, b11)
261
      b12 <= b11 + (((a11 + ((b11 & c11) | ((~b11) & d11)) + 'h895cd7be + w11[11]) << 22) | ((a11 + ((b11 & c11) | ((~b11) & d11)) + 'h895cd7be + w11[11]) >> (32 - 22)));
262
      `CopyChunkWords(w12, w11)
263
 
264
      `CopyDigestWords(a13, d12, d13, c12, c13, b12)
265
      b13 <= b12 + (((a12 + ((b12 & c12) | ((~b12) & d12)) + 'h6b901122 + w12[12]) << 7) | ((a12 + ((b12 & c12) | ((~b12) & d12)) + 'h6b901122 + w12[12]) >> (32 - 7)));
266
      `CopyChunkWords(w13, w12)
267
 
268
      `CopyDigestWords(a14, d13, d14, c13, c14, b13)
269
      b14 <= b13 + (((a13 + ((b13 & c13) | ((~b13) & d13)) + 'hfd987193 + w13[13]) << 12) | ((a13 + ((b13 & c13) | ((~b13) & d13)) + 'hfd987193 + w13[13]) >> (32 - 12)));
270
      `CopyChunkWords(w14, w13)
271
 
272
      `CopyDigestWords(a15, d14, d15, c14, c15, b14)
273
      b15 <= b14 + (((a14 + ((b14 & c14) | ((~b14) & d14)) + 'ha679438e + w14[14]) << 17) | ((a14 + ((b14 & c14) | ((~b14) & d14)) + 'ha679438e + w14[14]) >> (32 - 17)));
274
      `CopyChunkWords(w15, w14)
275
 
276
      `CopyDigestWords(a16, d15, d16, c15, c16, b15)
277
      b16 <= b15 + (((a15 + ((b15 & c15) | ((~b15) & d15)) + 'h49b40821 + w15[15]) << 22) | ((a15 + ((b15 & c15) | ((~b15) & d15)) + 'h49b40821 + w15[15]) >> (32 - 22)));
278
      `CopyChunkWords(w16, w15)
279
 
280
      `CopyDigestWords(a17, d16, d17, c16, c17, b16)
281
      b17 <= b16 + (((a16 + ((d16 & b16) | ((~d16) & c16)) + 'hf61e2562 + w16[(5 * 16 + 1) % 16]) << 5) | ((a16 + ((d16 & b16) | ((~d16) & c16)) + 'hf61e2562 + w16[(5 * 16 + 1) % 16]) >> (32 - 5)));
282
      `CopyChunkWords(w17, w16)
283
 
284
      `CopyDigestWords(a18, d17, d18, c17, c18, b17)
285
      b18 <= b17 + (((a17 + ((d17 & b17) | ((~d17) & c17)) + 'hc040b340 + w17[(5 * 17 + 1) % 16]) << 9) | ((a17 + ((d17 & b17) | ((~d17) & c17)) + 'hc040b340 + w17[(5 * 17 + 1) % 16]) >> (32 - 9)));
286
      `CopyChunkWords(w18, w17)
287
 
288
      `CopyDigestWords(a19, d18, d19, c18, c19, b18)
289
      b19 <= b18 + (((a18 + ((d18 & b18) | ((~d18) & c18)) + 'h265e5a51 + w18[(5 * 18 + 1) % 16]) << 14) | ((a18 + ((d18 & b18) | ((~d18) & c18)) + 'h265e5a51 + w18[(5 * 18 + 1) % 16]) >> (32 - 14)));
290
      `CopyChunkWords(w19, w18)
291
 
292
      `CopyDigestWords(a20, d19, d20, c19, c20, b19)
293
      b20 <= b19 + (((a19 + ((d19 & b19) | ((~d19) & c19)) + 'he9b6c7aa + w19[(5 * 19 + 1) % 16]) << 20) | ((a19 + ((d19 & b19) | ((~d19) & c19)) + 'he9b6c7aa + w19[(5 * 19 + 1) % 16]) >> (32 - 20)));
294
      `CopyChunkWords(w20, w19)
295
 
296
      `CopyDigestWords(a21, d20, d21, c20, c21, b20)
297
      b21 <= b20 + (((a20 + ((d20 & b20) | ((~d20) & c20)) + 'hd62f105d + w20[(5 * 20 + 1) % 16]) << 5) | ((a20 + ((d20 & b20) | ((~d20) & c20)) + 'hd62f105d + w20[(5 * 20 + 1) % 16]) >> (32 - 5)));
298
      `CopyChunkWords(w21, w20)
299
 
300
      `CopyDigestWords(a22, d21, d22, c21, c22, b21)
301
      b22 <= b21 + (((a21 + ((d21 & b21) | ((~d21) & c21)) + 'h02441453 + w21[(5 * 21 + 1) % 16]) << 9) | ((a21 + ((d21 & b21) | ((~d21) & c21)) + 'h02441453 + w21[(5 * 21 + 1) % 16]) >> (32 - 9)));
302
      `CopyChunkWords(w22, w21)
303
 
304
      `CopyDigestWords(a23, d22, d23, c22, c23, b22)
305
      b23 <= b22 + (((a22 + ((d22 & b22) | ((~d22) & c22)) + 'hd8a1e681 + w22[(5 * 22 + 1) % 16]) << 14) | ((a22 + ((d22 & b22) | ((~d22) & c22)) + 'hd8a1e681 + w22[(5 * 22 + 1) % 16]) >> (32 - 14)));
306
      `CopyChunkWords(w23, w22)
307
 
308
      `CopyDigestWords(a24, d23, d24, c23, c24, b23)
309
      b24 <= b23 + (((a23 + ((d23 & b23) | ((~d23) & c23)) + 'he7d3fbc8 + w23[(5 * 23 + 1) % 16]) << 20) | ((a23 + ((d23 & b23) | ((~d23) & c23)) + 'he7d3fbc8 + w23[(5 * 23 + 1) % 16]) >> (32 - 20)));
310
      `CopyChunkWords(w24, w23)
311
 
312
      `CopyDigestWords(a25, d24, d25, c24, c25, b24)
313
      b25 <= b24 + (((a24 + ((d24 & b24) | ((~d24) & c24)) + 'h21e1cde6 + w24[(5 * 24 + 1) % 16]) << 5) | ((a24 + ((d24 & b24) | ((~d24) & c24)) + 'h21e1cde6 + w24[(5 * 24 + 1) % 16]) >> (32 - 5)));
314
      `CopyChunkWords(w25, w24)
315
 
316
      `CopyDigestWords(a26, d25, d26, c25, c26, b25)
317
      b26 <= b25 + (((a25 + ((d25 & b25) | ((~d25) & c25)) + 'hc33707d6 + w25[(5 * 25 + 1) % 16]) << 9) | ((a25 + ((d25 & b25) | ((~d25) & c25)) + 'hc33707d6 + w25[(5 * 25 + 1) % 16]) >> (32 - 9)));
318
      `CopyChunkWords(w26, w25)
319
 
320
      `CopyDigestWords(a27, d26, d27, c26, c27, b26)
321
      b27 <= b26 + (((a26 + ((d26 & b26) | ((~d26) & c26)) + 'hf4d50d87 + w26[(5 * 26 + 1) % 16]) << 14) | ((a26 + ((d26 & b26) | ((~d26) & c26)) + 'hf4d50d87 + w26[(5 * 26 + 1) % 16]) >> (32 - 14)));
322
      `CopyChunkWords(w27, w26)
323
 
324
      `CopyDigestWords(a28, d27, d28, c27, c28, b27)
325
      b28 <= b27 + (((a27 + ((d27 & b27) | ((~d27) & c27)) + 'h455a14ed + w27[(5 * 27 + 1) % 16]) << 20) | ((a27 + ((d27 & b27) | ((~d27) & c27)) + 'h455a14ed + w27[(5 * 27 + 1) % 16]) >> (32 - 20)));
326
      `CopyChunkWords(w28, w27)
327
 
328
      `CopyDigestWords(a29, d28, d29, c28, c29, b28)
329
      b29 <= b28 + (((a28 + ((d28 & b28) | ((~d28) & c28)) + 'ha9e3e905 + w28[(5 * 28 + 1) % 16]) << 5) | ((a28 + ((d28 & b28) | ((~d28) & c28)) + 'ha9e3e905 + w28[(5 * 28 + 1) % 16]) >> (32 - 5)));
330
      `CopyChunkWords(w29, w28)
331
 
332
      `CopyDigestWords(a30, d29, d30, c29, c30, b29)
333
      b30 <= b29 + (((a29 + ((d29 & b29) | ((~d29) & c29)) + 'hfcefa3f8 + w29[(5 * 29 + 1) % 16]) << 9) | ((a29 + ((d29 & b29) | ((~d29) & c29)) + 'hfcefa3f8 + w29[(5 * 29 + 1) % 16]) >> (32 - 9)));
334
      `CopyChunkWords(w30, w29)
335
 
336
      `CopyDigestWords(a31, d30, d31, c30, c31, b30)
337
      b31 <= b30 + (((a30 + ((d30 & b30) | ((~d30) & c30)) + 'h676f02d9 + w30[(5 * 30 + 1) % 16]) << 14) | ((a30 + ((d30 & b30) | ((~d30) & c30)) + 'h676f02d9 + w30[(5 * 30 + 1) % 16]) >> (32 - 14)));
338
      `CopyChunkWords(w31, w30)
339
 
340
      `CopyDigestWords(a32, d31, d32, c31, c32, b31)
341
      b32 <= b31 + (((a31 + ((d31 & b31) | ((~d31) & c31)) + 'h8d2a4c8a + w31[(5 * 31 + 1) % 16]) << 20) | ((a31 + ((d31 & b31) | ((~d31) & c31)) + 'h8d2a4c8a + w31[(5 * 31 + 1) % 16]) >> (32 - 20)));
342
      `CopyChunkWords(w32, w31)
343
 
344
      `CopyDigestWords(a33, d32, d33, c32, c33, b32)
345
      b33 <= b32 + (((a32 + (b32 ^ c32 ^ d32) + 'hfffa3942 + w32[(3 * 32 + 5) % 16]) << 4) | ((a32 + (b32 ^ c32 ^ d32) + 'hfffa3942 + w32[(3 * 32 + 5) % 16]) >> (32 - 4)));
346
      `CopyChunkWords(w33, w32)
347
 
348
      `CopyDigestWords(a34, d33, d34, c33, c34, b33)
349
      b34 <= b33 + (((a33 + (b33 ^ c33 ^ d33) + 'h8771f681 + w33[(3 * 33 + 5) % 16]) << 11) | ((a33 + (b33 ^ c33 ^ d33) + 'h8771f681 + w33[(3 * 33 + 5) % 16]) >> (32 - 11)));
350
      `CopyChunkWords(w34, w33)
351
 
352
      `CopyDigestWords(a35, d34, d35, c34, c35, b34)
353
      b35 <= b34 + (((a34 + (b34 ^ c34 ^ d34) + 'h6d9d6122 + w34[(3 * 34 + 5) % 16]) << 16) | ((a34 + (b34 ^ c34 ^ d34) + 'h6d9d6122 + w34[(3 * 34 + 5) % 16]) >> (32 - 16)));
354
      `CopyChunkWords(w35, w34)
355
 
356
      `CopyDigestWords(a36, d35, d36, c35, c36, b35)
357
      b36 <= b35 + (((a35 + (b35 ^ c35 ^ d35) + 'hfde5380c + w35[(3 * 35 + 5) % 16]) << 23) | ((a35 + (b35 ^ c35 ^ d35) + 'hfde5380c + w35[(3 * 35 + 5) % 16]) >> (32 - 23)));
358
      `CopyChunkWords(w36, w35)
359
 
360
      `CopyDigestWords(a37, d36, d37, c36, c37, b36)
361
      b37 <= b36 + (((a36 + (b36 ^ c36 ^ d36) + 'ha4beea44 + w36[(3 * 36 + 5) % 16]) << 4) | ((a36 + (b36 ^ c36 ^ d36) + 'ha4beea44 + w36[(3 * 36 + 5) % 16]) >> (32 - 4)));
362
      `CopyChunkWords(w37, w36)
363
 
364
      `CopyDigestWords(a38, d37, d38, c37, c38, b37)
365
      b38 <= b37 + (((a37 + (b37 ^ c37 ^ d37) + 'h4bdecfa9 + w37[(3 * 37 + 5) % 16]) << 11) | ((a37 + (b37 ^ c37 ^ d37) + 'h4bdecfa9 + w37[(3 * 37 + 5) % 16]) >> (32 - 11)));
366
      `CopyChunkWords(w38, w37)
367
 
368
      `CopyDigestWords(a39, d38, d39, c38, c39, b38)
369
      b39 <= b38 + (((a38 + (b38 ^ c38 ^ d38) + 'hf6bb4b60 + w38[(3 * 38 + 5) % 16]) << 16) | ((a38 + (b38 ^ c38 ^ d38) + 'hf6bb4b60 + w38[(3 * 38 + 5) % 16]) >> (32 - 16)));
370
      `CopyChunkWords(w39, w38)
371
 
372
      `CopyDigestWords(a40, d39, d40, c39, c40, b39)
373
      b40 <= b39 + (((a39 + (b39 ^ c39 ^ d39) + 'hbebfbc70 + w39[(3 * 39 + 5) % 16]) << 23) | ((a39 + (b39 ^ c39 ^ d39) + 'hbebfbc70 + w39[(3 * 39 + 5) % 16]) >> (32 - 23)));
374
      `CopyChunkWords(w40, w39)
375
 
376
      `CopyDigestWords(a41, d40, d41, c40, c41, b40)
377
      b41 <= b40 + (((a40 + (b40 ^ c40 ^ d40) + 'h289b7ec6 + w40[(3 * 40 + 5) % 16]) << 4) | ((a40 + (b40 ^ c40 ^ d40) + 'h289b7ec6 + w40[(3 * 40 + 5) % 16]) >> (32 - 4)));
378
      `CopyChunkWords(w41, w40)
379
 
380
      `CopyDigestWords(a42, d41, d42, c41, c42, b41)
381
      b42 <= b41 + (((a41 + (b41 ^ c41 ^ d41) + 'heaa127fa + w41[(3 * 41 + 5) % 16]) << 11) | ((a41 + (b41 ^ c41 ^ d41) + 'heaa127fa + w41[(3 * 41 + 5) % 16]) >> (32 - 11)));
382
      `CopyChunkWords(w42, w41)
383
 
384
      `CopyDigestWords(a43, d42, d43, c42, c43, b42)
385
      b43 <= b42 + (((a42 + (b42 ^ c42 ^ d42) + 'hd4ef3085 + w42[(3 * 42 + 5) % 16]) << 16) | ((a42 + (b42 ^ c42 ^ d42) + 'hd4ef3085 + w42[(3 * 42 + 5) % 16]) >> (32 - 16)));
386
      `CopyChunkWords(w43, w42)
387
 
388
      `CopyDigestWords(a44, d43, d44, c43, c44, b43)
389
      b44 <= b43 + (((a43 + (b43 ^ c43 ^ d43) + 'h04881d05 + w43[(3 * 43 + 5) % 16]) << 23) | ((a43 + (b43 ^ c43 ^ d43) + 'h04881d05 + w43[(3 * 43 + 5) % 16]) >> (32 - 23)));
390
      `CopyChunkWords(w44, w43)
391
 
392
      `CopyDigestWords(a45, d44, d45, c44, c45, b44)
393
      b45 <= b44 + (((a44 + (b44 ^ c44 ^ d44) + 'hd9d4d039 + w44[(3 * 44 + 5) % 16]) << 4) | ((a44 + (b44 ^ c44 ^ d44) + 'hd9d4d039 + w44[(3 * 44 + 5) % 16]) >> (32 - 4)));
394
      `CopyChunkWords(w45, w44)
395
 
396
      `CopyDigestWords(a46, d45, d46, c45, c46, b45)
397
      b46 <= b45 + (((a45 + (b45 ^ c45 ^ d45) + 'he6db99e5 + w45[(3 * 45 + 5) % 16]) << 11) | ((a45 + (b45 ^ c45 ^ d45) + 'he6db99e5 + w45[(3 * 45 + 5) % 16]) >> (32 - 11)));
398
      `CopyChunkWords(w46, w45)
399
 
400
      `CopyDigestWords(a47, d46, d47, c46, c47, b46)
401
      b47 <= b46 + (((a46 + (b46 ^ c46 ^ d46) + 'h1fa27cf8 + w46[(3 * 46 + 5) % 16]) << 16) | ((a46 + (b46 ^ c46 ^ d46) + 'h1fa27cf8 + w46[(3 * 46 + 5) % 16]) >> (32 - 16)));
402
      `CopyChunkWords(w47, w46)
403
 
404
      `CopyDigestWords(a48, d47, d48, c47, c48, b47)
405
      b48 <= b47 + (((a47 + (b47 ^ c47 ^ d47) + 'hc4ac5665 + w47[(3 * 47 + 5) % 16]) << 23) | ((a47 + (b47 ^ c47 ^ d47) + 'hc4ac5665 + w47[(3 * 47 + 5) % 16]) >> (32 - 23)));
406
      `CopyChunkWords(w48, w47)
407
 
408
      `CopyDigestWords(a49, d48, d49, c48, c49, b48)
409
      b49 <= b48 + (((a48 + (c48 ^ (b48 | (~d48))) + 'hf4292244 + w48[(7 * 48) % 16]) << 6) | ((a48 + (c48 ^ (b48 | (~d48))) + 'hf4292244 + w48[(7 * 48) % 16]) >> (32 - 6)));
410
      `CopyChunkWords(w49, w48)
411
 
412
      `CopyDigestWords(a50, d49, d50, c49, c50, b49)
413
      b50 <= b49 + (((a49 + (c49 ^ (b49 | (~d49))) + 'h432aff97 + w49[(7 * 49) % 16]) << 10) | ((a49 + (c49 ^ (b49 | (~d49))) + 'h432aff97 + w49[(7 * 49) % 16]) >> (32 - 10)));
414
      `CopyChunkWords(w50, w49)
415
 
416
      `CopyDigestWords(a51, d50, d51, c50, c51, b50)
417
      b51 <= b50 + (((a50 + (c50 ^ (b50 | (~d50))) + 'hab9423a7 + w50[(7 * 50) % 16]) << 15) | ((a50 + (c50 ^ (b50 | (~d50))) + 'hab9423a7 + w50[(7 * 50) % 16]) >> (32 - 15)));
418
      `CopyChunkWords(w51, w50)
419
 
420
      `CopyDigestWords(a52, d51, d52, c51, c52, b51)
421
      b52 <= b51 + (((a51 + (c51 ^ (b51 | (~d51))) + 'hfc93a039 + w51[(7 * 51) % 16]) << 21) | ((a51 + (c51 ^ (b51 | (~d51))) + 'hfc93a039 + w51[(7 * 51) % 16]) >> (32 - 21)));
422
      `CopyChunkWords(w52, w51)
423
 
424
      `CopyDigestWords(a53, d52, d53, c52, c53, b52)
425
      b53 <= b52 + (((a52 + (c52 ^ (b52 | (~d52))) + 'h655b59c3 + w52[(7 * 52) % 16]) << 6) | ((a52 + (c52 ^ (b52 | (~d52))) + 'h655b59c3 + w52[(7 * 52) % 16]) >> (32 - 6)));
426
      `CopyChunkWords(w53, w52)
427
 
428
      `CopyDigestWords(a54, d53, d54, c53, c54, b53)
429
      b54 <= b53 + (((a53 + (c53 ^ (b53 | (~d53))) + 'h8f0ccc92 + w53[(7 * 53) % 16]) << 10) | ((a53 + (c53 ^ (b53 | (~d53))) + 'h8f0ccc92 + w53[(7 * 53) % 16]) >> (32 - 10)));
430
      `CopyChunkWords(w54, w53)
431
 
432
      `CopyDigestWords(a55, d54, d55, c54, c55, b54)
433
      b55 <= b54 + (((a54 + (c54 ^ (b54 | (~d54))) + 'hffeff47d + w54[(7 * 54) % 16]) << 15) | ((a54 + (c54 ^ (b54 | (~d54))) + 'hffeff47d + w54[(7 * 54) % 16]) >> (32 - 15)));
434
      `CopyChunkWords(w55, w54)
435
 
436
      `CopyDigestWords(a56, d55, d56, c55, c56, b55)
437
      b56 <= b55 + (((a55 + (c55 ^ (b55 | (~d55))) + 'h85845dd1 + w55[(7 * 55) % 16]) << 21) | ((a55 + (c55 ^ (b55 | (~d55))) + 'h85845dd1 + w55[(7 * 55) % 16]) >> (32 - 21)));
438
      `CopyChunkWords(w56, w55)
439
 
440
      `CopyDigestWords(a57, d56, d57, c56, c57, b56)
441
      b57 <= b56 + (((a56 + (c56 ^ (b56 | (~d56))) + 'h6fa87e4f + w56[(7 * 56) % 16]) << 6) | ((a56 + (c56 ^ (b56 | (~d56))) + 'h6fa87e4f + w56[(7 * 56) % 16]) >> (32 - 6)));
442
      `CopyChunkWords(w57, w56)
443
 
444
      `CopyDigestWords(a58, d57, d58, c57, c58, b57)
445
      b58 <= b57 + (((a57 + (c57 ^ (b57 | (~d57))) + 'hfe2ce6e0 + w57[(7 * 57) % 16]) << 10) | ((a57 + (c57 ^ (b57 | (~d57))) + 'hfe2ce6e0 + w57[(7 * 57) % 16]) >> (32 - 10)));
446
      `CopyChunkWords(w58, w57)
447
 
448
      `CopyDigestWords(a59, d58, d59, c58, c59, b58)
449
      b59 <= b58 + (((a58 + (c58 ^ (b58 | (~d58))) + 'ha3014314 + w58[(7 * 58) % 16]) << 15) | ((a58 + (c58 ^ (b58 | (~d58))) + 'ha3014314 + w58[(7 * 58) % 16]) >> (32 - 15)));
450
      `CopyChunkWords(w59, w58)
451
 
452
      `CopyDigestWords(a60, d59, d60, c59, c60, b59)
453
      b60 <= b59 + (((a59 + (c59 ^ (b59 | (~d59))) + 'h4e0811a1 + w59[(7 * 59) % 16]) << 21) | ((a59 + (c59 ^ (b59 | (~d59))) + 'h4e0811a1 + w59[(7 * 59) % 16]) >> (32 - 21)));
454
      `CopyChunkWords(w60, w59)
455
 
456
      `CopyDigestWords(a61, d60, d61, c60, c61, b60)
457
      b61 <= b60 + (((a60 + (c60 ^ (b60 | (~d60))) + 'hf7537e82 + w60[(7 * 60) % 16]) << 6) | ((a60 + (c60 ^ (b60 | (~d60))) + 'hf7537e82 + w60[(7 * 60) % 16]) >> (32 - 6)));
458
      `CopyChunkWords(w61, w60)
459
 
460
      `CopyDigestWords(a62, d61, d62, c61, c62, b61)
461
      b62 <= b61 + (((a61 + (c61 ^ (b61 | (~d61))) + 'hbd3af235 + w61[(7 * 61) % 16]) << 10) | ((a61 + (c61 ^ (b61 | (~d61))) + 'hbd3af235 + w61[(7 * 61) % 16]) >> (32 - 10)));
462
      `CopyChunkWords(w62, w61)
463
 
464
      `CopyDigestWords(a63, d62, d63, c62, c63, b62)
465
      b63 <= b62 + (((a62 + (c62 ^ (b62 | (~d62))) + 'h2ad7d2bb + w62[(7 * 62) % 16]) << 15) | ((a62 + (c62 ^ (b62 | (~d62))) + 'h2ad7d2bb + w62[(7 * 62) % 16]) >> (32 - 15)));
466
      `CopyChunkWords(w63, w62)
467
 
468
      `CopyDigestWords(a64, d63, d64, c63, c64, b63)
469
      b64 <= b63 + (((a63 + (c63 ^ (b63 | (~d63))) + 'heb86d391 + w63[(7 * 63) % 16]) << 21) | ((a63 + (c63 ^ (b63 | (~d63))) + 'heb86d391 + w63[(7 * 63) % 16]) >> (32 - 21)));
470
    end
471
endmodule
472
 
473
 
474
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.