-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
If the team still using the function ->public-key from the namespace bips.xmr-utils then I purpose to change the following code:
(defn exp-mod
"Calculates the result of a modular exponentiation of a given base `b`, exponent `e`, and modulus `m`."
[b e m]
(if (= e 0)
(biginteger 1)
(let [t (atom (.mod (.pow (exp-mod (biginteger b) (.divide (biginteger e) (biginteger 2)) m) 2) m))]
(when (not= (.and (biginteger e) (biginteger 1)) 0)
(reset! t (.mod (.multiply @t (biginteger b)) m)))
@t)))with
(defn exp-mod
[b e m]
(.modPow b e m))The internal implementation from BigInteger reduces the time by 3 seconds approximately. You can check the change here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels