MCPcopy Create free account
hub / github.com/ElementsProject/elements / fi

Function fi

test/functional/test_framework/ripemd160.py:51–64  ·  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

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

Callers 1

compressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected