On Friday, July 13, 2018 at 1:19:33 PM UTC-4, Vadym Fedyukovych wrote:
>
> On Fri, Jul 13, 2018 at 07:57:41AM -0700, Jeffrey Walton wrote: 
> > On Friday, July 13, 2018 at 9:43:24 AM UTC-4, Vadym Fedyukovych wrote: 
> > > 
> > > may I ask for status of negative Integer please? 
> > > I'm interested in modular exponentiation in the first place. 
> > > 
> > > I'm using conditional MultiplicativeInverse() at the moment. 
> > > What is best practice? 
> > > Any pointers to actually fix the issue please? 
> > > 
> > 
> > What issue? 
> > 
> > We have a wiki page at https://www.cryptopp.com/wiki/Integer that might 
> be 
> > useful. 
>
> Ok, not sure whether this is an issue or a feature. 
> if(pwr < 0) 
>   e = ModularArithmetic.Exponentiate( -pwr) 
>   result = .MultiplicativeInverse(e) 
> else 
>   result = ModularArithmetic.Exponentiate(pwr) 
>

Yes, that's fine. You can also find the multiplicative inverse, and then 
use a_times_b_mod_c.

Also see https://math.stackexchange.com/q/1015713/398889 and 
https://www.cryptopp.com/docs/ref/nbtheory_8h.html .

Jeff

-- 
You received this message because you are subscribed to "Crypto++ Users". More 
information about Crypto++ and this group is available at 
http://www.cryptopp.com and 
http://groups.google.com/forum/#!forum/cryptopp-users.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to