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

Method mul

src/minisketch/tests/pyminisketch.py:105–113  ·  view source on GitHub ↗

Multiply x by y in GF(2^field_size).

(self, x, y)

Source from the content-addressed store, hash-verified

103 return x
104
105 def mul(self, x, y):
106 """Multiply x by y in GF(2^field_size)."""
107 ret = 0
108 while y:
109 if y & 1:
110 ret ^= x
111 y >>= 1
112 x = self.mul2(x)
113 return ret
114
115 def sqr(self, x):
116 """Square x in GF(2^field_size)."""

Callers 7

sqrMethod · 0.95
field_size_testMethod · 0.95
field_size_testMethod · 0.95
poly_monicFunction · 0.45
poly_divmodFunction · 0.45
berlekamp_masseyFunction · 0.45
addMethod · 0.45

Calls 1

mul2Method · 0.95

Tested by

no test coverage detected