[openssl-users] BN_exp

Jeffrey Walton noloader at gmail.com
Fri Jan 15 15:15:50 UTC 2016


On Fri, Jan 15, 2016 at 10:05 AM, Philippe Levesque
<p_levesque555 at hotmail.com> wrote:
> Hi
>
> I wanted some input on a problem. I need to use bn_exp for some big
> calculation but I hit a limit where it take age to get a result (after two
> day I stopped the process).

Pure exponentiations without a modular reduction can quickly spill
into the page file. It brings a machine to its knees because of memory
growth,

> I tried for fun to run a bn_mod_exp and it took
> 2 seconds.

Yes, usually a much better choice.

> Is there a tip there to get the exp result from bn_mod_exp ? or to optimize
> bn_exp ?

bn_mod_exp computes r = a^p mod n. You already have the exponent (p)
and you get the result (r).

What are you trying to accomplish? Can you sketch the pseudo-code?

Jeff


More information about the openssl-users mailing list