PC Review


Reply
Thread Tools Rate Thread

BigInteger.probablePrime in C#.Net???

 
 
imranisb
Guest
Posts: n/a
 
      10th Jul 2008
Hi,

Im developing RSA cryptography based application in VC#.Net 2.0 and
need to use "BigInteger.probablePrime()". I know that VC#.Net 2.0
doesn't have the BigInteger class but found that one buddy created
BigInteger class but it is missing some overloading function like
BigInteger.probablePrime(). The code of the BigInteger class developed
in the C#.Net can be found here:
http://www.codeproject.com/KB/cs/biginteger.aspx

Quick suggestions are always welcome.
Thanks in advance.
 
Reply With Quote
 
 
 
 
Pavel Minaev
Guest
Posts: n/a
 
      10th Jul 2008
On Jul 10, 2:10*pm, imranisb <imran...@gmail.com> wrote:
> Hi,
>
> Im developing RSA cryptography based application in VC#.Net 2.0 and
> need to use "BigInteger.probablePrime()". I know that VC#.Net 2.0
> doesn't have the BigInteger class but found that one buddy created
> BigInteger class but it is missing some overloading function like
> BigInteger.probablePrime(). The code of the BigInteger class developed
> in the C#.Net can be found here:http://www.codeproject.com/KB/cs/biginteger.aspx


What, exactly, should such a method do?
 
Reply With Quote
 
Family Tree Mike
Guest
Posts: n/a
 
      10th Jul 2008
If you mean the Java BigInteger class and method by that name, then I think
the easiest thing is just wrap that method in a java console app and run it
from c#. I suspect implimenting that method in c# is fairly involved...

"imranisb" wrote:

> Hi,
>
> Im developing RSA cryptography based application in VC#.Net 2.0 and
> need to use "BigInteger.probablePrime()". I know that VC#.Net 2.0
> doesn't have the BigInteger class but found that one buddy created
> BigInteger class but it is missing some overloading function like
> BigInteger.probablePrime(). The code of the BigInteger class developed
> in the C#.Net can be found here:
> http://www.codeproject.com/KB/cs/biginteger.aspx
>
> Quick suggestions are always welcome.
> Thanks in advance.
>

 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      10th Jul 2008
Pavel Minaev wrote:
> On Jul 10, 2:10 pm, imranisb <imran...@gmail.com> wrote:
>> Im developing RSA cryptography based application in VC#.Net 2.0 and
>> need to use "BigInteger.probablePrime()". I know that VC#.Net 2.0
>> doesn't have the BigInteger class but found that one buddy created
>> BigInteger class but it is missing some overloading function like
>> BigInteger.probablePrime(). The code of the BigInteger class developed
>> in the C#.Net can be found here:http://www.codeproject.com/KB/cs/biginteger.aspx

>
> What, exactly, should such a method do?


http://java.sun.com/javase/6/docs/api/java/math/BigInteger.html#isProbablePrime(int)

would be a good guess.

Arne
 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      10th Jul 2008
Family Tree Mike wrote:
> If you mean the Java BigInteger class and method by that name, then I think
> the easiest thing is just wrap that method in a java console app and run it
> from c#. I suspect implimenting that method in c# is fairly involved...


The easiest would be to do:

using System;

using java.math;

namespace E
{
public class Program
{
public static void Main(string[] args)
{
BigInteger bi = new BigInteger("12345");
Console.WriteLine(bi.isProbablePrime(10));
}
}
}

since BigInteger was part of Java 1.1 and therefore exist
in J#.

There is just one problem: the implementation !

It is horrible slow.

Arne


 
Reply With Quote
 
Family Tree Mike
Guest
Posts: n/a
 
      11th Jul 2008
But that isn't available in VS 2008, is it?

"Arne Vajhøj" <(E-Mail Removed)> wrote in message
news:48768c28$0$90265$(E-Mail Removed)...
> Family Tree Mike wrote:
>> If you mean the Java BigInteger class and method by that name, then I
>> think the easiest thing is just wrap that method in a java console app
>> and run it from c#. I suspect implimenting that method in c# is fairly
>> involved...

>
> The easiest would be to do:
>
> using System;
>
> using java.math;
>
> namespace E
> {
> public class Program
> {
> public static void Main(string[] args)
> {
> BigInteger bi = new BigInteger("12345");
> Console.WriteLine(bi.isProbablePrime(10));
> }
> }
> }
>
> since BigInteger was part of Java 1.1 and therefore exist
> in J#.
>
> There is just one problem: the implementation !
>
> It is horrible slow.
>
> Arne
>
>


 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      11th Jul 2008
Family Tree Mike wrote:
> "Arne Vajhøj" <(E-Mail Removed)> wrote in message
> news:48768c28$0$90265$(E-Mail Removed)...
>> Family Tree Mike wrote:
>>> If you mean the Java BigInteger class and method by that name, then I
>>> think the easiest thing is just wrap that method in a java console
>>> app and run it from c#. I suspect implimenting that method in c# is
>>> fairly involved...

>>
>> The easiest would be to do:
>>
>> using System;
>>
>> using java.math;
>>
>> namespace E
>> {
>> public class Program
>> {
>> public static void Main(string[] args)
>> {
>> BigInteger bi = new BigInteger("12345");
>> Console.WriteLine(bi.isProbablePrime(10));
>> }
>> }
>> }
>>
>> since BigInteger was part of Java 1.1 and therefore exist
>> in J#.
>>
>> There is just one problem: the implementation !
>>
>> It is horrible slow.


> But that isn't available in VS 2008, is it?


VS 2008 comes with .NET 3.5, .NET 3.5 uses .NET 2.0 CLR, J# runtime
is available for .NET 2.0.

Why should it not be possible to make a ref to vjslib.dll in VS 2008 ?

Arne
 
Reply With Quote
 
Family Tree Mike
Guest
Posts: n/a
 
      11th Jul 2008
I cannot find such a dll on my system. I'm running VS 2008 pro. I found a
link that says it needs to be separately installed from this link:
http://msdn.microsoft.com/en-us/vjsharp/bb188598.aspx. It isn't clear to me
what version you need to target. In other words, would you need to target
2.0 and lose LINQ to get this?



"Arne Vajhøj" <(E-Mail Removed)> wrote in message
news:4876a91d$0$90275$(E-Mail Removed)...
> Family Tree Mike wrote:
>> "Arne Vajhøj" <(E-Mail Removed)> wrote in message
>> news:48768c28$0$90265$(E-Mail Removed)...
>>> Family Tree Mike wrote:
>>>> If you mean the Java BigInteger class and method by that name, then I
>>>> think the easiest thing is just wrap that method in a java console app
>>>> and run it from c#. I suspect implimenting that method in c# is fairly
>>>> involved...
>>>
>>> The easiest would be to do:
>>>
>>> using System;
>>>
>>> using java.math;
>>>
>>> namespace E
>>> {
>>> public class Program
>>> {
>>> public static void Main(string[] args)
>>> {
>>> BigInteger bi = new BigInteger("12345");
>>> Console.WriteLine(bi.isProbablePrime(10));
>>> }
>>> }
>>> }
>>>
>>> since BigInteger was part of Java 1.1 and therefore exist
>>> in J#.
>>>
>>> There is just one problem: the implementation !
>>>
>>> It is horrible slow.

>
> > But that isn't available in VS 2008, is it?

>
> VS 2008 comes with .NET 3.5, .NET 3.5 uses .NET 2.0 CLR, J# runtime
> is available for .NET 2.0.
>
> Why should it not be possible to make a ref to vjslib.dll in VS 2008 ?
>
> Arne


 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      11th Jul 2008
Family Tree Mike wrote:
> "Arne Vajhøj" <(E-Mail Removed)> wrote in message
> news:4876a91d$0$90275$(E-Mail Removed)...
>> Family Tree Mike wrote:
>>> "Arne Vajhøj" <(E-Mail Removed)> wrote in message
>>> news:48768c28$0$90265$(E-Mail Removed)...
>>>> Family Tree Mike wrote:
>>>>> If you mean the Java BigInteger class and method by that name, then
>>>>> I think the easiest thing is just wrap that method in a java
>>>>> console app and run it from c#. I suspect implimenting that method
>>>>> in c# is fairly involved...
>>>>
>>>> The easiest would be to do:
>>>>
>>>> using System;
>>>>
>>>> using java.math;
>>>>
>>>> namespace E
>>>> {
>>>> public class Program
>>>> {
>>>> public static void Main(string[] args)
>>>> {
>>>> BigInteger bi = new BigInteger("12345");
>>>> Console.WriteLine(bi.isProbablePrime(10));
>>>> }
>>>> }
>>>> }
>>>>
>>>> since BigInteger was part of Java 1.1 and therefore exist
>>>> in J#.
>>>>
>>>> There is just one problem: the implementation !
>>>>
>>>> It is horrible slow.

>>
>> > But that isn't available in VS 2008, is it?

>>
>> VS 2008 comes with .NET 3.5, .NET 3.5 uses .NET 2.0 CLR, J# runtime
>> is available for .NET 2.0.
>>
>> Why should it not be possible to make a ref to vjslib.dll in VS 2008 ?

> I cannot find such a dll on my system. I'm running VS 2008 pro. I
> found a link that says it needs to be separately installed from this
> link: http://msdn.microsoft.com/en-us/vjsharp/bb188598.aspx. It isn't
> clear to me what version you need to target. In other words, would you
> need to target 2.0 and lose LINQ to get this?


I think that is the kit.

No - I can not see any reason to target 2.0 unless the target
system only has 2.0 !

Arne
 
Reply With Quote
 
imranisb
Guest
Posts: n/a
 
      12th Jul 2008
Thanks guys for your healthy suggestions.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Usage example for BigInteger and C++ GeorgCantor Microsoft Dot NET Framework 14 27th Jan 2010 11:35 PM
Re: Usage example for BigInteger and C++ PvdG42 Microsoft VC .NET 6 19th Jan 2010 06:29 PM
BigInteger and BigDecimal [equivalents] for VB.NET? Bogus Exception Microsoft VB .NET 8 17th May 2009 03:01 AM
BigInteger and BigDecimal [equivalents] for VB.NET? Bogus Exception Microsoft VB .NET 0 16th May 2009 06:08 PM
Extensions to my BigInteger and BigRational classes jehugaleahsa@gmail.com Microsoft C# .NET 2 16th Nov 2007 10:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:02 AM.