Z-Botan 0.1.1.1 → 0.1.1.2
raw patch · 5 files changed
+37/−15 lines, 5 filessetup-changedPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Z.Crypto.Cipher: KeySpec :: {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> KeySpec
+ Z.Crypto.Cipher: [keyLenMax] :: KeySpec -> {-# UNPACK #-} !Int
+ Z.Crypto.Cipher: [keyLenMin] :: KeySpec -> {-# UNPACK #-} !Int
+ Z.Crypto.Cipher: [keyLenMod] :: KeySpec -> {-# UNPACK #-} !Int
+ Z.Crypto.Cipher: data KeySpec
Files
- ChangeLog.md +4/−0
- Setup.hs +19/−2
- Z-Botan.cabal +1/−1
- Z/Crypto/Cipher.hs +10/−9
- Z/Crypto/MPI.hs +3/−3
ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for z-botan +## 0.1.1.2 -- 2020-05-11++* Export 'KeySpec' from `Z.Crypto.Cipher`.+ ## 0.1.0.0 -- 2020-05-11 * The very first release.
Setup.hs view
@@ -32,9 +32,12 @@ baseDir lbi' = fromMaybe "" (takeDirectory <$> cabalFilePath lbi') configFile = baseDir lbi </> "third_party" </> "botan" </> "configure.py" configFolder = baseDir lbi </> "third_party" </> "botan"+ placeholder = "build" </> "include" </> "external" </> "cabal.placeholder" confExists <- doesFileExist configFile if confExists- then runConfigureScript configFolder configFile verbosity flags lbi+ then do+ runConfigureScript configFolder configFile verbosity flags lbi+ runTouch configFolder placeholder verbosity flags else die' verbosity "botan configure script not found." postConf simpleUserHooks args flags pkg_descr lbi@@ -80,4 +83,18 @@ ++ "This requires python is discoverable in your path." -+runTouch :: FilePath -> FilePath -> Verbosity -> ConfigFlags -> IO ()+runTouch configFolder placeholder verbosity flags = do+ let extraPath = fromNubList $ configProgramPathExtra flags+ progDb = modifyProgramSearchPath+ (\p -> map ProgramSearchPathDir extraPath ++ p) emptyProgramDb+ touchPG = simpleProgram "touch"+ touch <- lookupProgram touchPG <$> configureProgram verbosity touchPG progDb+ case touch of+ Just touch' ->+ runProgramInvocation verbosity $+ (programInvocation touch' [placeholder])+ { progInvokeCwd = Just configFolder }+ Nothing -> die' verbosity notFoundMsg+ where+ notFoundMsg = "touch is required to keep a cabal placeholder file"
Z-Botan.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: Z-Botan-version: 0.1.1.1+version: 0.1.1.2 synopsis: Crypto for Haskell description: Crypto for Haskell, based on <http://botan.randombit.net/ Botan> license: BSD-3-Clause
Z/Crypto/Cipher.hs view
@@ -16,7 +16,7 @@ -} module Z.Crypto.Cipher ( -- * Block Cipher- BlockCipherType(..)+ BlockCipherType(..), KeySpec(..) , BlockCipher, blockCipherName, blockCipherKeySpec, blockCipherSize , newBlockCipher, setBlockCipherKey, clearBlockCipher , encryptBlocks, decryptBlocks@@ -224,9 +224,9 @@ -- data BlockCipher = BlockCipher { blockCipher :: {-# UNPACK #-} !BotanStruct- , blockCipherName :: {-# UNPACK #-} !CBytes- , blockCipherSize :: {-# UNPACK #-} !Int- , blockCipherKeySpec :: {-# UNPACK #-} !KeySpec+ , blockCipherName :: {-# UNPACK #-} !CBytes -- ^ block cipher algo name+ , blockCipherSize :: {-# UNPACK #-} !Int -- ^ block cipher block size+ , blockCipherKeySpec :: {-# UNPACK #-} !KeySpec -- ^ block cipher keyspec } deriving (Show, Generic) deriving anyclass T.Print@@ -523,11 +523,12 @@ -- | A Botan cipher. data Cipher = Cipher { cipher :: {-# UNPACK #-} !BotanStruct- , cipherName :: {-# UNPACK #-} !CBytes- , cipherUpdateGranularity :: {-# UNPACK #-} !Int- , cipherKeySpec :: {-# UNPACK #-} !KeySpec- , cipherTagLength :: {-# UNPACK #-} !Int -- ^ This will be zero for non-authenticated ciphers.- , defaultNonceLength :: {-# UNPACK #-} !Int+ , cipherName :: {-# UNPACK #-} !CBytes -- ^ cipher algo name+ , cipherUpdateGranularity :: {-# UNPACK #-} !Int -- ^ cipher input chunk granularity+ , cipherKeySpec :: {-# UNPACK #-} !KeySpec -- ^ cipher keyspec+ , cipherTagLength :: {-# UNPACK #-} !Int -- ^ AEAD tag length,+ -- will be zero for non-authenticated ciphers.+ , defaultNonceLength :: {-# UNPACK #-} !Int -- ^ a proper default nonce length } deriving (Show, Generic) deriving anyclass T.Print
Z/Crypto/MPI.hs view
@@ -11,11 +11,11 @@ -} module Z.Crypto.MPI- ( -- * RNG+ ( -- * MPI MPI, fromCInt, toWord32, byteSize, Z.Crypto.MPI.bitSize- -- * Builder & Parser+ -- * MPI Builder & Parser , toHex, toDecimal, fromHex, fromDecimal- -- * Predicator+ -- * MPI Predicator , isNegative, isZero, isOdd, isEven, isPrim -- * MPI specific , mulMod, powMod, modInverse, Z.Crypto.MPI.gcd