
On Sat, 05 Mar 2011 14:00:51 -0600 Rene Rivera <grafikrobot@gmail.com> 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. * * *