Minor haddock fixes

Fix some incorrect parameter descriptions and spelling/typos.
This commit is contained in:
Luke Taylor 2015-06-07 13:18:16 +02:00
parent 8cc91a7bfe
commit 4e1437d4fd
5 changed files with 13 additions and 13 deletions

View File

@ -166,7 +166,7 @@ withOCBKeyAndCopySt aes (AESOCB gcmSt) f =
-- | Initialize a new context with a key
--
-- Key need to be of length 16, 24 or 32 bytes. any other values will cause undefined behavior
-- Key needs to be of length 16, 24 or 32 bytes. Any other values will return failure
initAES :: ByteArrayAccess key => key -> CryptoFailable AES
initAES k
| len == 16 = CryptoPassed $ initWithRounds 10
@ -418,7 +418,7 @@ gcmInit ctx iv = unsafeDoIO $ do
c_aes_gcm_init (castPtr gcmStPtr) k v (fromIntegral $ B.length iv)
return $ AESGCM sm
-- | append data which is going to just be authentified to the GCM context.
-- | append data which is only going to be authenticated to the GCM context.
--
-- need to happen after initialization and before appending encryption/decryption data.
{-# NOINLINE gcmAppendAAD #-}
@ -489,7 +489,7 @@ ocbInit ctx iv = unsafeDoIO $ do
c_aes_ocb_init (castPtr ocbStPtr) k v (fromIntegral $ B.length iv)
return $ AESOCB sm
-- | append data which is going to just be authentified to the OCB context.
-- | append data which is going to just be authenticated to the OCB context.
--
-- need to happen after initialization and before appending encryption/decryption data.
{-# NOINLINE ocbAppendAAD #-}

View File

@ -49,10 +49,10 @@ aeadFinalize (AEAD impl st) n = (aeadImplFinalize impl) st n
-- | Simple AEAD encryption
aeadSimpleEncrypt :: (ByteArrayAccess aad, ByteArray ba)
=> AEAD a -- ^ A new AEAD Context
-> aad -- ^ Optional Authentified Header
-> aad -- ^ Optional Authentication data header
-> ba -- ^ Optional Plaintext
-> Int -- ^ Tag length
-> (AuthTag, ba) -- ^ Authentification tag and ciphertext
-> (AuthTag, ba) -- ^ Authentication tag and ciphertext
aeadSimpleEncrypt aeadIni header input taglen = (tag, output)
where aead = aeadAppendHeader aeadIni header
(output, aeadFinal) = aeadEncrypt aead input
@ -61,9 +61,9 @@ aeadSimpleEncrypt aeadIni header input taglen = (tag, output)
-- | Simple AEAD decryption
aeadSimpleDecrypt :: (ByteArrayAccess aad, ByteArray ba)
=> AEAD a -- ^ A new AEAD Context
-> aad -- ^ Optional Authentified Header
-> ba -- ^ Optional Plaintext
-> AuthTag -- ^ Tag length
-> aad -- ^ Optional Authentication data header
-> ba -- ^ Ciphertext
-> AuthTag -- ^ The authentication tag
-> Maybe ba -- ^ Plaintext
aeadSimpleDecrypt aeadIni header input authTag
| tag == authTag = Just output

View File

@ -32,7 +32,7 @@ data KeySizeSpecifier =
-- | Offset inside an XTS data unit, measured in block size.
type DataUnitOffset = Word32
-- | Authentification Tag for AE cipher mode
-- | Authentication Tag for AE cipher mode
newtype AuthTag = AuthTag { unAuthTag :: Bytes }
deriving (Show, ByteArrayAccess)

View File

@ -100,9 +100,9 @@ decryptSafer pk b = do
blinder <- generateBlinder (private_n pk)
return (decrypt (Just blinder) pk b)
-- | encrypt a bytestring using the public key and a CPRG random generator.
-- | encrypt a bytestring using the public key.
--
-- the message need to be smaller than the key size - 11
-- the message needs to be smaller than the key size - 11
encrypt :: MonadRandom m => PublicKey -> ByteString -> m (Either Error ByteString)
encrypt pk m = do
r <- pad (public_size pk) m

View File

@ -75,7 +75,7 @@ data KAT_AEAD = KAT_AEAD
{ aeadMode :: AEADMode
, aeadKey :: ByteString -- ^ Key
, aeadIV :: ByteString -- ^ IV for initialization
, aeadHeader :: ByteString -- ^ Authentificated Header
, aeadHeader :: ByteString -- ^ Authenticated Header
, aeadPlaintext :: ByteString -- ^ Plaintext
, aeadCiphertext :: ByteString -- ^ Ciphertext
, aeadTaglen :: Int -- ^ aead tag len
@ -104,7 +104,7 @@ testECB (_, _, cipherInit) ecbEncrypt ecbDecrypt kats =
]
where ctx = cipherInit (ecbKey d)
--propTest = testProperty "decrypt.encrypt" (ECBUnit key plaintext) =
--testProperty_ECB (ECBUnit (cipherInit -> ctx) (toBytes -> plaintext)) =
-- plaintext `assertEq` ecbDecrypt ctx (ecbEncrypt ctx plaintext)