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

Method mul2

src/minisketch/tests/pyminisketch.py:98–103  ·  view source on GitHub ↗

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

(self, x)

Source from the content-addressed store, hash-verified

96 assert self._modulus is not None
97
98 def mul2(self, x):
99 """Multiply x by 2 in GF(2^field_size)."""
100 x <<= 1
101 if x >> self.field_size:
102 x ^= self._modulus
103 return x
104
105 def mul(self, x, y):
106 """Multiply x by y in GF(2^field_size)."""

Callers 3

mulMethod · 0.95
field_size_testMethod · 0.95
rec_splitFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected