Subversion Repositories Kolibri OS

Rev

Rev 7698 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
9216 dunkaist 1
; libcrash -- cryptographic hash (and other) functions
7698 dunkaist 2
;
9216 dunkaist 3
; Copyright (C) <2012-2013,2016,2019,2021> Ivan Baravy
7698 dunkaist 4
;
9216 dunkaist 5
; SPDX-License-Identifier: GPL-2.0-or-later
7698 dunkaist 6
;
9216 dunkaist 7
; This program is free software: you can redistribute it and/or modify it under
8
; the terms of the GNU General Public License as published by the Free Software
9
; Foundation, either version 2 of the License, or (at your option) any later
10
; version.
7698 dunkaist 11
;
9216 dunkaist 12
; This program is distributed in the hope that it will be useful, but WITHOUT
13
; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15
;
16
; You should have received a copy of the GNU General Public License along with
17
; this program. If not, see .
7698 dunkaist 18
 
9216 dunkaist 19
SHA2_384512_BLOCK_SIZE = 128
20
SHA2_384_BLOCK_SIZE    = SHA2_384512_BLOCK_SIZE
21
SHA2_512_BLOCK_SIZE    = SHA2_384512_BLOCK_SIZE
7698 dunkaist 22
 
9216 dunkaist 23
SHA2_384512_INIT_SIZE  = 64
24
SHA2_384512_ALIGN      = 16
25
SHA2_384512_ALIGN_MASK = SHA2_384512_ALIGN - 1
7698 dunkaist 26
 
9216 dunkaist 27
struct ctx_sha2_384512
28
        hash            rb SHA2_384512_INIT_SIZE
29
        block           rb SHA2_384512_BLOCK_SIZE
7698 dunkaist 30
        index           rd 1
31
        msglen_0        rd 1
32
        msglen_1        rd 1
33
        msglen_2        rd 1
34
        msglen_3        rd 1
35
                        rd 3    ; align
36
        ; tmp vars
37
        w               rq 80
38
        A               rq 1
39
        B               rq 1
40
        C               rq 1
41
        D               rq 1
42
        E               rq 1
43
        F               rq 1
44
        G               rq 1
45
        H               rq 1
46
        temp            rq 1
47
ends
48
 
9216 dunkaist 49
assert sizeof.ctx_sha2_384512 <= LIBCRASH_CTX_LEN
7698 dunkaist 50
 
9216 dunkaist 51
macro sha2_384512._.chn x, y, z
7698 dunkaist 52
{
53
        movq    mm0, [y]
54
        pxor    mm0, [z]
55
        pand    mm0, [x]
56
        pxor    mm0, [z]
57
}
58
 
9216 dunkaist 59
macro sha2_384512._.maj x, y, z
7698 dunkaist 60
{
61
        movq    mm0, [x]
62
        pxor    mm0, [y]
63
        pand    mm0, [z]
64
        movq    mm2, [x]
65
        pand    mm2, [y]
66
        pxor    mm0, mm2
67
}
68
 
9216 dunkaist 69
macro sha2_384512._.Sigma0 x
7698 dunkaist 70
{
71
        movq    mm0, x
72
        movq    mm2, mm0
73
        movq    mm7, mm2
74
        psrlq   mm2, 28
75
        psllq   mm7, 36
76
        por     mm2, mm7
77
        movq    mm7, mm0
78
        psrlq   mm0, 34
79
        psllq   mm7, 30
80
        por     mm0, mm7
81
        pxor    mm0, mm2
82
        movq    mm2, x
83
        movq    mm7, mm2
84
        psrlq   mm2, 39
85
        psllq   mm7, 25
86
        por     mm2, mm7
87
        pxor    mm0, mm2
88
}
89
 
9216 dunkaist 90
macro sha2_384512._.Sigma1 x
7698 dunkaist 91
{
92
        movq    mm0, x
93
        movq    mm2, mm0
94
        movq    mm7, mm2
95
        psrlq   mm2, 14
96
        psllq   mm7, 50
97
        por     mm2, mm7
98
        movq    mm7, mm0
99
        psrlq   mm0, 18
100
        psllq   mm7, 46
101
        por     mm0, mm7
102
        pxor    mm0, mm2
103
        movq    mm2, x
104
        movq    mm7, mm2
105
        psrlq   mm2, 41
106
        psllq   mm7, 23
107
        por     mm2, mm7
108
        pxor    mm0, mm2
109
}
110
 
9216 dunkaist 111
macro sha2_384512._.sigma0 x
7698 dunkaist 112
{
113
        movq    mm0, x
114
        movq    mm2, mm0
115
        movq    mm7, mm2
116
        psrlq   mm2, 1
117
        psllq   mm7, 63
118
        por     mm2, mm7
119
        movq    mm7, mm0
120
        psrlq   mm0, 8
121
        psllq   mm7, 56
122
        por     mm0, mm7
123
        pxor    mm0, mm2
124
        movq    mm2, x
125
        psrlq   mm2, 7
126
        pxor    mm0, mm2
127
}
128
 
9216 dunkaist 129
macro sha2_384512._.sigma1 x
7698 dunkaist 130
{
131
        movq    mm0, x
132
        movq    mm2, mm0
133
        movq    mm7, mm2
134
        psrlq   mm2, 19
135
        psllq   mm7, 45
136
        por     mm2, mm7
137
        movq    mm7, mm0
138
        psrlq   mm0, 61
139
        psllq   mm7, 3
140
        por     mm0, mm7
141
        pxor    mm0, mm2
142
        movq    mm2, x
143
        psrlq   mm2, 6
144
        pxor    mm0, mm2
145
}
146
 
9216 dunkaist 147
macro sha2_384512._.recalculate_w n
7698 dunkaist 148
{
149
        movq    mm3, [w + ((n-2) and 15)*8]
9216 dunkaist 150
        sha2_384512._.sigma1  mm3
7698 dunkaist 151
        paddq   mm0, [w + ((n-7) and 15)*8]
152
        movq    mm6, mm0
153
        movq    mm3, [w + ((n-15) and 15)*8]
9216 dunkaist 154
        sha2_384512._.sigma0  mm3
7698 dunkaist 155
        movq    mm2, mm6
156
        paddq   mm0, mm2
157
        movq    mm7, [w + (n)*8]
158
        paddq   mm7, mm0
159
        movq    [w + (n)*8], mm7
160
}
161
 
9216 dunkaist 162
macro sha2_384512._.round a, b, c, d, e, f, g, h, k
7698 dunkaist 163
{
164
        movq    mm1, [h]
165
        movq    mm3, [e]
9216 dunkaist 166
        sha2_384512._.Sigma1  mm3
7698 dunkaist 167
        paddq   mm1, mm0
9216 dunkaist 168
        sha2_384512._.chn     e, f, g
7698 dunkaist 169
        paddq   mm1, mm0
170
        paddq   mm1, [k]
171
        paddq   mm1, mm5
172
        movq    mm7, [d]
173
        paddq   mm7, mm1
174
        movq    [d], mm7
175
        movq    mm3, [a]
9216 dunkaist 176
        sha2_384512._.Sigma0  mm3
7698 dunkaist 177
        paddq   mm1, mm0
9216 dunkaist 178
        sha2_384512._.maj     a, b, c
7698 dunkaist 179
        paddq   mm0, mm1
180
        movq    [h], mm0
181
}
182
 
183
 
9216 dunkaist 184
macro sha2_384512._.round_1_16 a, b, c, d, e, f, g, h, n
7698 dunkaist 185
{
186
 
187
        movq    mm0, [esi + (n)*8]
188
        movq    [temp], mm0
189
        mov     eax, dword[temp]
190
        bswap   eax
191
        push    eax
192
        mov     eax, dword[temp + 4]
193
        bswap   eax
194
        mov     dword[temp], eax
195
        pop     eax
196
        mov     dword[temp + 4], eax
197
        movq    mm0, [temp]
198
        movq    [w + (n)*8], mm0
199
        movq    mm5, mm0
9216 dunkaist 200
        sha2_384512._.round a, b, c, d, e, f, g, h, (sha2_384512._.table + (n)*8)
7698 dunkaist 201
}
202
 
9216 dunkaist 203
macro sha2_384512._.round_17_64 a, b, c, d, e, f, g, h, n, rep_num
7698 dunkaist 204
{
9216 dunkaist 205
        sha2_384512._.recalculate_w n
7698 dunkaist 206
        movq    mm5, [w + (n)*8]
9216 dunkaist 207
        sha2_384512._.round a, b, c, d, e, f, g, h, (sha2_384512._.table + (n+16*rep_num)*8)
7698 dunkaist 208
}
209
 
210
 
9216 dunkaist 211
proc sha2_384.init uses ebx esi edi, _ctx
7698 dunkaist 212
        mov     ebx, [_ctx]
9216 dunkaist 213
        lea     edi, [ebx + ctx_sha2_384512.hash]
214
        mov     esi, sha2_384._.hash_init
215
        mov     ecx, SHA2_384512_INIT_SIZE/4
216
        rep movsd
7698 dunkaist 217
        xor     eax, eax
9216 dunkaist 218
        mov     [ebx + ctx_sha2_384512.index], eax
219
        mov     [ebx + ctx_sha2_384512.msglen_0], eax
220
        mov     [ebx + ctx_sha2_384512.msglen_1], eax
221
        mov     [ebx + ctx_sha2_384512.msglen_2], eax
222
        mov     [ebx + ctx_sha2_384512.msglen_3], eax
7698 dunkaist 223
        ret
224
endp
225
 
226
 
9216 dunkaist 227
proc sha2_512.init uses ebx esi edi, _ctx
7698 dunkaist 228
        mov     ebx, [_ctx]
9216 dunkaist 229
        lea     edi, [ebx + ctx_sha2_384512.hash]
230
        mov     esi, sha2_512._.hash_init
231
        mov     ecx, SHA2_384512_INIT_SIZE/4
232
        rep movsd
7698 dunkaist 233
        xor     eax, eax
9216 dunkaist 234
        mov     [ebx + ctx_sha2_384512.index], eax
235
        mov     [ebx + ctx_sha2_384512.msglen_0], eax
236
        mov     [ebx + ctx_sha2_384512.msglen_1], eax
237
        mov     [ebx + ctx_sha2_384512.msglen_2], eax
238
        mov     [ebx + ctx_sha2_384512.msglen_3], eax
7698 dunkaist 239
        ret
240
endp
241
 
242
 
9216 dunkaist 243
proc sha2_384512._.block _hash
7698 dunkaist 244
;locals
245
;        w       rq 80
246
;        A       rq 1
247
;        B       rq 1
248
;        C       rq 1
249
;        D       rq 1
250
;        E       rq 1
251
;        F       rq 1
252
;        G       rq 1
253
;        H       rq 1
254
;        temp    rq 1
255
;endl
9216 dunkaist 256
w equ ebx + ctx_sha2_384512.w
257
A equ ebx + ctx_sha2_384512.A
258
B equ ebx + ctx_sha2_384512.B
259
C equ ebx + ctx_sha2_384512.C
260
D equ ebx + ctx_sha2_384512.D
261
E equ ebx + ctx_sha2_384512.E
262
F equ ebx + ctx_sha2_384512.F
263
G equ ebx + ctx_sha2_384512.G
264
H equ ebx + ctx_sha2_384512.H
265
temp equ ebx + ctx_sha2_384512.temp
7698 dunkaist 266
 
267
        mov     edi, [_hash]
268
        movq    mm0, [edi + 0x00]
269
        movq    [A], mm0
270
        movq    mm0, [edi + 0x08]
271
        movq    [B], mm0
272
        movq    mm0, [edi + 0x10]
273
        movq    [C], mm0
274
        movq    mm0, [edi + 0x18]
275
        movq    [D], mm0
276
        movq    mm0, [edi + 0x20]
277
        movq    [E], mm0
278
        movq    mm0, [edi + 0x28]
279
        movq    [F], mm0
280
        movq    mm0, [edi + 0x30]
281
        movq    [G], mm0
282
        movq    mm0, [edi + 0x38]
283
        movq    [H], mm0
284
 
285
 
9216 dunkaist 286
        sha2_384512._.round_1_16  A, B, C, D, E, F, G, H,  0
287
        sha2_384512._.round_1_16  H, A, B, C, D, E, F, G,  1
288
        sha2_384512._.round_1_16  G, H, A, B, C, D, E, F,  2
289
        sha2_384512._.round_1_16  F, G, H, A, B, C, D, E,  3
290
        sha2_384512._.round_1_16  E, F, G, H, A, B, C, D,  4
291
        sha2_384512._.round_1_16  D, E, F, G, H, A, B, C,  5
292
        sha2_384512._.round_1_16  C, D, E, F, G, H, A, B,  6
293
        sha2_384512._.round_1_16  B, C, D, E, F, G, H, A,  7
294
        sha2_384512._.round_1_16  A, B, C, D, E, F, G, H,  8
295
        sha2_384512._.round_1_16  H, A, B, C, D, E, F, G,  9
296
        sha2_384512._.round_1_16  G, H, A, B, C, D, E, F, 10
297
        sha2_384512._.round_1_16  F, G, H, A, B, C, D, E, 11
298
        sha2_384512._.round_1_16  E, F, G, H, A, B, C, D, 12
299
        sha2_384512._.round_1_16  D, E, F, G, H, A, B, C, 13
300
        sha2_384512._.round_1_16  C, D, E, F, G, H, A, B, 14
301
        sha2_384512._.round_1_16  B, C, D, E, F, G, H, A, 15
7698 dunkaist 302
 
303
repeat 4
9216 dunkaist 304
        sha2_384512._.round_17_64 A, B, C, D, E, F, G, H,  0, %
305
        sha2_384512._.round_17_64 H, A, B, C, D, E, F, G,  1, %
306
        sha2_384512._.round_17_64 G, H, A, B, C, D, E, F,  2, %
307
        sha2_384512._.round_17_64 F, G, H, A, B, C, D, E,  3, %
308
        sha2_384512._.round_17_64 E, F, G, H, A, B, C, D,  4, %
309
        sha2_384512._.round_17_64 D, E, F, G, H, A, B, C,  5, %
310
        sha2_384512._.round_17_64 C, D, E, F, G, H, A, B,  6, %
311
        sha2_384512._.round_17_64 B, C, D, E, F, G, H, A,  7, %
312
        sha2_384512._.round_17_64 A, B, C, D, E, F, G, H,  8, %
313
        sha2_384512._.round_17_64 H, A, B, C, D, E, F, G,  9, %
314
        sha2_384512._.round_17_64 G, H, A, B, C, D, E, F, 10, %
315
        sha2_384512._.round_17_64 F, G, H, A, B, C, D, E, 11, %
316
        sha2_384512._.round_17_64 E, F, G, H, A, B, C, D, 12, %
317
        sha2_384512._.round_17_64 D, E, F, G, H, A, B, C, 13, %
318
        sha2_384512._.round_17_64 C, D, E, F, G, H, A, B, 14, %
319
        sha2_384512._.round_17_64 B, C, D, E, F, G, H, A, 15, %
7698 dunkaist 320
end repeat
321
 
322
 
323
        mov     edi, [_hash]
324
        movq    mm0, [A]
325
        paddq   mm0, [edi + 0x00]
326
        movq    [edi + 0x00], mm0
327
        movq    mm0, [B]
328
        paddq   mm0, [edi + 0x08]
329
        movq    [edi + 0x08], mm0
330
        movq    mm0, [C]
331
        paddq   mm0, [edi + 0x10]
332
        movq    [edi + 0x10], mm0
333
        movq    mm0, [D]
334
        paddq   mm0, [edi + 0x18]
335
        movq    [edi + 0x18], mm0
336
        movq    mm0, [E]
337
        paddq   mm0, [edi + 0x20]
338
        movq    [edi + 0x20], mm0
339
        movq    mm0, [F]
340
        paddq   mm0, [edi + 0x28]
341
        movq    [edi + 0x28], mm0
342
        movq    mm0, [G]
343
        paddq   mm0, [edi + 0x30]
344
        movq    [edi + 0x30], mm0
345
        movq    mm0, [H]
346
        paddq   mm0, [edi + 0x38]
347
        movq    [edi + 0x38], mm0
348
 
349
        ret
350
restore w,A,B,C,D,E,F,G,H,temp
351
endp
352
 
353
 
9216 dunkaist 354
sha2_384.update = sha2_384512.update
355
sha2_512.update = sha2_384512.update
356
proc sha2_384512.update uses ebx esi edi, _ctx, _msg, _size
7698 dunkaist 357
        mov     ebx, [_ctx]
358
        mov     ecx, [_size]
9216 dunkaist 359
        add     [ebx + ctx_sha2_384512.msglen_0], ecx
360
        adc     [ebx + ctx_sha2_384512.msglen_1], 0
361
        adc     [ebx + ctx_sha2_384512.msglen_2], 0
362
        adc     [ebx + ctx_sha2_384512.msglen_3], 0
7698 dunkaist 363
 
9216 dunkaist 364
.next_block:
7698 dunkaist 365
        mov     ebx, [_ctx]
366
        mov     esi, [_msg]
9216 dunkaist 367
        mov     eax, [ebx + ctx_sha2_384512.index]
368
        and     eax, SHA2_384512_BLOCK_SIZE-1
7698 dunkaist 369
        jnz     .copy_to_buf
9216 dunkaist 370
        test    esi, SHA2_384512_ALIGN_MASK
7698 dunkaist 371
        jnz     .copy_to_buf
9216 dunkaist 372
.no_copy:
7698 dunkaist 373
        ; data is aligned, hash it in place without copying
374
        mov     ebx, [_ctx]
9216 dunkaist 375
        cmp     [_size], SHA2_384512_BLOCK_SIZE
7698 dunkaist 376
        jb      .copy_quit
9216 dunkaist 377
        lea     eax, [ebx + ctx_sha2_384512.hash]
378
        stdcall sha2_384512._.block, eax
379
        sub     [_size], SHA2_384512_BLOCK_SIZE
380
        add     esi, SHA2_384512_BLOCK_SIZE           ; FIXME
7698 dunkaist 381
        jmp     .no_copy
382
 
9216 dunkaist 383
.copy_to_buf:
384
        lea     edi, [ebx + ctx_sha2_384512.block]
7698 dunkaist 385
        add     edi, eax
9216 dunkaist 386
        mov     ecx, SHA2_384512_BLOCK_SIZE
7698 dunkaist 387
        sub     ecx, eax
388
        cmp     [_size], ecx
389
        jb      .copy_quit
390
        sub     [_size], ecx
391
        add     [_msg], ecx
9216 dunkaist 392
        add     [ebx + ctx_sha2_384512.index], ecx
393
        rep movsb
394
        lea     eax, [ebx + ctx_sha2_384512.hash]
395
        lea     esi, [ebx + ctx_sha2_384512.block]
396
        stdcall sha2_384512._.block, eax
7698 dunkaist 397
        jmp     .next_block
398
 
9216 dunkaist 399
.copy_quit:
7698 dunkaist 400
        mov     ebx, [_ctx]
9216 dunkaist 401
        lea     edi, [ebx + ctx_sha2_384512.block]
402
        mov     eax, [ebx + ctx_sha2_384512.index]
403
        and     eax, SHA2_384512_BLOCK_SIZE-1
7698 dunkaist 404
        add     edi, eax
405
        mov     ecx, [_size]
9216 dunkaist 406
        add     [ebx + ctx_sha2_384512.index], ecx
407
        rep movsb
408
.quit:
7698 dunkaist 409
 
410
        ret
411
endp
412
 
413
 
9216 dunkaist 414
sha2_384.finish = sha2_384512.finish
415
sha2_512.finish = sha2_384512.finish
416
proc sha2_384512.finish uses ebx esi edi, _ctx
7698 dunkaist 417
        mov     ebx, [_ctx]
9216 dunkaist 418
        lea     edi, [ebx + ctx_sha2_384512.block]
419
        mov     ecx, [ebx + ctx_sha2_384512.msglen_0]
420
        and     ecx, SHA2_384512_BLOCK_SIZE-1
7698 dunkaist 421
        add     edi, ecx
422
        mov     byte[edi], 0x80
423
        inc     edi
424
        neg     ecx
9216 dunkaist 425
        add     ecx, SHA2_384512_BLOCK_SIZE
7698 dunkaist 426
        cmp     ecx, 16
427
        ja      .last
428
 
429
        dec     ecx
430
        xor     eax, eax
9216 dunkaist 431
        rep stosb
432
        lea     esi, [ebx + ctx_sha2_384512.block]
433
        lea     eax, [ebx + ctx_sha2_384512.hash]
434
        stdcall sha2_384512._.block, eax
7698 dunkaist 435
        mov     ebx, [_ctx]
9216 dunkaist 436
        lea     edi, [ebx + ctx_sha2_384512.block]
437
        mov     ecx, SHA2_384512_BLOCK_SIZE+1
438
.last:
7698 dunkaist 439
        dec     ecx
440
        sub     ecx, 16
441
        xor     eax, eax
9216 dunkaist 442
        rep stosb
443
        mov     eax, [ebx + ctx_sha2_384512.msglen_1]
444
        shld    [ebx + ctx_sha2_384512.msglen_0], eax, 3
445
        mov     eax, [ebx + ctx_sha2_384512.msglen_2]
446
        shld    [ebx + ctx_sha2_384512.msglen_1], eax, 3
447
        mov     eax, [ebx + ctx_sha2_384512.msglen_3]
448
        shld    [ebx + ctx_sha2_384512.msglen_2], eax, 3
7698 dunkaist 449
        shl     eax, 3
450
        bswap   eax
451
        mov     dword[edi + 0], eax
9216 dunkaist 452
        mov     eax, [ebx + ctx_sha2_384512.msglen_2]
7698 dunkaist 453
        bswap   eax
454
        mov     dword[edi + 4], eax
9216 dunkaist 455
        mov     eax, [ebx + ctx_sha2_384512.msglen_1]
7698 dunkaist 456
        bswap   eax
457
        mov     dword[edi + 8], eax
9216 dunkaist 458
        mov     eax, [ebx + ctx_sha2_384512.msglen_0]
7698 dunkaist 459
        bswap   eax
460
        mov     dword[edi + 12], eax
461
        mov     ebx, [_ctx]
9216 dunkaist 462
        lea     esi, [ebx + ctx_sha2_384512.block]
463
        lea     eax, [ebx + ctx_sha2_384512.hash]
464
        stdcall sha2_384512._.block, eax
7698 dunkaist 465
 
466
        mov     ebx, [_ctx]
9216 dunkaist 467
        lea     eax, [ebx + ctx_sha2_384512.hash]
468
        stdcall sha2_384512._.postprocess, ebx, eax
7698 dunkaist 469
 
470
        ret
471
endp
472
 
473
 
9216 dunkaist 474
proc sha2_384512._.postprocess _ctx, _hash
7698 dunkaist 475
        mov     ecx, 8
476
        mov     esi, [_hash]
477
        mov     edi, esi
9216 dunkaist 478
@@:
7698 dunkaist 479
        lodsd
480
        mov     ebx, eax
481
        lodsd
482
        bswap   eax
483
        bswap   ebx
484
        stosd
485
        mov     eax, ebx
486
        stosd
487
        dec     ecx     ; FIXME: what should I fix here?
488
        jnz     @b
489
        emms
490
        ret
491
endp
492
 
493
 
9216 dunkaist 494
proc sha2_384.oneshot _ctx, _data, _len
495
        stdcall sha2_384.init, [_ctx]
496
        stdcall sha2_384.update, [_ctx], [_data], [_len]
497
        stdcall sha2_384.finish, [_ctx]
498
        ret
7698 dunkaist 499
endp
500
 
501
 
9216 dunkaist 502
proc sha2_512.oneshot _ctx, _data, _len
503
        stdcall sha2_512.init, [_ctx]
504
        stdcall sha2_512.update, [_ctx], [_data], [_len]
505
        stdcall sha2_512.finish, [_ctx]
506
        ret
7698 dunkaist 507
endp
508
 
509
 
510
iglobal
9216 dunkaist 511
align SHA2_384512_ALIGN
512
sha2_384._.hash_init    dq 0xcbbb9d5dc1059ed8, 0x629a292a367cd507,\
7698 dunkaist 513
                           0x9159015a3070dd17, 0x152fecd8f70e5939,\
514
                           0x67332667ffc00b31, 0x8eb44a8768581511,\
515
                           0xdb0c2e0d64f98fa7, 0x47b5481dbefa4fa4
516
 
9216 dunkaist 517
sha2_512._.hash_init    dq 0x6a09e667f3bcc908, 0xbb67ae8584caa73b,\
7698 dunkaist 518
                           0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1,\
519
                           0x510e527fade682d1, 0x9b05688c2b3e6c1f,\
520
                           0x1f83d9abfb41bd6b, 0x5be0cd19137e2179
521
 
9216 dunkaist 522
sha2_384512._.table     dq 0x428a2f98d728ae22, 0x7137449123ef65cd,\
7698 dunkaist 523
                           0xb5c0fbcfec4d3b2f, 0xe9b5dba58189dbbc,\
524
                           0x3956c25bf348b538, 0x59f111f1b605d019,\
525
                           0x923f82a4af194f9b, 0xab1c5ed5da6d8118,\
526
                           0xd807aa98a3030242, 0x12835b0145706fbe,\
527
                           0x243185be4ee4b28c, 0x550c7dc3d5ffb4e2,\
528
                           0x72be5d74f27b896f, 0x80deb1fe3b1696b1,\
529
                           0x9bdc06a725c71235, 0xc19bf174cf692694,\
530
                           0xe49b69c19ef14ad2, 0xefbe4786384f25e3,\
531
                           0x0fc19dc68b8cd5b5, 0x240ca1cc77ac9c65,\
532
                           0x2de92c6f592b0275, 0x4a7484aa6ea6e483,\
533
                           0x5cb0a9dcbd41fbd4, 0x76f988da831153b5,\
534
                           0x983e5152ee66dfab, 0xa831c66d2db43210,\
535
                           0xb00327c898fb213f, 0xbf597fc7beef0ee4,\
536
                           0xc6e00bf33da88fc2, 0xd5a79147930aa725,\
537
                           0x06ca6351e003826f, 0x142929670a0e6e70,\
538
                           0x27b70a8546d22ffc, 0x2e1b21385c26c926,\
539
                           0x4d2c6dfc5ac42aed, 0x53380d139d95b3df,\
540
                           0x650a73548baf63de, 0x766a0abb3c77b2a8,\
541
                           0x81c2c92e47edaee6, 0x92722c851482353b,\
542
                           0xa2bfe8a14cf10364, 0xa81a664bbc423001,\
543
                           0xc24b8b70d0f89791, 0xc76c51a30654be30,\
544
                           0xd192e819d6ef5218, 0xd69906245565a910,\
545
                           0xf40e35855771202a, 0x106aa07032bbd1b8,\
546
                           0x19a4c116b8d2d0c8, 0x1e376c085141ab53,\
547
                           0x2748774cdf8eeb99, 0x34b0bcb5e19b48a8,\
548
                           0x391c0cb3c5c95a63, 0x4ed8aa4ae3418acb,\
549
                           0x5b9cca4f7763e373, 0x682e6ff3d6b2b8a3,\
550
                           0x748f82ee5defb2fc, 0x78a5636f43172f60,\
551
                           0x84c87814a1f0ab72, 0x8cc702081a6439ec,\
552
                           0x90befffa23631e28, 0xa4506cebde82bde9,\
553
                           0xbef9a3f7b2c67915, 0xc67178f2e372532b,\
554
                           0xca273eceea26619c, 0xd186b8c721c0c207,\
555
                           0xeada7dd6cde0eb1e, 0xf57d4f7fee6ed178,\
556
                           0x06f067aa72176fba, 0x0a637dc5a2c898a6,\
557
                           0x113f9804bef90dae, 0x1b710b35131c471b,\
558
                           0x28db77f523047d84, 0x32caab7b40c72493,\
559
                           0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c,\
560
                           0x4cc5d4becb3e42b6, 0x597f299cfc657e2a,\
561
                           0x5fcb6fab3ad6faec, 0x6c44198c4a475817
562
endg