projects
/
nmigen-gf.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Move files from libreriscv.git/openpower/sv/bitmanip/
[nmigen-gf.git]
/
gf_reference
/
gfbmul.py
1
from
.
state
import
ST
2
from
.
decode_reducing_polynomial
import
decode_reducing_polynomial
3
from
.
clmul
import
clmul
4
from
.
cldivrem
import
cldivrem
5
6
7
def
gfbmul
(
a
,
b
):
8
product
=
clmul
(
a
,
b
)
9
red_poly
=
decode_reducing_polynomial
()
10
q
,
r
=
cldivrem
(
product
,
red_poly
,
width
=
ST
.
XLEN
+
1
)
11
return
r