Move files from libreriscv.git/openpower/sv/bitmanip/
[nmigen-gf.git] / gf_reference / clmul.py
1 def clmul(a, b):
2 x = 0
3 i = 0
4 while b >> i != 0:
5 if (b >> i) & 1:
6 x ^= a << i
7 i += 1
8 return x