diff --git a/gogf127/gogf127.go b/gogf127/gogf127.go index cff06a3..8ba33e9 100644 --- a/gogf127/gogf127.go +++ b/gogf127/gogf127.go @@ -160,23 +160,24 @@ func Add(a, b, c *GF127) { } // Mul sets c to a*b. +// TODO make it work in-place without allocations // TODO optimization: no need to perform shift by i every time, cache results func Mul(a, b, c *GF127) { - c[0] = 0 - c[1] = 0 + r := new(GF127) d := new(GF127) for i := uint(0); i < 64; i++ { if b[0]&(1<