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

Subversion Repositories md5_pipelined

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

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

powered by: WebSVN 2.1.0

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