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