Safe Haskell | None |
---|---|
Language | Haskell2010 |
FactoredRandomNumbers
Description
Module for accessing functions based on Kalai's Algorithm
Documentation
genARandomPreFactoredNumberLTEn :: Integer -> IO (Either Text (Integer, [Integer])) Source #
This is the Entry Function with a Integer bound. This is the core of the Kalai algorithm Provide an integer input and it should generate a tuple of a number less than the input integer and its prime factors
preFactoredNumOfBitSize :: Integer -> IO (Either Text (Integer, [Integer])) Source #
Takes an Integer as a Bitsize value to operate on range [2 ^ y, 2 ^ y + 1 - 1] Provide an integer input and it should generate a tuple of a number in the range [2^y, 2^y+1 -1] and its prime factors. if it throws up a value below 2^n then do again. 50% of the time it should result in success.
preFactoredNumOfBitSizePar :: Integer -> IO (Either Text (Integer, [Integer])) Source #
Takes an Integer for Bitsize value to operate on range [2 ^ y, 2 ^ y + 1 - 1]. This function leverages parallel execution Provide an integer input and it should generate a tuple of a number in the range [2^y, 2^y+1 -1] and its prime factors In the event that the concurrent call fails, a recovery through a basic parallelised call is attempted.