> From: Mankowski, Chris [mailto:cmankow...@nfp.com] > > I would be interested in seeing implicit operators in BouncyCastle¹s > BigInt, and don¹t see them in the most recent release of BC. > > Does anyone have an objection to adding these methods, or have a better > approach?
Haven't seen anybody else respond, so I'll make my response just to keep the conversation alive - I'm not sure why you would want those things. In crypto, the main reason for existence of BigInteger is things like large random primes and defining named curves, etc. (128 bits to 4096 bits or thereabouts). The reason arithmetic operations haven't been created is because they're not used for anything crypto-related. Conversion from long to BigInteger kind of defeats the purpose of BigInteger, which is to handle number that are much larger than 64 bits. BigInteger already supports constructor from a string, so technically you could convert a long to a BigInteger by using new BigInteger(someLong.ToString()) .Net does have a BigInteger that supports arithmetic operations (and comparisons, check for odd/even, etc as you described). System.Numerics.BigInteger. I would imagine this is probably what you want to use, if you want to perform those operations. The one in BouncyCastle - Org.BouncyCastle.Math.BigInteger, is only used for crypto stuff in BC. The one that's included in .Net is a general purpose BigInteger. No sense in recreating it... I don't have any objection, I just don't perceive a demand to justify any effort.