Boost logo

Boost :

Subject: Re: [boost] [xint] Utility question, how to implement...
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2011-03-05 22:44:36


On Sat, 05 Mar 2011 14:00:51 -0600
Rene Rivera <grafikrobot_at_[hidden]> wrote:

>>> [...] My question is: How would I go about implementing the
>>> equivalent in your library?
>>>
>>> NOTE: I can post my code if need be to make this a clearer question.
>>
>> I'm afraid you'll have to, as I can't tell exactly what it does from
>> your description. I'll be happy to try to port it to XInt.
>
> OK, attached is the source code for my class that implements the algo.
> [...]

Thanks. I've taken a look, but unfortunately I don't recall much about
Barrett reduction except that I implemented it once last year, for the
xint::powmod function, and ended up replacing it with Montgomery
reduction for some reason. As that seems to be the key part of your
algorithm, I'd have to re-learn it to answer your question properly.

So the short answer is, someone (you or I) would have to implement
Barrett reduction. Everything after that looks like it would be a
pretty straightforward one-to-one conversion.

-- 
Chad Nelson
Oak Circle Software, Inc.
*
*
*



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk