Fast bignum square computation

后端 未结 2 682
一整个雨季
一整个雨季 2020-11-22 02:49

To speed up my bignum divisons I need to speed up operation y = x^2 for bigints which are represented as dynamic arrays of unsigned DWORDs. To be clear:

相关标签:
2条回答
  • 2020-11-22 03:52

    If you're looking to write a new better exponent you might have to write it in assembly. This is the code from golang.

    https://code.google.com/p/go/source/browse/src/pkg/math/exp_amd64.s

    0 讨论(0)
  • 2020-11-22 03:56

    If I understand your algorithm correctly, it seems O(n^2) where n is the number of digits.

    Have you looked at Karatsuba Algorithm? It speeds up multiplication using the divide and conquer approach. It may be worth taking a look at.

    0 讨论(0)
提交回复
热议问题