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
SHA3224_BLOCK_SIZE      = 144
-
 
20
SHA3256_BLOCK_SIZE      = 136
-
 
21
SHA3384_BLOCK_SIZE      = 104
-
 
22
SHA3512_BLOCK_SIZE      = 72
-
 
23
SHA3MAX_BLOCK_SIZE      = SHA3224_BLOCK_SIZE
-
 
24
 
-
 
25
SHA3_INIT_SIZE          = 200
-
 
26
 
-
 
27
SHA3224_HASH_SIZE       = 28
-
 
28
SHA3256_HASH_SIZE       = 32
-
 
29
SHA3384_HASH_SIZE       = 48
-
 
30
SHA3512_HASH_SIZE       = 64
-
 
31
 
-
 
32
SHA3_ALIGN              = 16
-
 
33
SHA3_ALIGN_MASK         = SHA3_ALIGN-1
-
 
34
 
-
 
35
struct ctx_sha3
-
 
36
        hash            rb SHA3_INIT_SIZE
-
 
37
                        rb SHA3_ALIGN - (SHA3_INIT_SIZE mod SHA3_ALIGN)
-
 
38
        block           rb SHA3MAX_BLOCK_SIZE
-
 
39
                        rb SHA3_ALIGN - (SHA3MAX_BLOCK_SIZE mod SHA3_ALIGN)
-
 
40
        index           rd 1
-
 
41
        block_size      rd 1
-
 
42
        rounds_cnt      rd 1
-
 
43
                        rd 1    ; align
-
 
44
        ; tmp vars
-
 
45
        C               rq 5
-
 
46
        D               rq 5
-
 
47
ends
-
 
48
 
17
 
49
 
18
 
50
macro sha3._.rol_xor nd, ncl, ncr
19
macro sha3._.rol_xor nd, ncl, ncr
51
{
20
{
52
        movq    mm0, [C + 8*(ncl)]
21
        movq    mm0, [C + 8*(ncl)]
Line 322... Line 291...
322
 
291
 
323
        ret
292
        ret
Line -... Line 293...
-
 
293
endp
-
 
294
 
-
 
295
 
-
 
296
sha3224.update = sha3.update
324
endp
297
sha3256.update = sha3.update
325
 
298
sha3384.update = sha3.update
326
 
299
sha3512.update = sha3.update
327
proc sha3.update _ctx, _msg, _size
300
proc sha3.update _ctx, _msg, _size
328
  .next_block:
301
  .next_block:
Line 380... Line 353...
380
  .quit:
353
  .quit:
381
        ret
354
        ret
382
endp
355
endp
Line -... Line 356...
-
 
356
 
-
 
357
 
-
 
358
sha3224.final = sha3.final
-
 
359
sha3256.final = sha3.final
383
 
360
sha3384.final = sha3.final
384
 
361
sha3512.final = sha3.final
385
proc sha3.final _ctx
362
proc sha3.final _ctx
386
        pushad
363
        pushad
387
        mov     ebx, [_ctx]
364
        mov     ebx, [_ctx]