Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

random prime number generator for BigInt BigUint #4

Open
allan-simon opened this issue Jun 29, 2015 · 0 comments
Open

random prime number generator for BigInt BigUint #4

allan-simon opened this issue Jun 29, 2015 · 0 comments

Comments

@allan-simon
Copy link

I was wondering if this crate was the place for :

  • support of is_prime etc. for BigInt and BigUint from the num crate using miller-rabin
  • a weak but working random prime BigUint generator based on the is_prime above

of course i'm not asking that out of the blue :) the fact is i'm trying to reimplement in rust , a client-side skype library in rust , and the original code generates public / private key of 512 bits using this very simple algorithm

def random_prime(low, high):
    r = random.randint(low, high)

    if r%2 == 0:
        r+=1

    while True:
        if miller_rabin(r) == True:
            break
        r+=2

    return r 

so getting something similar for rust, would be of a great help , and as it's somethin i think not specific to skype, i was thinking it was a good idea to put it in an external crate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants