MCPcopy Index your code
hub / github.com/petertodd/python-bitcoinlib / fi

Function fi

bitcoin/core/contrib/ripemd160.py:52–65  ·  view source on GitHub ↗

The f1, f2, f3, f4, and f5 functions from the specification.

(x, y, z, i)

Source from the content-addressed store, hash-verified

50
51
52def 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
68def rol(x, i):

Callers 1

compressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected