The f1, f2, f3, f4, and f5 functions from the specification.
(x, y, z, i)
| 49 | |
| 50 | |
| 51 | def fi(x, y, z, i): |
| 52 | """The f1, f2, f3, f4, and f5 functions from the specification.""" |
| 53 | if i == 0: |
| 54 | return x ^ y ^ z |
| 55 | elif i == 1: |
| 56 | return (x & y) | (~x & z) |
| 57 | elif i == 2: |
| 58 | return (x | ~y) ^ z |
| 59 | elif i == 3: |
| 60 | return (x & z) | (y & ~z) |
| 61 | elif i == 4: |
| 62 | return x ^ (y | ~z) |
| 63 | else: |
| 64 | assert False |
| 65 | |
| 66 | |
| 67 | def rol(x, i): |