HsOpenSSL-0.6.4: (Incomplete) OpenSSL binding for HaskellSource codeContentsIndex
OpenSSL.BN
Contents
Type
Allocation
Conversion from/to Integer
Computation
Random number generation
Description
BN - multiprecision integer arithmetics
Synopsis
data BigNum
allocaBN :: (BigNum -> IO a) -> IO a
withBN :: Integer -> (BigNum -> IO a) -> IO a
newBN :: Integer -> IO BigNum
peekBN :: BigNum -> IO Integer
integerToBN :: Integer -> IO BigNum
bnToInteger :: BigNum -> IO Integer
integerToMPI :: Integer -> IO ByteString
mpiToInteger :: ByteString -> IO Integer
modexp :: Integer -> Integer -> Integer -> Integer
randIntegerUptoNMinusOneSuchThat :: (Integer -> Bool) -> Integer -> IO Integer
prandIntegerUptoNMinusOneSuchThat :: (Integer -> Bool) -> Integer -> IO Integer
randIntegerZeroToNMinusOne :: Integer -> IO Integer
prandIntegerZeroToNMinusOne :: Integer -> IO Integer
randIntegerOneToNMinusOne :: Integer -> IO Integer
prandIntegerOneToNMinusOne :: Integer -> IO Integer
Type
data BigNum Source
BigNum is an opaque object representing a big number.
Allocation
allocaBN :: (BigNum -> IO a) -> IO aSource
allocaBN f allocates a BigNum and computes f. Then it frees the BigNum.
withBN :: Integer -> (BigNum -> IO a) -> IO aSource
withBN n f converts n to a BigNum and computes f. Then it frees the BigNum.
newBN :: Integer -> IO BigNumSource
This is an alias to integerToBN.
Conversion from/to Integer
peekBN :: BigNum -> IO IntegerSource
This is an alias to bnToInteger.
integerToBN :: Integer -> IO BigNumSource
This is a GHC specific, fast conversion between Integers and OpenSSL bignums. It returns a malloced BigNum.
bnToInteger :: BigNum -> IO IntegerSource
Convert a BIGNUM to an Integer
integerToMPI :: Integer -> IO ByteStringSource
Convert an Integer to an MPI. SEe bnToMPI for the format
mpiToInteger :: ByteString -> IO IntegerSource
Convert an MPI to an Integer. SEe bnToMPI for the format
Computation
modexp :: Integer -> Integer -> Integer -> IntegerSource
modexp a p m computes a to the p-th power modulo m.
Random number generation
randIntegerUptoNMinusOneSuchThatSource
:: Integer -> Boola filter function
-> Integerone plus the upper limit
-> IO Integer
Return a strongly random number in the range 0 <= x < n where the given filter function returns true.
prandIntegerUptoNMinusOneSuchThatSource
:: Integer -> Boola filter function
-> Integerone plus the upper limit
-> IO Integer
Return a random number in the range 0 <= x < n where the given filter function returns true.
randIntegerZeroToNMinusOne :: Integer -> IO IntegerSource
Return a strongly random number in the range 0 <= x < n
prandIntegerZeroToNMinusOne :: Integer -> IO IntegerSource
Return a random number in the range 0 <= x < n
randIntegerOneToNMinusOne :: Integer -> IO IntegerSource
Return a strongly random number in the range 0 < x < n
prandIntegerOneToNMinusOne :: Integer -> IO IntegerSource
Return a random number in the range 0 < x < n
Produced by Haddock version 2.4.2