Crypto.Number.Polynomial

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

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | Good
Safe Haskell | None
Language | Haskell98

Crypto.Number.Polynomial

Contents

- polynomial operations

Description

Synopsis

- data Monomial = Monomial !Int !Integer
- data Polynomial
- toList :: Polynomial -> [Monomial]
- fromList :: [Monomial] -> Polynomial
- addPoly :: Polynomial -> Polynomial -> Polynomial
- subPoly :: Polynomial -> Polynomial -> Polynomial
- mulPoly :: Polynomial -> Polynomial -> Polynomial
- squarePoly :: Polynomial -> Polynomial
- expPoly :: Polynomial -> Integer -> Polynomial
- divPoly :: Polynomial -> Polynomial -> (Polynomial, Polynomial)
- negPoly :: Polynomial -> Polynomial

# Documentation

data Monomial #

Constructors

Monomial !Int !Integer |

Instances

Eq Monomial # |
Methods (==) :: Monomial -> Monomial -> Bool # (/=) :: Monomial -> Monomial -> Bool #
Ord Monomial # |
Methods compare :: Monomial -> Monomial -> Ordering # (<) :: Monomial -> Monomial -> Bool # (<=) :: Monomial -> Monomial -> Bool # (>) :: Monomial -> Monomial -> Bool # (>=) :: Monomial -> Monomial -> Bool # max :: Monomial -> Monomial -> Monomial # min :: Monomial -> Monomial -> Monomial #
Show Monomial # |
Methods showsPrec :: Int -> Monomial -> ShowS # show :: Monomial -> String # showList :: [Monomial] -> ShowS #

# polynomial operations

data Polynomial #

Instances

Eq Polynomial # |
Methods (==) :: Polynomial -> Polynomial -> Bool # (/=) :: Polynomial -> Polynomial -> Bool #
Show Polynomial # |
Methods showsPrec :: Int -> Polynomial -> ShowS # show :: Polynomial -> String # showList :: [Polynomial] -> ShowS #

toList :: Polynomial -> [Monomial] #

fromList :: [Monomial] -> Polynomial #

addPoly :: Polynomial -> Polynomial -> Polynomial #

subPoly :: Polynomial -> Polynomial -> Polynomial #

mulPoly :: Polynomial -> Polynomial -> Polynomial #

squarePoly :: Polynomial -> Polynomial #

expPoly :: Polynomial -> Integer -> Polynomial #

divPoly :: Polynomial -> Polynomial -> (Polynomial, Polynomial) #

negPoly :: Polynomial -> Polynomial #