BigInteger.probablePrime in C#.Net???

  • Thread starter Thread starter imranisb
  • Start date Start date
I

imranisb

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.
 
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?
 
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...
 
Family said:
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
 
But that isn't available in VS 2008, is it?

Arne Vajhøj said:
Family said:
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
 
Family said:
Arne Vajhøj said:
Family said:
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
 
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 said:
Family said:
Arne Vajhøj said:
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
 
Family said:
Arne Vajhøj said:
Family said:
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
 
Back
Top