Subversion Repositories Kolibri OS

Rev

Rev 6461 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6461 Rev 6465
Line 14... Line 14...
14
;
14
;
15
;    You should have received a copy of the GNU General Public License
15
;    You should have received a copy of the GNU General Public License
16
;    along with this program.  If not, see .
16
;    along with this program.  If not, see .
Line 17... Line -...
17
 
-
 
18
 
-
 
19
SHA384512_BLOCK_SIZE = 128
-
 
20
SHA384512_INIT_SIZE  = 64
-
 
21
 
-
 
22
SHA384_HASH_SIZE     = 48
-
 
23
SHA512_HASH_SIZE     = 64
-
 
24
 
-
 
25
SHA384512_ALIGN      = 16
-
 
26
SHA384512_ALIGN_MASK = SHA384512_ALIGN - 1
-
 
27
 
-
 
28
struct ctx_sha384512
-
 
29
        hash            rb SHA384512_INIT_SIZE
-
 
30
        block           rb SHA384512_BLOCK_SIZE
-
 
31
        index           rd 1
-
 
32
        msglen_0        rd 1
-
 
33
        msglen_1        rd 1
-
 
34
        msglen_2        rd 1
-
 
35
        msglen_3        rd 1
-
 
36
                        rd 3    ; align
-
 
37
        ; tmp vars
-
 
38
        w               rq 80
-
 
39
        A               rq 1
-
 
40
        B               rq 1
-
 
41
        C               rq 1
-
 
42
        D               rq 1
-
 
43
        E               rq 1
-
 
44
        F               rq 1
-
 
45
        G               rq 1
-
 
46
        H               rq 1
-
 
47
        temp            rq 1
-
 
48
ends
-
 
49
 
17
 
50
 
18
 
51
macro sha384512._.chn x, y, z
19
macro sha384512._.chn x, y, z
52
{
20
{
53
        movq    mm0, [y]
21
        movq    mm0, [y]
Line 348... Line 316...
348
 
316
 
349
        ret
317
        ret
350
restore w,A,B,C,D,E,F,G,H,temp
318
restore w,A,B,C,D,E,F,G,H,temp
Line 351... Line -...
351
endp
-
 
-
 
319
endp
352
 
320
 
353
 
321
sha512.update = sha384.update
354
proc sha384512.update _ctx, _msg, _size
322
proc sha384.update _ctx, _msg, _size
355
        mov     ebx, [_ctx]
323
        mov     ebx, [_ctx]
356
        mov     ecx, [_size]
324
        mov     ecx, [_size]
357
        add     [ebx + ctx_sha384512.msglen_0], ecx
325
        add     [ebx + ctx_sha384512.msglen_0], ecx
Line 407... Line 375...
407
 
375
 
408
        ret
376
        ret
Line -... Line 377...
-
 
377
endp
409
endp
378
 
410
 
379
 
411
 
380
sha512.final = sha384.final
412
proc sha384512.final _ctx
381
proc sha384.final _ctx
413
        mov     ebx, [_ctx]
382
        mov     ebx, [_ctx]
414
        lea     edi, [ebx + ctx_sha384512.block]
383
        lea     edi, [ebx + ctx_sha384512.block]