eccrypto-0.2.0: Elliptic Curve Cryptography for Haskell

Copyright(c) Marcel Fourné 20[14..]
LicenseBSD3
MaintainerMarcel Fourné (haskell@marcelfourne.de)
Stabilitybeta
PortabilityGood
Safe HaskellSafe
LanguageHaskell98

Crypto.Fi

Description

This is a thin wrapper around Integer to ease transition toward FPrime WARNING! Re Timing-Attacks: This backend is not fully timing attack resistant.

Synopsis

Documentation

type FPrime = Integer Source #

a simple wrapper to ease transition

eq :: FPrime -> FPrime -> Bool Source #

most trivial (==) wrapper

add :: FPrime -> FPrime -> FPrime Source #

(+) in the field

addr :: FPrime -> FPrime -> FPrime -> FPrime Source #

(+) in the field

sub :: FPrime -> FPrime -> FPrime Source #

(-) in the field

subr :: FPrime -> FPrime -> FPrime -> FPrime Source #

(-) in the field

neg :: FPrime -> FPrime -> FPrime Source #

negation in the field

shift :: FPrime -> Int -> FPrime Source #

bitshift wrapper

mul :: FPrime -> FPrime -> FPrime Source #

field multiplication, a * b

mulr :: FPrime -> FPrime -> FPrime -> FPrime Source #

field multiplication, a * b mod p

redc :: FPrime -> FPrime -> FPrime Source #

modular reduction, a simple wrapper around mod

square :: FPrime -> FPrime -> FPrime Source #

simple squaring in the field

pow :: FPrime -> FPrime -> Integer -> FPrime Source #

the power function in the field, for 1>= k < p

inv :: FPrime -> FPrime -> FPrime Source #

field inversion

fromInteger :: Int -> FPrime -> Integer Source #

conversion wrapper with a limit

toInteger :: FPrime -> Integer Source #

a most simple conversion wrapper

condBit :: FPrime -> Int -> FPrime Source #

like testBit, but give either 0 or 1