From: Luke Kenneth Casson Leighton Date: Mon, 7 Mar 2022 22:37:11 +0000 (+0000) Subject: use full polynomial in gf_invert() X-Git-Tag: opf_rfc_ls005_v1~3123 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=15b1d20fce21a9f4488dce744b4a68a13615a826;p=libreriscv.git use full polynomial in gf_invert() --- diff --git a/openpower/sv/gf2.py b/openpower/sv/gf2.py index 6798cd1f6..420034d46 100644 --- a/openpower/sv/gf2.py +++ b/openpower/sv/gf2.py @@ -76,7 +76,7 @@ def xgcd(a, b): # https://ftp.libre-soc.org/ARITH18_Kobayashi.pdf def gf_invert(a) : - s = polyred + s = getGF2() # get the full polynomial (including the MSB) r = a v = 0 u = 1 @@ -140,5 +140,5 @@ if __name__ == "__main__": y1 = gf_invert(y) z1 = multGF2(z, y1) - print(hex(polyred), hex(y1), hex(z1)) + print(hex(polyred), hex(y1), hex(x), "==", hex(z1))