Skip to content

Miller-Rabin test implement by C which can generate 1024 bit prime

Notifications You must be signed in to change notification settings

junjunwang2016/miller-rabin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Miller-Rabin

Miller-Rabin test base on BigInt

Performance

  • 1024 bit: about 6 hours
  • 512 bit: about 3 hours
  • 100 bit: about 1 minute
  • 32 bit: about 4 seconds

Usage

bitlen: bit length, times: times of Miller-Rabin test

GenPrime(bitLen, times, result)

Notice

The generation is not random. It first test the biggest BigInt, namely all bit is 1. Then it subtract 2 and test again unitl it find the prime. So it aways generate the biggest prime.

BigInt

https://github.com/xkuga/bigint

About

Miller-Rabin test implement by C which can generate 1024 bit prime

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages