Thanks to visit codestin.com
Credit goes to github.com

Skip to content

random prime number generator for BigInt BigUint  #4

@allan-simon

Description

@allan-simon

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions