NTRU-1.1.0.0: NTRU Cryptography

Math.NTRU

Description

This is an implementation of the NTRU cryptographic system, following the standard set forth by the IEEE in the document entitled IEEE Standard Specification for Public Key Cryptographic Techniques Based on Hard Problems over Lattices (IEEE Std 1363.1-2008). It is designed to be compatible with the implementation of SecurityInnovations, available here.

Synopsis

# Documentation

Arguments

 :: ParamSet Parameter set, most likely the output of genParams -> IO ([Integer], [Integer]) A tuple representing (PublicKey, PrivateKey) where PrivateKey = 1 + pf, per enhancement #2.

Generates a random PublicKey-PrivateKey Pair

Arguments

 :: ParamSet Parameter set, most likely the output of genParams -> [Integer] A list of ASCII values representing the message -> [Integer] A list of numbers representing the public key -> IO [Integer] A list of numbers representing the ciphertext

Encrypts a message using the given parameter set

Arguments

 :: ParamSet Parameter set, most likely the output of genParams -> [Integer] A list of numbers representing the private key -> [Integer] A list of numbers representing the public key -> [Integer] A list of numbers representing the ciphertext -> Maybe [Integer] A list of numbers representing the original message
1. 3.3 Decrypts e using the private key f and verifies it using the public key h.

Arguments

 :: String Desired parameter set: This should be either one of the 12 listed in the IEEE Standard (1363.1-2008) Annex A -> ParamSet Parameter set to be used by keyGen, encrypt, or decrypt

Generates the proper parameter set based on the given bit level

data ParamSet Source #

The Parameter Set Record

Constructors

 ParamSet FieldsgetN :: IntThe size of the polynomialsgetP :: IntegerThe small modulus pgetQ :: IntegerThe large modulus qgetDf :: IntThe number of 1's in fgetDg :: IntThe number of 1's in ggetLLen :: IntThe length of the encoded message length (should probably be 1)getDb :: IntThe number of random bits prefixed to the messagegetMaxMsgLenBytes :: IntThe max number of bytes in the messagegetBufferLenBits :: IntThe size of the resulting message before conversion to tritsgetBufferLenTrits :: IntThe size of the resulting message after conversion to tritsgetDm0 :: IntMinimum number of 1's, -1's and 0's in the message for decryption to succeedgetShaLvl :: IntSHA algorithm to use. Should be either 1 or 256getDr :: IntThe number of 1's in the blinding polynomialgetC :: IntUsed by index generator functiongetMinCallsR :: IntegerUsed by mask generatorgetMinCallsMask :: IntUsed by mask generatorgetOID :: [Int]Parameter set IDgetPkLen :: IntUsed to create SDatagetBitLvl :: IntBit level security
Instances
 Source # Instance detailsDefined in Math.NTRU MethodsshowList :: [ParamSet] -> ShowS #