cropty 0.3.0.2 → 0.3.1.0
raw patch · 2 files changed
+5/−9 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Cropty: generateKeyOfSize :: Int -> IO Key
Files
- cropty.cabal +1/−1
- src/Cropty.hs +4/−8
cropty.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.4 name: cropty-version: 0.3.0.2+version: 0.3.1.0 synopsis: Encryption and decryption description: Encryption and decryption. homepage: https://github.com/SamuelSchlesinger/cropty
src/Cropty.hs view
@@ -47,7 +47,6 @@ -- * Symmetric Encryption , Key (Key, keyBytes) , generateKey- , generateKeyOfSize , encryptSym , SymEncryptionException (..) , decryptSym@@ -183,14 +182,11 @@ newtype Key = Key { keyBytes :: ByteString } deriving (Eq, Ord, Show, Read, Generic, Binary) --- | Generate a new 'Key'+-- | Generate a new 'Key'. It must have 32 bytes, because+-- we are using AES256, and there are 8 bits in a byte.+-- In other words: @32 * 8 = 256@. generateKey :: IO Key-generateKey = generateKeyOfSize 32---- | Generates a new 'Key' with the given size-generateKeyOfSize :: Int -> IO Key-generateKeyOfSize n =- Key <$> Random.getRandomBytes n+generateKey = Key <$> Random.getRandomBytes 32 data SymEncryptionException = SymEncryptionException'CryptoniteError CryptoError deriving Show