crypto-numbers-0.1.3: Cryptographic numbers: functions and algorithms

PortabilityGood
Stabilityexperimental
MaintainerVincent Hanquez <vincent@snarc.org>
Safe HaskellSafe-Inferred

Crypto.Number.Basic

Description

 

Synopsis

Documentation

sqrti :: Integer -> (Integer, Integer)Source

sqrti returns two integer (l,b) so that l <= sqrt i <= b the implementation is quite naive, use an approximation for the first number and use a dichotomy algorithm to compute the bound relatively efficiently.

gcde :: Integer -> Integer -> (Integer, Integer, Integer)Source

get the extended GCD of two integer using integer divMod

gcde_binary :: Integer -> Integer -> (Integer, Integer, Integer)Source

get the extended GCD of two integer using the extended binary algorithm (HAC 14.61) get (x,y,d) where d = gcd(a,b) and x,y satisfying ax + by = d

areEven :: [Integer] -> BoolSource

check if a list of integer are all even