Re: 128 bit integer code needed



On Apr 29, 1:43 pm, jacob navia <ja...@xxxxxxxxxx> wrote:
user923005 wrote:
On Apr 29, 5:13 am, jacob navia <ja...@xxxxxxxxxx> wrote:
Hi

I am incorporating 128 Bit integer code into lcc-win and it would be
nice to have some code to test this feature.

Has anyone here code that uses 128 bit integers?

Thanks in advance

P.S. This feature is now native in the 64 bit version, i.e.
not using operator overloading as in the 32 bit version.

http://svn.gnucash.org/docs/HEAD/group__Math128.html
http://developer.apple.com/hardwaredrivers/ve/downloads/vBigNum.tgz

If you check out news:sci.crypt, you will find a boatload of this
stuff.

Thanks for the tips

Here are some integer multiplication benchmarks:
http://cr.yp.to/speed/mult.html

Here are some crypto links:
http://directory.google.com/Top/Science/Math/Applications/Communication_Theory/Cryptography/Programming_Libraries/
<OT>
I don't know if you can use C++, but the Crypto++ library has an
Integer class with all the operations defined.
integer.h(217): Integer& operator=(const Integer& t);
integer.h(220): Integer& operator+=(const Integer& t);
integer.h(222): Integer& operator-=(const Integer& t);
integer.h(224): Integer& operator*=(const Integer& t) {return *this =
Times(t);}
integer.h(226): Integer& operator/=(const Integer& t) {return *this =
DividedBy(t);}
integer.h(228): Integer& operator%=(const Integer& t) {return *this =
Modulo(t);}
integer.h(230): Integer& operator/=(word t) {return *this =
DividedBy(t);}
integer.h(232): Integer& operator%=(word t) {return *this =
Integer(POSITIVE, 0, Modulo(t));}
integer.h(235): Integer& operator<<=(size_t);
integer.h(237): Integer& operator>>=(size_t);
integer.h(273): bool operator!() const;
integer.h(275): Integer operator+() const {return *this;}
integer.h(277): Integer operator-() const;
integer.h(279): Integer& operator++();
integer.h(281): Integer& operator--();
integer.h(283): Integer operator++(int) {Integer temp = *this; +
+*this; return temp;}
integer.h(285): Integer operator--(int) {Integer temp = *this; --
*this; return temp;}
integer.h(313): Integer operator>>(size_t n) const {return
Integer(*this)>>=n;}
integer.h(315): Integer operator<<(size_t n) const {return
Integer(*this)<<=n;}
integer.h(360): friend CRYPTOPP_DLL std::istream& CRYPTOPP_API
operator>>(std::istream& in, Integer &a);
integer.h(362): friend CRYPTOPP_DLL std::ostream& CRYPTOPP_API
operator<<(std::ostream& out, const Integer &a);
integer.h(383):inline bool operator==(const CryptoPP::Integer& a,
const CryptoPP::Integer& b) {return a.Compare(b)==0;}
integer.h(385):inline bool operator!=(const CryptoPP::Integer& a,
const CryptoPP::Integer& b) {return a.Compare(b)!=0;}
integer.h(387):inline bool operator> (const CryptoPP::Integer& a,
const CryptoPP::Integer& b) {return a.Compare(b)> 0;}
integer.h(389):inline bool operator>=(const CryptoPP::Integer& a,
const CryptoPP::Integer& b) {return a.Compare(b)>=0;}
integer.h(391):inline bool operator< (const CryptoPP::Integer& a,
const CryptoPP::Integer& b) {return a.Compare(b)< 0;}
integer.h(393):inline bool operator<=(const CryptoPP::Integer& a,
const CryptoPP::Integer& b) {return a.Compare(b)<=0;}
integer.h(395):inline CryptoPP::Integer operator+(const
CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Plus(b);}
integer.h(397):inline CryptoPP::Integer operator-(const
CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Minus(b);}
integer.h(399):inline CryptoPP::Integer operator*(const
CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Times(b);}
integer.h(401):inline CryptoPP::Integer operator/(const
CryptoPP::Integer &a, const CryptoPP::Integer &b) {return
a.DividedBy(b);}
integer.h(403):inline CryptoPP::Integer operator%(const
CryptoPP::Integer &a, const CryptoPP::Integer &b) {return
a.Modulo(b);}
integer.h(405):inline CryptoPP::Integer operator/(const
CryptoPP::Integer &a, CryptoPP::word b) {return a.DividedBy(b);}
integer.h(407):inline CryptoPP::word operator%(const CryptoPP::Integer
&a, CryptoPP::word b) {return a.Modulo(b);}
</OT>

.



Relevant Pages

  • Re: const
    ... You specifically claim that "const" is something "C++ gets hand down correct". ... The rest of your post reads like the usual religious-war stuff: you presuppose the superiority, and then use that supposition as "proof" that someone with a counter-argument must just not understand the superior feature. ... As for the discussion on the topic by others, there's this great Internet tool out there. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: What is polymorphism?
    ... But operator overloading *is* polymorphism. ... both the operator syntax and the function syntax ends ... const bar&, const bar&) are two differently named functions. ...
    (comp.object)
  • Re: const
    ... > So looking at the above, it seems a high cost for a feature that has little ... static typing - currently being hotly debated on another thread ... like const. ...
    (comp.programming)
  • Re: Boxing and Unboxing ??
    ... still haven't figured out how to fit it cleanly into the language (and ... programmer decides to abide by it. ... even if you want to abide by a "const" contract imposed upon you, ... I trust the C# team to introduce this feature ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Using ref
    ... As long as the exception exists, it's trivial for someone to modify something declared as "const" in this context. ... still overwrite the innards if you explicitly work to do so. ... any more flawed than any of the other languages people use on a daily ... It's whether it's important enough for someone to described a language without the feature as "deeply flawed". ...
    (microsoft.public.dotnet.languages.csharp)