Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # I wrote this some months ago and now I don't know what I did here.
- # - technicaljicama
- wish = [0xa41f32e7,0xe07c2655,0x64fa9774,0xaef1ad81,0x5ab00ac6,0xc3910c8e,0x4498517b, 0x95f61999]
- a, b, c, d, e, f, g, h = [0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19]
- t = 0
- e0_a = _capsigma0(a)
- maj_abc = _maj(a, b, c)
- t2_0 = (e0_a + maj_abc) % 2**32
- t1_0 = (wish[t] - t2_0) % 2**32
- w0 = (t1_0 - h - _capsigma1(e) - _ch(e, f, g) - K[0]) % 2**32
- ctr = 0
- s = hex(w0)
- for i in range(0, 7):
- ctr += 1
- t += 1
- h = g
- g = f
- f = e
- e = (d + t1_0) % 2**32
- d = c
- c = b
- b = a
- a = wish[t-1] #(t1_0 + t2_0) % 2**32
- e0_new_a = _capsigma0(a)
- maj_new_a_b_c = _maj(a, b, c)
- t2_0 = (e0_new_a + maj_new_a_b_c) % 2**32
- t1_0 = (wish[t] - t2_0) % 2**32
- w1 = (t1_0 - h - _capsigma1(e) - _ch(e, f, g) - K[ctr]) % 2**32
- s += hex(w1)
- print(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement