From d2da00445de3d4a5d358d3bbc5c9d73cb49f7aa1 Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Thu, 5 Apr 2018 21:40:50 -0400 Subject: [PATCH] fix spelling of "exponent" --- Crypto/Number/ModArithmetic.hs | 8 ++++---- Crypto/PubKey/RSA.hs | 4 ++-- Crypto/PubKey/RSA/Types.hs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Crypto/Number/ModArithmetic.hs b/Crypto/Number/ModArithmetic.hs index 398c17c..4ca6317 100644 --- a/Crypto/Number/ModArithmetic.hs +++ b/Crypto/Number/ModArithmetic.hs @@ -28,7 +28,7 @@ data CoprimesAssertionError = CoprimesAssertionError instance Exception CoprimesAssertionError --- | Compute the modular exponentiation of base^exponant using +-- | Compute the modular exponentiation of base^exponent using -- algorithms design to avoid side channels and timing measurement -- -- Modulo need to be odd otherwise the normal fast modular exponentiation @@ -42,7 +42,7 @@ instance Exception CoprimesAssertionError -- (which is now integer-gmp2), so is has the same security as old -- ghc version. expSafe :: Integer -- ^ base - -> Integer -- ^ exponant + -> Integer -- ^ exponent -> Integer -- ^ modulo -> Integer -- ^ result expSafe b e m @@ -52,14 +52,14 @@ expSafe b e m | otherwise = gmpPowModInteger b e m `onGmpUnsupported` exponentiation b e m --- | Compute the modular exponentiation of base^exponant using +-- | Compute the modular exponentiation of base^exponent using -- the fastest algorithm without any consideration for -- hiding parameters. -- -- Use this function when all the parameters are public, -- otherwise 'expSafe' should be prefered. expFast :: Integer -- ^ base - -> Integer -- ^ exponant + -> Integer -- ^ exponent -> Integer -- ^ modulo -> Integer -- ^ result expFast b e m = gmpPowModInteger b e m `onGmpUnsupported` exponentiation b e m diff --git a/Crypto/PubKey/RSA.hs b/Crypto/PubKey/RSA.hs index eea7070..131da3d 100644 --- a/Crypto/PubKey/RSA.hs +++ b/Crypto/PubKey/RSA.hs @@ -55,7 +55,7 @@ toPositive int -- generateWith :: (Integer, Integer) -- ^ chosen distinct primes p and q -> Int -- ^ size in bytes - -> Integer -- ^ RSA public exponant 'e' + -> Integer -- ^ RSA public exponent 'e' -> Maybe (PublicKey, PrivateKey) generateWith (p,q) size e = case inverse e phi of @@ -81,7 +81,7 @@ generateWith (p,q) size e = -- | generate a pair of (private, public) key of size in bytes. generate :: MonadRandom m => Int -- ^ size in bytes - -> Integer -- ^ RSA public exponant 'e' + -> Integer -- ^ RSA public exponent 'e' -> m (PublicKey, PrivateKey) generate size e = loop where diff --git a/Crypto/PubKey/RSA/Types.hs b/Crypto/PubKey/RSA/Types.hs index 9adeea7..d3ac487 100644 --- a/Crypto/PubKey/RSA/Types.hs +++ b/Crypto/PubKey/RSA/Types.hs @@ -41,7 +41,7 @@ data Error = data PublicKey = PublicKey { public_size :: Int -- ^ size of key in bytes , public_n :: Integer -- ^ public p*q - , public_e :: Integer -- ^ public exponant e + , public_e :: Integer -- ^ public exponent e } deriving (Show,Read,Eq,Data,Typeable) instance NFData PublicKey where @@ -59,7 +59,7 @@ instance NFData PublicKey where -- data PrivateKey = PrivateKey { private_pub :: PublicKey -- ^ public part of a private key (size, n and e) - , private_d :: Integer -- ^ private exponant d + , private_d :: Integer -- ^ private exponent d , private_p :: Integer -- ^ p prime number , private_q :: Integer -- ^ q prime number , private_dP :: Integer -- ^ d mod (p-1)