start restructuring project

This commit is contained in:
2026-01-10 13:23:43 +01:00
parent 5dfcc79927
commit 1bd58d27d7
11 changed files with 25 additions and 17 deletions

5
HaskellMath.hs Normal file
View File

@@ -0,0 +1,5 @@
import Primes.SoloveyStrassen (soloveyStrassen)
import Primes.MillerRabin (millerRabin)
import Primes.FermatPrimeTest (fermatPrimeTest)

View File

@@ -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`

View File

@@ -1,3 +1,5 @@
module Primes.FermatPrimeTest (fermatPrimeTest) where
import System.Random (randomRIO) import System.Random (randomRIO)
import ModularArithmeticUtils (modExp) import ModularArithmeticUtils (modExp)

View File

@@ -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)

View File

@@ -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
View File