?? sha1.idel
字號(hào):
\ Mostly generated by examples/borednet/sha1.py\ Compute the SHA-1 hash of a string of 2 million "a"s.ints: H0 0 0 0 0;intsints: W0 0 0 00 0 0 00 0 0 00 0 0 0;intsints: hbits 0 ;intsints: lbits 0 ;intsints: SHA1-IV0x674523010xEFCDAB890x98BADCFE0x103254760xC3D2E1F0;intsbss-data: collision 100string: target "09948flame"bss-data: target-digest 20bss-data: try 100def 0 1 main 4096 0 find-collision u. '\n' emit try target.size 16 + type '\n' emit 0 ;#define desiredbits 8def 2 1 find-collision { tries trial -- try target.addr target.size memcpy try target.size + 7 trial sprintf-hex desiredbits 7 and { partial-byte -- desiredbits 3 >>> 1 8 partial-byte - << 1 - -1 xor { partial-byte-index partial-byte-mask -- partial-byte-index partial-byte if 1 + then { check-bytes -- target-digest target.addr target.size digest partial-byte if target-digest partial-byte-index + { a -- a c@ partial-byte-mask and a c! } then try target.size + 8 + 7 0 sprintf-hex target.size 16 + tries 8 + 4 >>> { try-strlen tries2 -- partial-byte partial-byte-index partial-byte-mask check-bytes try-strlen tries2 trial 0 outer-loop } } } } } ;bss-data: precomputed-ctx 92def 8 1 outer-loop { try-strlen tries2 trial i -- i tries2 < if SHA1-init try target.size + 8 + 7 trial sprintf-hex try try-strlen 1 - type 10 emit try try-strlen 1 - SHA1-update precomputed-ctx H 92 wordcpy try-strlen tries2 trial i 0 inner-loop else { partial-byte partial-byte-index partial-byte-mask check-bytes -- 0 } then } ;bss-data: last-char 4string: hex "0123456789abcdef"def 9 1 inner-loop { j -- j 16 < if H precomputed-ctx 92 wordcpy hex.addr j + c@ last-char c! last-char 1 SHA1-update SHA1-final H c@ target-digest c@ - if '.' emit j 1 + inner-loop else 'C' emit { partial-byte partial-byte-index partial-byte-mask check-bytes try-strlen tries2 trial i -- partial-byte if H partial-byte-index + { a -- a c@ partial-byte-mask and a c! } then target-digest H check-bytes memcmp if 'D' emit partial-byte partial-byte-index partial-byte-mask check-bytes try-strlen tries2 trial i j 1 + inner-loop else '\n' emit hex.addr j + c@ try try-strlen + 1 - c! collision try try-strlen memcpy dump-H i 4 << j + 1 + then } then else '|' emit { trial i -- trial 16 + i 1 + outer-loop } then } ;
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -