start restructuring project
This commit is contained in:
5
HaskellMath.hs
Normal file
5
HaskellMath.hs
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import Primes.SoloveyStrassen (soloveyStrassen)
|
||||||
|
import Primes.MillerRabin (millerRabin)
|
||||||
|
import Primes.FermatPrimeTest (fermatPrimeTest)
|
||||||
31
README.md
31
README.md
@@ -1,25 +1,24 @@
|
|||||||
# haskell-math
|
# haskell-math
|
||||||
|
|
||||||
## Modular square roots algorithms
|
## running project from CLI
|
||||||
|
```
|
||||||
|
$ ghci -i./src
|
||||||
|
ghci> :load HaskellMath.hs
|
||||||
|
```
|
||||||
|
|
||||||
### Tonelli Shanks
|
## algorithms
|
||||||
file: `TonelliShanks.hs`
|
|
||||||
|
|
||||||
## primality test algorithms
|
### Modular square roots algorithms
|
||||||
|
|
||||||
### Fermat's prime test
|
+ Tonelli Shanks
|
||||||
file: `fermat-prime-test.hs`
|
|
||||||
|
|
||||||
### Miller Rabin's prime test
|
### primality test algorithms
|
||||||
file: `miller-rabin-prime-test.hs`
|
|
||||||
|
|
||||||
### Solovey Strassen's prime test
|
+ Fermat's prime test
|
||||||
file: `SoloveyStrassen.hs`
|
+ Miller Rabin's prime test
|
||||||
|
+ Solovey Strassen's prime test
|
||||||
|
|
||||||
## factorization algorithms
|
### factorization algorithms
|
||||||
|
|
||||||
### Fermat's factorization
|
+ Fermat's factorization
|
||||||
file: `fermat-factorization.hs`
|
+ Pollard's p-1
|
||||||
|
|
||||||
### Pollard's p-1
|
|
||||||
file: `PollardPminus1.hs`
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
module Primes.FermatPrimeTest (fermatPrimeTest) where
|
||||||
|
|
||||||
import System.Random (randomRIO)
|
import System.Random (randomRIO)
|
||||||
import ModularArithmeticUtils (modExp)
|
import ModularArithmeticUtils (modExp)
|
||||||
|
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
module Primes.MillerRabin (millerRabin) where
|
||||||
|
|
||||||
import System.Random (randomRIO)
|
import System.Random (randomRIO)
|
||||||
import ModularArithmeticUtils (modExp, factorOutTwos)
|
import ModularArithmeticUtils (modExp, factorOutTwos)
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
module SoloveyStrassen (soloveyStrassen) where
|
module Primes.SoloveyStrassen (soloveyStrassen) where
|
||||||
|
|
||||||
import ModularArithmeticUtils (modExp, jacobi)
|
import ModularArithmeticUtils (modExp, jacobi)
|
||||||
import System.Random (randomRIO)
|
import System.Random (randomRIO)
|
||||||
0
test/test.hs
Normal file
0
test/test.hs
Normal file
Reference in New Issue
Block a user