Advertisement
Guest User

Untitled

a guest
Jun 6th, 2025
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | Cybersecurity | 0 0
  1. # I wrote this some months ago and now I don't know what I did here.
  2. # - technicaljicama
  3.  
  4. wish = [0xa41f32e7,0xe07c2655,0x64fa9774,0xaef1ad81,0x5ab00ac6,0xc3910c8e,0x4498517b, 0x95f61999]
  5.  
  6. a, b, c, d, e, f, g, h = [0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19]
  7. t = 0
  8.  
  9. e0_a = _capsigma0(a)
  10. maj_abc = _maj(a, b, c)
  11. t2_0 = (e0_a + maj_abc) % 2**32
  12. t1_0 = (wish[t] - t2_0) % 2**32
  13. w0 = (t1_0 - h - _capsigma1(e) - _ch(e, f, g) - K[0]) % 2**32
  14.  
  15. ctr = 0
  16. s = hex(w0)
  17. for i in range(0, 7):
  18.     ctr += 1
  19.     t += 1
  20.     h = g
  21.     g = f
  22.     f = e
  23.     e = (d + t1_0) % 2**32
  24.     d = c
  25.     c = b
  26.     b = a
  27.     a = wish[t-1] #(t1_0 + t2_0) % 2**32
  28.  
  29.     e0_new_a = _capsigma0(a)
  30.     maj_new_a_b_c = _maj(a, b, c)
  31.     t2_0 = (e0_new_a + maj_new_a_b_c) % 2**32
  32.     t1_0 = (wish[t] - t2_0) % 2**32
  33.     w1 = (t1_0 - h - _capsigma1(e) - _ch(e, f, g) - K[ctr]) % 2**32
  34.     s += hex(w1)
  35.  
  36. print(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement