From 0584cae8351d288d745db59bc69fdf32be37932b Mon Sep 17 00:00:00 2001 From: Piyush P Kurur Date: Thu, 20 Sep 2018 14:30:41 +0530 Subject: [PATCH 1/8] back to one package. --- raaz-core-indef/LICENSE => LICENSE | 0 cabal.project | 4 - {raaz-core => core-indef}/LICENSE | 0 .../Raaz/Primitive/Implementation.hsig | 0 .../Raaz/Primitive/Util.hs | 0 {raaz-implementation => core}/LICENSE | 0 {raaz-core => core}/Raaz/Core.hs | 0 {raaz-core => core}/Raaz/Core/ByteSource.hs | 0 {raaz-core => core}/Raaz/Core/Constants.hs | 0 {raaz-core => core}/Raaz/Core/CpuSupports.hs | 0 {raaz-core => core}/Raaz/Core/DH.hs | 0 {raaz-core => core}/Raaz/Core/Encode.hs | 0 .../Raaz/Core/Encode/Base16.hs | 0 .../Raaz/Core/Encode/Base64.hs | 0 .../Raaz/Core/Encode/Internal.hs | 0 {raaz-core => core}/Raaz/Core/IOCont.hs | 0 {raaz-core => core}/Raaz/Core/Memory.hs | 0 .../Raaz/Core/MonoidalAction.hs | 0 .../Raaz/Core/Parse/Applicative.hs | 0 {raaz-core => core}/Raaz/Core/Primitive.hs | 0 {raaz-core => core}/Raaz/Core/Transfer.hs | 0 {raaz-core => core}/Raaz/Core/Types.hs | 0 .../Raaz/Core/Types/Copying.hs | 0 {raaz-core => core}/Raaz/Core/Types/Endian.hs | 0 .../Raaz/Core/Types/Equality.hs | 0 .../Raaz/Core/Types/Internal.hs | 0 .../Raaz/Core/Types/Pointer.hs | 0 {raaz-core => core}/Raaz/Core/Types/Tuple.hs | 0 {raaz-core => core}/Raaz/Core/Util.hs | 0 .../Raaz/Core/Util/ByteString.hs | 0 .../Raaz/Primitive/Blake2/Internal.hs | 0 .../Raaz/Primitive/ChaCha20/Internal.hs | 0 .../Raaz/Primitive/HashMemory.hs | 0 .../Raaz/Primitive/Sha256/Internal.hs | 0 .../Raaz/Primitive/Sha512/Internal.hs | 0 .../cbits/raaz/core/cpusupports.c | 0 {raaz-core => core}/cbits/raaz/core/endian.c | 0 {raaz-core => core}/cbits/raaz/core/endian.h | 0 {raaz-core => core}/cbits/raaz/core/memory.c | 0 .../entropy/arc4random/Raaz/Entropy.hs | 0 .../entropy/getrandom/Raaz/Entropy.hsc | 0 .../entropy/urandom/Raaz/Entropy.hs | 0 .../entropy/windows/Raaz/Entropy.hsc | 0 {raaz => implementation}/LICENSE | 0 .../Blake2b/Implementation/CPortable.hs | 0 .../Blake2s/Implementation/CPortable.hs | 0 .../ChaCha20/Implementation/CPortable.hs | 0 .../Sha256/Implementation/CPortable.hs | 0 .../Sha512/Implementation/CPortable.hs | 0 .../benchmarks/Cipher.hs | 0 .../benchmarks/Main.hs | 0 .../internal/Benchmark/Primitive.hs | 0 .../benchmarks/internal/Benchmark/Types.hs | 0 .../cbits/raaz/cipher/aes/common.c | 0 .../cbits/raaz/cipher/aes/common.h | 0 .../cbits/raaz/cipher/aes/cportable.c | 0 .../cbits/raaz/cipher/aes/cportable.h | 0 .../cbits/raaz/cipher/chacha20/common.h | 0 .../cbits/raaz/cipher/chacha20/cportable.c | 0 .../cbits/raaz/cipher/cportable/aes.c | 0 .../cbits/raaz/cipher/cportable/aes.h | 0 .../cbits/raaz/cipher/cportable/salsa20.c | 0 .../cbits/raaz/cipher/cportable/salsa20.h | 0 .../raaz/hash/blake2/blake2b/constants.h | 0 .../cbits/raaz/hash/blake2/blake2b/portable.c | 0 .../raaz/hash/blake2/blake2s/constants.h | 0 .../cbits/raaz/hash/blake2/blake2s/portable.c | 0 .../cbits/raaz/hash/blake2/common.h | 0 .../cbits/raaz/hash/sha1/portable.c | 0 .../cbits/raaz/hash/sha256/portable.c | 0 .../cbits/raaz/hash/sha512/portable.c | 0 raaz-core-indef/raaz-core-indef.cabal | 49 ---- raaz-core/raaz-core.cabal | 116 -------- raaz-implementation/raaz-implementation.cabal | 143 ---------- raaz.cabal | 256 ++++++++++++++++++ raaz/raaz.cabal | 141 ---------- 76 files changed, 256 insertions(+), 453 deletions(-) rename raaz-core-indef/LICENSE => LICENSE (100%) delete mode 100644 cabal.project rename {raaz-core => core-indef}/LICENSE (100%) rename {raaz-core-indef => core-indef}/Raaz/Primitive/Implementation.hsig (100%) rename {raaz-core-indef => core-indef}/Raaz/Primitive/Util.hs (100%) rename {raaz-implementation => core}/LICENSE (100%) rename {raaz-core => core}/Raaz/Core.hs (100%) rename {raaz-core => core}/Raaz/Core/ByteSource.hs (100%) rename {raaz-core => core}/Raaz/Core/Constants.hs (100%) rename {raaz-core => core}/Raaz/Core/CpuSupports.hs (100%) rename {raaz-core => core}/Raaz/Core/DH.hs (100%) rename {raaz-core => core}/Raaz/Core/Encode.hs (100%) rename {raaz-core => core}/Raaz/Core/Encode/Base16.hs (100%) rename {raaz-core => core}/Raaz/Core/Encode/Base64.hs (100%) rename {raaz-core => core}/Raaz/Core/Encode/Internal.hs (100%) rename {raaz-core => core}/Raaz/Core/IOCont.hs (100%) rename {raaz-core => core}/Raaz/Core/Memory.hs (100%) rename {raaz-core => core}/Raaz/Core/MonoidalAction.hs (100%) rename {raaz-core => core}/Raaz/Core/Parse/Applicative.hs (100%) rename {raaz-core => core}/Raaz/Core/Primitive.hs (100%) rename {raaz-core => core}/Raaz/Core/Transfer.hs (100%) rename {raaz-core => core}/Raaz/Core/Types.hs (100%) rename {raaz-core => core}/Raaz/Core/Types/Copying.hs (100%) rename {raaz-core => core}/Raaz/Core/Types/Endian.hs (100%) rename {raaz-core => core}/Raaz/Core/Types/Equality.hs (100%) rename {raaz-core => core}/Raaz/Core/Types/Internal.hs (100%) rename {raaz-core => core}/Raaz/Core/Types/Pointer.hs (100%) rename {raaz-core => core}/Raaz/Core/Types/Tuple.hs (100%) rename {raaz-core => core}/Raaz/Core/Util.hs (100%) rename {raaz-core => core}/Raaz/Core/Util/ByteString.hs (100%) rename {raaz-core => core}/Raaz/Primitive/Blake2/Internal.hs (100%) rename {raaz-core => core}/Raaz/Primitive/ChaCha20/Internal.hs (100%) rename {raaz-core => core}/Raaz/Primitive/HashMemory.hs (100%) rename {raaz-core => core}/Raaz/Primitive/Sha256/Internal.hs (100%) rename {raaz-core => core}/Raaz/Primitive/Sha512/Internal.hs (100%) rename {raaz-core => core}/cbits/raaz/core/cpusupports.c (100%) rename {raaz-core => core}/cbits/raaz/core/endian.c (100%) rename {raaz-core => core}/cbits/raaz/core/endian.h (100%) rename {raaz-core => core}/cbits/raaz/core/memory.c (100%) rename {raaz-core => core}/entropy/arc4random/Raaz/Entropy.hs (100%) rename {raaz-core => core}/entropy/getrandom/Raaz/Entropy.hsc (100%) rename {raaz-core => core}/entropy/urandom/Raaz/Entropy.hs (100%) rename {raaz-core => core}/entropy/windows/Raaz/Entropy.hsc (100%) rename {raaz => implementation}/LICENSE (100%) rename {raaz-implementation => implementation}/Raaz/Primitive/Blake2b/Implementation/CPortable.hs (100%) rename {raaz-implementation => implementation}/Raaz/Primitive/Blake2s/Implementation/CPortable.hs (100%) rename {raaz-implementation => implementation}/Raaz/Primitive/ChaCha20/Implementation/CPortable.hs (100%) rename {raaz-implementation => implementation}/Raaz/Primitive/Sha256/Implementation/CPortable.hs (100%) rename {raaz-implementation => implementation}/Raaz/Primitive/Sha512/Implementation/CPortable.hs (100%) rename {raaz-implementation => implementation}/benchmarks/Cipher.hs (100%) rename {raaz-implementation => implementation}/benchmarks/Main.hs (100%) rename {raaz-implementation => implementation}/benchmarks/internal/Benchmark/Primitive.hs (100%) rename {raaz-implementation => implementation}/benchmarks/internal/Benchmark/Types.hs (100%) rename {raaz-implementation => implementation}/cbits/raaz/cipher/aes/common.c (100%) rename {raaz-implementation => implementation}/cbits/raaz/cipher/aes/common.h (100%) rename {raaz-implementation => implementation}/cbits/raaz/cipher/aes/cportable.c (100%) rename {raaz-implementation => implementation}/cbits/raaz/cipher/aes/cportable.h (100%) rename {raaz-implementation => implementation}/cbits/raaz/cipher/chacha20/common.h (100%) rename {raaz-implementation => implementation}/cbits/raaz/cipher/chacha20/cportable.c (100%) rename {raaz-implementation => implementation}/cbits/raaz/cipher/cportable/aes.c (100%) rename {raaz-implementation => implementation}/cbits/raaz/cipher/cportable/aes.h (100%) rename {raaz-implementation => implementation}/cbits/raaz/cipher/cportable/salsa20.c (100%) rename {raaz-implementation => implementation}/cbits/raaz/cipher/cportable/salsa20.h (100%) rename {raaz-implementation => implementation}/cbits/raaz/hash/blake2/blake2b/constants.h (100%) rename {raaz-implementation => implementation}/cbits/raaz/hash/blake2/blake2b/portable.c (100%) rename {raaz-implementation => implementation}/cbits/raaz/hash/blake2/blake2s/constants.h (100%) rename {raaz-implementation => implementation}/cbits/raaz/hash/blake2/blake2s/portable.c (100%) rename {raaz-implementation => implementation}/cbits/raaz/hash/blake2/common.h (100%) rename {raaz-implementation => implementation}/cbits/raaz/hash/sha1/portable.c (100%) rename {raaz-implementation => implementation}/cbits/raaz/hash/sha256/portable.c (100%) rename {raaz-implementation => implementation}/cbits/raaz/hash/sha512/portable.c (100%) delete mode 100644 raaz-core-indef/raaz-core-indef.cabal delete mode 100644 raaz-core/raaz-core.cabal delete mode 100644 raaz-implementation/raaz-implementation.cabal create mode 100644 raaz.cabal delete mode 100644 raaz/raaz.cabal diff --git a/raaz-core-indef/LICENSE b/LICENSE similarity index 100% rename from raaz-core-indef/LICENSE rename to LICENSE diff --git a/cabal.project b/cabal.project deleted file mode 100644 index 68ab72240..000000000 --- a/cabal.project +++ /dev/null @@ -1,4 +0,0 @@ -packages: raaz-core/ - , raaz-core-indef/ - , raaz-implementation/ - , raaz/ diff --git a/raaz-core/LICENSE b/core-indef/LICENSE similarity index 100% rename from raaz-core/LICENSE rename to core-indef/LICENSE diff --git a/raaz-core-indef/Raaz/Primitive/Implementation.hsig b/core-indef/Raaz/Primitive/Implementation.hsig similarity index 100% rename from raaz-core-indef/Raaz/Primitive/Implementation.hsig rename to core-indef/Raaz/Primitive/Implementation.hsig diff --git a/raaz-core-indef/Raaz/Primitive/Util.hs b/core-indef/Raaz/Primitive/Util.hs similarity index 100% rename from raaz-core-indef/Raaz/Primitive/Util.hs rename to core-indef/Raaz/Primitive/Util.hs diff --git a/raaz-implementation/LICENSE b/core/LICENSE similarity index 100% rename from raaz-implementation/LICENSE rename to core/LICENSE diff --git a/raaz-core/Raaz/Core.hs b/core/Raaz/Core.hs similarity index 100% rename from raaz-core/Raaz/Core.hs rename to core/Raaz/Core.hs diff --git a/raaz-core/Raaz/Core/ByteSource.hs b/core/Raaz/Core/ByteSource.hs similarity index 100% rename from raaz-core/Raaz/Core/ByteSource.hs rename to core/Raaz/Core/ByteSource.hs diff --git a/raaz-core/Raaz/Core/Constants.hs b/core/Raaz/Core/Constants.hs similarity index 100% rename from raaz-core/Raaz/Core/Constants.hs rename to core/Raaz/Core/Constants.hs diff --git a/raaz-core/Raaz/Core/CpuSupports.hs b/core/Raaz/Core/CpuSupports.hs similarity index 100% rename from raaz-core/Raaz/Core/CpuSupports.hs rename to core/Raaz/Core/CpuSupports.hs diff --git a/raaz-core/Raaz/Core/DH.hs b/core/Raaz/Core/DH.hs similarity index 100% rename from raaz-core/Raaz/Core/DH.hs rename to core/Raaz/Core/DH.hs diff --git a/raaz-core/Raaz/Core/Encode.hs b/core/Raaz/Core/Encode.hs similarity index 100% rename from raaz-core/Raaz/Core/Encode.hs rename to core/Raaz/Core/Encode.hs diff --git a/raaz-core/Raaz/Core/Encode/Base16.hs b/core/Raaz/Core/Encode/Base16.hs similarity index 100% rename from raaz-core/Raaz/Core/Encode/Base16.hs rename to core/Raaz/Core/Encode/Base16.hs diff --git a/raaz-core/Raaz/Core/Encode/Base64.hs b/core/Raaz/Core/Encode/Base64.hs similarity index 100% rename from raaz-core/Raaz/Core/Encode/Base64.hs rename to core/Raaz/Core/Encode/Base64.hs diff --git a/raaz-core/Raaz/Core/Encode/Internal.hs b/core/Raaz/Core/Encode/Internal.hs similarity index 100% rename from raaz-core/Raaz/Core/Encode/Internal.hs rename to core/Raaz/Core/Encode/Internal.hs diff --git a/raaz-core/Raaz/Core/IOCont.hs b/core/Raaz/Core/IOCont.hs similarity index 100% rename from raaz-core/Raaz/Core/IOCont.hs rename to core/Raaz/Core/IOCont.hs diff --git a/raaz-core/Raaz/Core/Memory.hs b/core/Raaz/Core/Memory.hs similarity index 100% rename from raaz-core/Raaz/Core/Memory.hs rename to core/Raaz/Core/Memory.hs diff --git a/raaz-core/Raaz/Core/MonoidalAction.hs b/core/Raaz/Core/MonoidalAction.hs similarity index 100% rename from raaz-core/Raaz/Core/MonoidalAction.hs rename to core/Raaz/Core/MonoidalAction.hs diff --git a/raaz-core/Raaz/Core/Parse/Applicative.hs b/core/Raaz/Core/Parse/Applicative.hs similarity index 100% rename from raaz-core/Raaz/Core/Parse/Applicative.hs rename to core/Raaz/Core/Parse/Applicative.hs diff --git a/raaz-core/Raaz/Core/Primitive.hs b/core/Raaz/Core/Primitive.hs similarity index 100% rename from raaz-core/Raaz/Core/Primitive.hs rename to core/Raaz/Core/Primitive.hs diff --git a/raaz-core/Raaz/Core/Transfer.hs b/core/Raaz/Core/Transfer.hs similarity index 100% rename from raaz-core/Raaz/Core/Transfer.hs rename to core/Raaz/Core/Transfer.hs diff --git a/raaz-core/Raaz/Core/Types.hs b/core/Raaz/Core/Types.hs similarity index 100% rename from raaz-core/Raaz/Core/Types.hs rename to core/Raaz/Core/Types.hs diff --git a/raaz-core/Raaz/Core/Types/Copying.hs b/core/Raaz/Core/Types/Copying.hs similarity index 100% rename from raaz-core/Raaz/Core/Types/Copying.hs rename to core/Raaz/Core/Types/Copying.hs diff --git a/raaz-core/Raaz/Core/Types/Endian.hs b/core/Raaz/Core/Types/Endian.hs similarity index 100% rename from raaz-core/Raaz/Core/Types/Endian.hs rename to core/Raaz/Core/Types/Endian.hs diff --git a/raaz-core/Raaz/Core/Types/Equality.hs b/core/Raaz/Core/Types/Equality.hs similarity index 100% rename from raaz-core/Raaz/Core/Types/Equality.hs rename to core/Raaz/Core/Types/Equality.hs diff --git a/raaz-core/Raaz/Core/Types/Internal.hs b/core/Raaz/Core/Types/Internal.hs similarity index 100% rename from raaz-core/Raaz/Core/Types/Internal.hs rename to core/Raaz/Core/Types/Internal.hs diff --git a/raaz-core/Raaz/Core/Types/Pointer.hs b/core/Raaz/Core/Types/Pointer.hs similarity index 100% rename from raaz-core/Raaz/Core/Types/Pointer.hs rename to core/Raaz/Core/Types/Pointer.hs diff --git a/raaz-core/Raaz/Core/Types/Tuple.hs b/core/Raaz/Core/Types/Tuple.hs similarity index 100% rename from raaz-core/Raaz/Core/Types/Tuple.hs rename to core/Raaz/Core/Types/Tuple.hs diff --git a/raaz-core/Raaz/Core/Util.hs b/core/Raaz/Core/Util.hs similarity index 100% rename from raaz-core/Raaz/Core/Util.hs rename to core/Raaz/Core/Util.hs diff --git a/raaz-core/Raaz/Core/Util/ByteString.hs b/core/Raaz/Core/Util/ByteString.hs similarity index 100% rename from raaz-core/Raaz/Core/Util/ByteString.hs rename to core/Raaz/Core/Util/ByteString.hs diff --git a/raaz-core/Raaz/Primitive/Blake2/Internal.hs b/core/Raaz/Primitive/Blake2/Internal.hs similarity index 100% rename from raaz-core/Raaz/Primitive/Blake2/Internal.hs rename to core/Raaz/Primitive/Blake2/Internal.hs diff --git a/raaz-core/Raaz/Primitive/ChaCha20/Internal.hs b/core/Raaz/Primitive/ChaCha20/Internal.hs similarity index 100% rename from raaz-core/Raaz/Primitive/ChaCha20/Internal.hs rename to core/Raaz/Primitive/ChaCha20/Internal.hs diff --git a/raaz-core/Raaz/Primitive/HashMemory.hs b/core/Raaz/Primitive/HashMemory.hs similarity index 100% rename from raaz-core/Raaz/Primitive/HashMemory.hs rename to core/Raaz/Primitive/HashMemory.hs diff --git a/raaz-core/Raaz/Primitive/Sha256/Internal.hs b/core/Raaz/Primitive/Sha256/Internal.hs similarity index 100% rename from raaz-core/Raaz/Primitive/Sha256/Internal.hs rename to core/Raaz/Primitive/Sha256/Internal.hs diff --git a/raaz-core/Raaz/Primitive/Sha512/Internal.hs b/core/Raaz/Primitive/Sha512/Internal.hs similarity index 100% rename from raaz-core/Raaz/Primitive/Sha512/Internal.hs rename to core/Raaz/Primitive/Sha512/Internal.hs diff --git a/raaz-core/cbits/raaz/core/cpusupports.c b/core/cbits/raaz/core/cpusupports.c similarity index 100% rename from raaz-core/cbits/raaz/core/cpusupports.c rename to core/cbits/raaz/core/cpusupports.c diff --git a/raaz-core/cbits/raaz/core/endian.c b/core/cbits/raaz/core/endian.c similarity index 100% rename from raaz-core/cbits/raaz/core/endian.c rename to core/cbits/raaz/core/endian.c diff --git a/raaz-core/cbits/raaz/core/endian.h b/core/cbits/raaz/core/endian.h similarity index 100% rename from raaz-core/cbits/raaz/core/endian.h rename to core/cbits/raaz/core/endian.h diff --git a/raaz-core/cbits/raaz/core/memory.c b/core/cbits/raaz/core/memory.c similarity index 100% rename from raaz-core/cbits/raaz/core/memory.c rename to core/cbits/raaz/core/memory.c diff --git a/raaz-core/entropy/arc4random/Raaz/Entropy.hs b/core/entropy/arc4random/Raaz/Entropy.hs similarity index 100% rename from raaz-core/entropy/arc4random/Raaz/Entropy.hs rename to core/entropy/arc4random/Raaz/Entropy.hs diff --git a/raaz-core/entropy/getrandom/Raaz/Entropy.hsc b/core/entropy/getrandom/Raaz/Entropy.hsc similarity index 100% rename from raaz-core/entropy/getrandom/Raaz/Entropy.hsc rename to core/entropy/getrandom/Raaz/Entropy.hsc diff --git a/raaz-core/entropy/urandom/Raaz/Entropy.hs b/core/entropy/urandom/Raaz/Entropy.hs similarity index 100% rename from raaz-core/entropy/urandom/Raaz/Entropy.hs rename to core/entropy/urandom/Raaz/Entropy.hs diff --git a/raaz-core/entropy/windows/Raaz/Entropy.hsc b/core/entropy/windows/Raaz/Entropy.hsc similarity index 100% rename from raaz-core/entropy/windows/Raaz/Entropy.hsc rename to core/entropy/windows/Raaz/Entropy.hsc diff --git a/raaz/LICENSE b/implementation/LICENSE similarity index 100% rename from raaz/LICENSE rename to implementation/LICENSE diff --git a/raaz-implementation/Raaz/Primitive/Blake2b/Implementation/CPortable.hs b/implementation/Raaz/Primitive/Blake2b/Implementation/CPortable.hs similarity index 100% rename from raaz-implementation/Raaz/Primitive/Blake2b/Implementation/CPortable.hs rename to implementation/Raaz/Primitive/Blake2b/Implementation/CPortable.hs diff --git a/raaz-implementation/Raaz/Primitive/Blake2s/Implementation/CPortable.hs b/implementation/Raaz/Primitive/Blake2s/Implementation/CPortable.hs similarity index 100% rename from raaz-implementation/Raaz/Primitive/Blake2s/Implementation/CPortable.hs rename to implementation/Raaz/Primitive/Blake2s/Implementation/CPortable.hs diff --git a/raaz-implementation/Raaz/Primitive/ChaCha20/Implementation/CPortable.hs b/implementation/Raaz/Primitive/ChaCha20/Implementation/CPortable.hs similarity index 100% rename from raaz-implementation/Raaz/Primitive/ChaCha20/Implementation/CPortable.hs rename to implementation/Raaz/Primitive/ChaCha20/Implementation/CPortable.hs diff --git a/raaz-implementation/Raaz/Primitive/Sha256/Implementation/CPortable.hs b/implementation/Raaz/Primitive/Sha256/Implementation/CPortable.hs similarity index 100% rename from raaz-implementation/Raaz/Primitive/Sha256/Implementation/CPortable.hs rename to implementation/Raaz/Primitive/Sha256/Implementation/CPortable.hs diff --git a/raaz-implementation/Raaz/Primitive/Sha512/Implementation/CPortable.hs b/implementation/Raaz/Primitive/Sha512/Implementation/CPortable.hs similarity index 100% rename from raaz-implementation/Raaz/Primitive/Sha512/Implementation/CPortable.hs rename to implementation/Raaz/Primitive/Sha512/Implementation/CPortable.hs diff --git a/raaz-implementation/benchmarks/Cipher.hs b/implementation/benchmarks/Cipher.hs similarity index 100% rename from raaz-implementation/benchmarks/Cipher.hs rename to implementation/benchmarks/Cipher.hs diff --git a/raaz-implementation/benchmarks/Main.hs b/implementation/benchmarks/Main.hs similarity index 100% rename from raaz-implementation/benchmarks/Main.hs rename to implementation/benchmarks/Main.hs diff --git a/raaz-implementation/benchmarks/internal/Benchmark/Primitive.hs b/implementation/benchmarks/internal/Benchmark/Primitive.hs similarity index 100% rename from raaz-implementation/benchmarks/internal/Benchmark/Primitive.hs rename to implementation/benchmarks/internal/Benchmark/Primitive.hs diff --git a/raaz-implementation/benchmarks/internal/Benchmark/Types.hs b/implementation/benchmarks/internal/Benchmark/Types.hs similarity index 100% rename from raaz-implementation/benchmarks/internal/Benchmark/Types.hs rename to implementation/benchmarks/internal/Benchmark/Types.hs diff --git a/raaz-implementation/cbits/raaz/cipher/aes/common.c b/implementation/cbits/raaz/cipher/aes/common.c similarity index 100% rename from raaz-implementation/cbits/raaz/cipher/aes/common.c rename to implementation/cbits/raaz/cipher/aes/common.c diff --git a/raaz-implementation/cbits/raaz/cipher/aes/common.h b/implementation/cbits/raaz/cipher/aes/common.h similarity index 100% rename from raaz-implementation/cbits/raaz/cipher/aes/common.h rename to implementation/cbits/raaz/cipher/aes/common.h diff --git a/raaz-implementation/cbits/raaz/cipher/aes/cportable.c b/implementation/cbits/raaz/cipher/aes/cportable.c similarity index 100% rename from raaz-implementation/cbits/raaz/cipher/aes/cportable.c rename to implementation/cbits/raaz/cipher/aes/cportable.c diff --git a/raaz-implementation/cbits/raaz/cipher/aes/cportable.h b/implementation/cbits/raaz/cipher/aes/cportable.h similarity index 100% rename from raaz-implementation/cbits/raaz/cipher/aes/cportable.h rename to implementation/cbits/raaz/cipher/aes/cportable.h diff --git a/raaz-implementation/cbits/raaz/cipher/chacha20/common.h b/implementation/cbits/raaz/cipher/chacha20/common.h similarity index 100% rename from raaz-implementation/cbits/raaz/cipher/chacha20/common.h rename to implementation/cbits/raaz/cipher/chacha20/common.h diff --git a/raaz-implementation/cbits/raaz/cipher/chacha20/cportable.c b/implementation/cbits/raaz/cipher/chacha20/cportable.c similarity index 100% rename from raaz-implementation/cbits/raaz/cipher/chacha20/cportable.c rename to implementation/cbits/raaz/cipher/chacha20/cportable.c diff --git a/raaz-implementation/cbits/raaz/cipher/cportable/aes.c b/implementation/cbits/raaz/cipher/cportable/aes.c similarity index 100% rename from raaz-implementation/cbits/raaz/cipher/cportable/aes.c rename to implementation/cbits/raaz/cipher/cportable/aes.c diff --git a/raaz-implementation/cbits/raaz/cipher/cportable/aes.h b/implementation/cbits/raaz/cipher/cportable/aes.h similarity index 100% rename from raaz-implementation/cbits/raaz/cipher/cportable/aes.h rename to implementation/cbits/raaz/cipher/cportable/aes.h diff --git a/raaz-implementation/cbits/raaz/cipher/cportable/salsa20.c b/implementation/cbits/raaz/cipher/cportable/salsa20.c similarity index 100% rename from raaz-implementation/cbits/raaz/cipher/cportable/salsa20.c rename to implementation/cbits/raaz/cipher/cportable/salsa20.c diff --git a/raaz-implementation/cbits/raaz/cipher/cportable/salsa20.h b/implementation/cbits/raaz/cipher/cportable/salsa20.h similarity index 100% rename from raaz-implementation/cbits/raaz/cipher/cportable/salsa20.h rename to implementation/cbits/raaz/cipher/cportable/salsa20.h diff --git a/raaz-implementation/cbits/raaz/hash/blake2/blake2b/constants.h b/implementation/cbits/raaz/hash/blake2/blake2b/constants.h similarity index 100% rename from raaz-implementation/cbits/raaz/hash/blake2/blake2b/constants.h rename to implementation/cbits/raaz/hash/blake2/blake2b/constants.h diff --git a/raaz-implementation/cbits/raaz/hash/blake2/blake2b/portable.c b/implementation/cbits/raaz/hash/blake2/blake2b/portable.c similarity index 100% rename from raaz-implementation/cbits/raaz/hash/blake2/blake2b/portable.c rename to implementation/cbits/raaz/hash/blake2/blake2b/portable.c diff --git a/raaz-implementation/cbits/raaz/hash/blake2/blake2s/constants.h b/implementation/cbits/raaz/hash/blake2/blake2s/constants.h similarity index 100% rename from raaz-implementation/cbits/raaz/hash/blake2/blake2s/constants.h rename to implementation/cbits/raaz/hash/blake2/blake2s/constants.h diff --git a/raaz-implementation/cbits/raaz/hash/blake2/blake2s/portable.c b/implementation/cbits/raaz/hash/blake2/blake2s/portable.c similarity index 100% rename from raaz-implementation/cbits/raaz/hash/blake2/blake2s/portable.c rename to implementation/cbits/raaz/hash/blake2/blake2s/portable.c diff --git a/raaz-implementation/cbits/raaz/hash/blake2/common.h b/implementation/cbits/raaz/hash/blake2/common.h similarity index 100% rename from raaz-implementation/cbits/raaz/hash/blake2/common.h rename to implementation/cbits/raaz/hash/blake2/common.h diff --git a/raaz-implementation/cbits/raaz/hash/sha1/portable.c b/implementation/cbits/raaz/hash/sha1/portable.c similarity index 100% rename from raaz-implementation/cbits/raaz/hash/sha1/portable.c rename to implementation/cbits/raaz/hash/sha1/portable.c diff --git a/raaz-implementation/cbits/raaz/hash/sha256/portable.c b/implementation/cbits/raaz/hash/sha256/portable.c similarity index 100% rename from raaz-implementation/cbits/raaz/hash/sha256/portable.c rename to implementation/cbits/raaz/hash/sha256/portable.c diff --git a/raaz-implementation/cbits/raaz/hash/sha512/portable.c b/implementation/cbits/raaz/hash/sha512/portable.c similarity index 100% rename from raaz-implementation/cbits/raaz/hash/sha512/portable.c rename to implementation/cbits/raaz/hash/sha512/portable.c diff --git a/raaz-core-indef/raaz-core-indef.cabal b/raaz-core-indef/raaz-core-indef.cabal deleted file mode 100644 index a2be95730..000000000 --- a/raaz-core-indef/raaz-core-indef.cabal +++ /dev/null @@ -1,49 +0,0 @@ -cabal-version: 2.2 - -name: raaz-core-indef -version: 0.3.0 - -synopsis: The signature package for implementations of primitives in raaz. - -description: This package is part of the raaz cryptographic library - that abstracts out implementations of cryptographic primitives as a - signature. To provide a new implementation of primitive, one builds - a module that satisfy the signature given here. The standard - implementaions are separately provided by the raaz-implementation - package. Some of these implementations might use hardware specific - features like (avx2 instructions in x86_64). This interface provides - a way for down stream users to "plugin" the best interface depending - on the hardware. - -homepage: https://github.com/raaz-crypto/raaz - -license: BSD-3-Clause -license-file: LICENSE -author: Piyush P Kurur -maintainer: ppk@cse.iitk.ac.in - -category: Codec, Raaz -build-type: Simple - -bug-reports: https://github.com/raaz-crypto/raaz/issues - -source-repository head - type: git - location: https://github.com/raaz-crypto/raaz-core-indef - - ----------------------- System specific configurations ---------------------------------- - - -library - default-language: Haskell2010 - ghc-options: -Wall - build-depends: base >= 4.7 && < 4.12 - , bytestring >= 0.9 && < 0.11 - , deepseq >= 1.1 && < 1.5 - , vector >= 0.7.1 && < 0.13 - , mtl - , raaz-core >= 0.3 && < 0.4 - hs-source-dirs: . - - signatures: Raaz.Primitive.Implementation - exposed-modules: Raaz.Primitive.Util diff --git a/raaz-core/raaz-core.cabal b/raaz-core/raaz-core.cabal deleted file mode 100644 index 676689ae9..000000000 --- a/raaz-core/raaz-core.cabal +++ /dev/null @@ -1,116 +0,0 @@ -cabal-version: 2.2 - -name: raaz-core -version: 0.3.0 - -synopsis: The core types and signatures of the raaz cryptographic library. - -description: Raaz is a cryptographic library for Haskell. The library - is designed with a special emphasis on using the type system of - Haskell to eliminate a large set of vulnerabilities like buffer - overflows, timing attacks etc. It also strives to achieve this - safety with no compromise on performance. - -homepage: https://github.com/raaz-crypto/raaz - -license: BSD-3-Clause -license-file: LICENSE -author: Piyush P Kurur -maintainer: ppk@cse.iitk.ac.in - -category: Codec, Raaz -build-type: Simple - -bug-reports: https://github.com/raaz-crypto/raaz/issues - --- List of platform specific source files. -extra-source-files: entropy/urandom/Raaz/Entropy.hs - entropy/arc4random/Raaz/Entropy.hs - entropy/getrandom/Raaz/Entropy.hsc - entropy/windows/Raaz/Entropy.hsc - -source-repository head - type: git - location: https://github.com/raaz-crypto/raaz - -------------------------- Flags ------------------------------------------------------------- -flag linux-getrandom - - Description: Use the getrandom for system entropy instead of - /dev/urandom. Enabled by default but disable this for kernel < 3.17. - - Default: True - Manual: True - ----------------------------- The common clause ------------------------------------------------ - -common defaults - default-language: Haskell2010 - ghc-options: -Wall - build-depends: base >= 4.7 && < 4.12 - , bytestring >= 0.9 && < 0.11 - , deepseq >= 1.1 && < 1.5 - , vector >= 0.7.1 && < 0.13 - , mtl - - ----------------------- System specific configurations ---------------------------------- - - if os(linux) - cc-options: -DPLATFORM_LINUX - if os(osx) - cc-options: -DPLATFORM_OSX - if os(openbsd) - cc-options: -DPLATFORM_OPENBSD - if os(windows) - cc-options: -DPLATFORM_WINDOWS -DUNICODE - cpp-options: -DPLATFORM_WINDOWS - extra-libraries: Advapi32, Kernel32 - build-tools: hsc2hs - ------------------------------ The core library ------------------------------------------------ -library - import: defaults - hs-source-dirs: . - exposed-modules: Raaz.Core - , Raaz.Core.ByteSource - , Raaz.Core.CpuSupports - , Raaz.Core.Encode - , Raaz.Core.Memory - , Raaz.Core.MonoidalAction - , Raaz.Core.Parse.Applicative - , Raaz.Core.Primitive - , Raaz.Core.Types - , Raaz.Core.Types.Internal - , Raaz.Core.Util - , Raaz.Core.Transfer - , Raaz.Entropy - , Raaz.Primitive.HashMemory - , Raaz.Primitive.Blake2.Internal - , Raaz.Primitive.Sha256.Internal - , Raaz.Primitive.Sha512.Internal - , Raaz.Primitive.ChaCha20.Internal - - other-modules: Raaz.Core.Constants - , Raaz.Core.Encode.Internal - , Raaz.Core.Encode.Base16 - , Raaz.Core.Encode.Base64 - , Raaz.Core.IOCont - , Raaz.Core.Util.ByteString - , Raaz.Core.Types.Pointer - , Raaz.Core.Types.Tuple - , Raaz.Core.Types.Equality - , Raaz.Core.Types.Endian - , Raaz.Core.Types.Copying - c-sources: cbits/raaz/core/endian.c - , cbits/raaz/core/memory.c - , cbits/raaz/core/cpusupports.c - include-dirs: cbits - includes: raaz/core/endian.h - install-includes: cbits/raaz/core/endian.h - - --------------------- Entropy ---------------------------------------------- - - if os(windows) { hs-source-dirs: entropy/windows } - elif os(openbsd) || os(netbsd) { hs-source-dirs: entropy/arc4random } - elif os(linux) && flag(linux-getrandom) { hs-source-dirs: entropy/getrandom } - else { hs-source-dirs: entropy/urandom } diff --git a/raaz-implementation/raaz-implementation.cabal b/raaz-implementation/raaz-implementation.cabal deleted file mode 100644 index 4016259ea..000000000 --- a/raaz-implementation/raaz-implementation.cabal +++ /dev/null @@ -1,143 +0,0 @@ -cabal-version: 2.2 - -name: raaz-implementation -version: 0.3.0 - -synopsis: The low level implementation of cryptographic primitives in raaz. - -description: This package contains the low level implementation of - cryptographic primitives for the raaz cryptographic - library. Together with the signature Raaz.Primitive.Implementation - provided by the raaz-implementaton-indef package, advanced users can - select the implementation that is best suited to their platform - instead of the default that has been selected by the system library. - - - -homepage: https://github.com/raaz-crypto/raaz - -license: BSD-3-Clause -license-file: LICENSE -author: Piyush P Kurur -maintainer: ppk@cse.iitk.ac.in - -category: Codec, Raaz -build-type: Simple - -bug-reports: https://github.com/raaz-crypto/raaz/issues - -source-repository head - type: git - location: https://github.com/raaz-crypto/raaz/raaz-implementation - -------------------------- Flags ------------------------------------------------------------- - -flag native - - Description: Compile for native architecture. Often this enables - a lot of platform specific optimisation which lead to better - performance. Do not enable this when packaging though. Also - tested only with gcc - - Default: False - Manual: True - -flag avx2 - - Description: Support avx2 optimisations. Warning: enable only if - you are sure of support. - - Default: False - Manual: True - ----------------------------- The common clause ------------------------------------------------ - -common defaults - default-language: Haskell2010 - ghc-options: -Wall - build-depends: base >= 4.7 && < 4.12 - , bytestring >= 0.9 && < 0.11 - , deepseq >= 1.1 && < 1.5 - , vector >= 0.7.1 && < 0.13 - , mtl - - if flag(native) - cc-options: -march=native - - if flag(avx2) - cc-options: -mavx2 - - ----------------------- System specific configurations ---------------------------------- - - if os(linux) - cc-options: -DPLATFORM_LINUX - if os(osx) - cc-options: -DPLATFORM_OSX - if os(openbsd) - cc-options: -DPLATFORM_OPENBSD - if os(windows) - cc-options: -DPLATFORM_WINDOWS -DUNICODE - cpp-options: -DPLATFORM_WINDOWS - extra-libraries: Advapi32, Kernel32 - build-tools: hsc2hs - ------------------------------ The core library ------------------------------------------------ -library - import: defaults - hs-source-dirs: . - exposed-modules: Raaz.Primitive.Blake2b.Implementation.CPortable - , Raaz.Primitive.Blake2s.Implementation.CPortable - , Raaz.Primitive.Sha256.Implementation.CPortable - , Raaz.Primitive.Sha512.Implementation.CPortable - , Raaz.Primitive.ChaCha20.Implementation.CPortable - - c-sources: cbits/raaz/hash/blake2/blake2b/portable.c - , cbits/raaz/hash/blake2/blake2s/portable.c - , cbits/raaz/hash/sha1/portable.c - , cbits/raaz/hash/sha256/portable.c - , cbits/raaz/hash/sha512/portable.c - , cbits/raaz/cipher/chacha20/cportable.c - include-dirs: cbits/ - includes: cbits/raaz/hash/blake2/common.h - , cbits/raaz/hash/blake2/blake2b/constants.h - , cbits/raaz/hash/blake2/blake2s/constants.h - - build-depends: raaz-core >= 0.3 && < 0.4 - - ---------------------------- Benchmarkings --------------------------------------------- - -library benchmark-internal - import: defaults - hs-source-dirs: benchmarks/internal - exposed-modules: Benchmark.Primitive - , Benchmark.Types - build-depends: criterion-measurement >= 0.1 - , pretty - , raaz-core >= 0.3 && < 0.4 - , raaz-core-indef >= 0.3 && < 0.4 - -benchmark primitives - import: defaults - hs-source-dirs: benchmarks - main-is: Main.hs - type: exitcode-stdio-1.0 - build-depends: pretty - , raaz-core - , raaz-implementation >= 0.3 && < 0.4 - , benchmark-internal - - mixins: benchmark-internal (Benchmark.Primitive as Benchmark.Blake2b.CPortable, Benchmark.Types) - requires (Raaz.Primitive.Implementation as Raaz.Primitive.Blake2b.Implementation.CPortable) - - , benchmark-internal (Benchmark.Primitive as Benchmark.Blake2s.CPortable) - requires (Raaz.Primitive.Implementation as Raaz.Primitive.Blake2s.Implementation.CPortable) - - , benchmark-internal (Benchmark.Primitive as Benchmark.ChaCha20.CPortable) - requires (Raaz.Primitive.Implementation as Raaz.Primitive.ChaCha20.Implementation.CPortable) - - , benchmark-internal (Benchmark.Primitive as Benchmark.Sha256.CPortable) - requires (Raaz.Primitive.Implementation as Raaz.Primitive.Sha256.Implementation.CPortable) - - , benchmark-internal (Benchmark.Primitive as Benchmark.Sha512.CPortable) - requires (Raaz.Primitive.Implementation as Raaz.Primitive.Sha512.Implementation.CPortable) diff --git a/raaz.cabal b/raaz.cabal new file mode 100644 index 000000000..dc847f094 --- /dev/null +++ b/raaz.cabal @@ -0,0 +1,256 @@ +cabal-version: 2.2 + +name: raaz +version: 0.3.0 + +synopsis: The raaz cryptographic library. + +description: Raaz is a cryptographic library for Haskell. The library + is designed with a special emphasis on using the type system of + Haskell to eliminate a large set of vulnerabilities like buffer + overflows, timing attacks etc. It also strives to achieve this + safety with no compromise on performance. + +homepage: https://github.com/raaz-crypto/raaz + +license: BSD-3-Clause +license-file: LICENSE +author: Piyush P Kurur +maintainer: ppk@cse.iitk.ac.in + +category: Codec, Raaz +build-type: Simple + + +-- extra-source-files: CHANGELOG.md +-- , README.md +-- , Releasing.md +-- , Reviewing.md + +bug-reports: https://github.com/raaz-crypto/raaz/issues + +source-repository head + type: git + location: https://github.com/raaz-crypto/raaz + + + +------------------------- Flags ------------------------------------------------------------- + +flag linux-getrandom + + Description: Use the getrandom for system entropy instead of + /dev/urandom. Enabled by default but disable this when building for kernel < 3.17. + + Default: True + Manual: True + +flag native + + Description: Compile for native architecture. Often this enables + a lot of platform specific optimisation which lead to better + performance. Do not enable this when packaging though. Also + tested only with gcc + + Default: False + Manual: True + +flag avx2 + + Description: Support avx2 optimisations. Warning: enable only if + you are sure of support. + + Default: False + Manual: True + + +---------------------------- The common clause ------------------------------------------------ + +common defaults + default-language: Haskell2010 + ghc-options: -Wall + build-depends: base >= 4.7 && < 4.12 + , bytestring >= 0.9 && < 0.11 + , deepseq >= 1.1 && < 1.5 + , vector >= 0.7.1 && < 0.13 + , mtl + + ----------------------- System specific configurations ---------------------------------- + + if os(linux) + cc-options: -DPLATFORM_LINUX + if os(osx) + cc-options: -DPLATFORM_OSX + if os(openbsd) + cc-options: -DPLATFORM_OPENBSD + if os(windows) + cc-options: -DPLATFORM_WINDOWS -DUNICODE + cpp-options: -DPLATFORM_WINDOWS + extra-libraries: Advapi32, Kernel32 + build-tools: hsc2hs + + +----------------------------- The core library ------------------------------------------------ +library core + import: defaults + hs-source-dirs: core + exposed-modules: Raaz.Core + , Raaz.Core.ByteSource + , Raaz.Core.CpuSupports + , Raaz.Core.Encode + , Raaz.Core.Memory + , Raaz.Core.MonoidalAction + , Raaz.Core.Parse.Applicative + , Raaz.Core.Primitive + , Raaz.Core.Types + , Raaz.Core.Types.Internal + , Raaz.Core.Util + , Raaz.Core.Transfer + , Raaz.Entropy + , Raaz.Primitive.HashMemory + , Raaz.Primitive.Blake2.Internal + , Raaz.Primitive.Sha256.Internal + , Raaz.Primitive.Sha512.Internal + , Raaz.Primitive.ChaCha20.Internal + + other-modules: Raaz.Core.Constants + , Raaz.Core.Encode.Internal + , Raaz.Core.Encode.Base16 + , Raaz.Core.Encode.Base64 + , Raaz.Core.IOCont + , Raaz.Core.Util.ByteString + , Raaz.Core.Types.Pointer + , Raaz.Core.Types.Tuple + , Raaz.Core.Types.Equality + , Raaz.Core.Types.Endian + , Raaz.Core.Types.Copying + c-sources: core/cbits/raaz/core/endian.c + , core/cbits/raaz/core/memory.c + , core/cbits/raaz/core/cpusupports.c + include-dirs: core/cbits + includes: core/cbits/raaz/core/endian.h + install-includes: core/cbits/raaz/core/endian.h + + --------------------- Entropy ---------------------------------------------- + + if os(windows) { hs-source-dirs: core/entropy/windows } + elif os(openbsd) || os(netbsd) { hs-source-dirs: core/entropy/arc4random } + elif os(linux) && flag(linux-getrandom) { hs-source-dirs: core/entropy/getrandom } + else { hs-source-dirs: core/entropy/urandom } + + +---------------------- The signatures relevant for core --------------------------- + +library core-indef + import: defaults + build-depends: core + hs-source-dirs: core-indef + signatures: Raaz.Primitive.Implementation + exposed-modules: Raaz.Primitive.Util + + +-------------------- The implementation modules ---------------------------------- + +library implementation + import: defaults + build-depends: core + hs-source-dirs: implementation + exposed-modules: Raaz.Primitive.Blake2b.Implementation.CPortable + , Raaz.Primitive.Blake2s.Implementation.CPortable + , Raaz.Primitive.Sha256.Implementation.CPortable + , Raaz.Primitive.Sha512.Implementation.CPortable + , Raaz.Primitive.ChaCha20.Implementation.CPortable + + c-sources: implementation/cbits/raaz/hash/blake2/blake2b/portable.c + , implementation/cbits/raaz/hash/blake2/blake2s/portable.c + , implementation/cbits/raaz/hash/sha1/portable.c + , implementation/cbits/raaz/hash/sha256/portable.c + , implementation/cbits/raaz/hash/sha512/portable.c + , implementation/cbits/raaz/cipher/chacha20/cportable.c + include-dirs: implementation/cbits/ + includes: implementation/cbits/raaz/hash/blake2/common.h + , implementation/cbits/raaz/hash/blake2/blake2b/constants.h + , implementation/cbits/raaz/hash/blake2/blake2s/constants.h + +-------------------------------- The main raaz library ------------------------------------- + +library + import: defaults + hs-source-dirs: raaz + build-depends: core + , core-indef + , implementation + exposed-modules: Raaz + , Raaz.Hash + , Raaz.Cipher + , Raaz.Random + , Raaz.Random.Internal + , Raaz.Random.ChaCha20PRG + , Paths_raaz + autogen-modules: Paths_raaz + mixins: core-indef (Raaz.Primitive.Util as Raaz.Hash.Blake2b.Util) + requires (Raaz.Primitive.Implementation as Raaz.Primitive.Blake2b.Implementation.CPortable) + , core-indef (Raaz.Primitive.Util as Raaz.Hash.Blake2s.Util) + requires (Raaz.Primitive.Implementation as Raaz.Primitive.Blake2s.Implementation.CPortable) + , core-indef (Raaz.Primitive.Util as Raaz.Hash.Sha256.Util) + requires (Raaz.Primitive.Implementation as Raaz.Primitive.Sha256.Implementation.CPortable) + , core-indef (Raaz.Primitive.Util as Raaz.Hash.Sha512.Util) + requires (Raaz.Primitive.Implementation as Raaz.Primitive.Sha512.Implementation.CPortable) + , core-indef (Raaz.Primitive.Util as Raaz.Cipher.ChaCha20.Util) + requires (Raaz.Primitive.Implementation as Raaz.Primitive.ChaCha20.Implementation.CPortable) + +---------------------------- Executables ------------------------------------------------- + +executable raaz + import: defaults + hs-source-dirs: raaz/bin + main-is: Main.hs + other-modules: Command.Checksum + , Command.Rand + , Command.Info + , Usage + build-depends: optparse-applicative >= 0.13.0.0 + , core + , raaz + if impl(ghc < 8) + -- 'transformers' needed for "Control.Monad.IO.Class" only + -- starting with base-4.9 we don't need 'transformers' anymore + build-depends: transformers + +-- ---------------------------- Test suit ----------------------------------------------------- + +test-suite spec + import: defaults + type: exitcode-stdio-1.0 + hs-source-dirs: raaz/spec + main-is: Spec.hs + + build-depends: raaz + , core + build-depends: HUnit >= 1.2 + , QuickCheck >= 2.4 + , hspec + , hspec-discover + , transformers + , vector + + build-tool-depends: hspec-discover:hspec-discover + if !os(windows) + cpp-options: -DHAVE_DEV_NULL + + other-modules: Common + , Common.Cipher + , Common.Hash + , Common.Imports + , Common.Instances + , Common.Utils + , Raaz.Cipher.ChaCha20Spec + , Raaz.Core.ByteSourceSpec + , Raaz.Core.EncodeSpec + , Raaz.Core.MemorySpec + , Raaz.Core.Types.WordSpec + , Raaz.Core.Util.ByteStringSpec + , Raaz.RandomSpec + , Raaz.Hash.Sha256Spec + , Raaz.Hash.Sha512Spec + , Raaz.Hash.Blake2Spec diff --git a/raaz/raaz.cabal b/raaz/raaz.cabal deleted file mode 100644 index 36c728bc6..000000000 --- a/raaz/raaz.cabal +++ /dev/null @@ -1,141 +0,0 @@ -cabal-version: 2.2 - -name: raaz -version: 0.3.0 - -synopsis: The raaz cryptographic library. - -description: Raaz is a cryptographic library for Haskell. The library - is designed with a special emphasis on using the type system of - Haskell to eliminate a large set of vulnerabilities like buffer - overflows, timing attacks etc. It also strives to achieve this - safety with no compromise on performance. - -homepage: https://github.com/raaz-crypto/raaz - -license: BSD-3-Clause -license-file: LICENSE -author: Piyush P Kurur -maintainer: ppk@cse.iitk.ac.in - -category: Codec, Raaz -build-type: Simple - - --- extra-source-files: CHANGELOG.md --- , README.md --- , Releasing.md --- , Reviewing.md - -bug-reports: https://github.com/raaz-crypto/raaz/issues - -source-repository head - type: git - location: https://github.com/raaz-crypto/raaz - ----------------------------- The common clause ------------------------------------------------ - -common defaults - default-language: Haskell2010 - ghc-options: -Wall - build-depends: base >= 4.7 && < 4.12 - , bytestring >= 0.9 && < 0.11 - , deepseq >= 1.1 && < 1.5 - , vector >= 0.7.1 && < 0.13 - , mtl - - ----------------------- System specific configurations ---------------------------------- - - if os(linux) - cc-options: -DPLATFORM_LINUX - if os(osx) - cc-options: -DPLATFORM_OSX - if os(openbsd) - cc-options: -DPLATFORM_OPENBSD - if os(windows) - cc-options: -DPLATFORM_WINDOWS -DUNICODE - cpp-options: -DPLATFORM_WINDOWS - extra-libraries: Advapi32, Kernel32 - build-tools: hsc2hs - - -library - import: defaults - hs-source-dirs: . - build-depends: raaz-core >= 0.3 && < 0.4 - , raaz-implementation >= 0.3 && < 0.4 - , raaz-core-indef >= 0.3 && < 0.4 - exposed-modules: Raaz - , Raaz.Hash - , Raaz.Cipher - , Raaz.Random - , Raaz.Random.Internal - , Raaz.Random.ChaCha20PRG - , Paths_raaz - autogen-modules: Paths_raaz - mixins: raaz-core-indef (Raaz.Primitive.Util as Raaz.Hash.Blake2b.Util) - requires (Raaz.Primitive.Implementation as Raaz.Primitive.Blake2b.Implementation.CPortable) - , raaz-core-indef (Raaz.Primitive.Util as Raaz.Hash.Blake2s.Util) - requires (Raaz.Primitive.Implementation as Raaz.Primitive.Blake2s.Implementation.CPortable) - , raaz-core-indef (Raaz.Primitive.Util as Raaz.Hash.Sha256.Util) - requires (Raaz.Primitive.Implementation as Raaz.Primitive.Sha256.Implementation.CPortable) - , raaz-core-indef (Raaz.Primitive.Util as Raaz.Hash.Sha512.Util) - requires (Raaz.Primitive.Implementation as Raaz.Primitive.Sha512.Implementation.CPortable) - , raaz-core-indef (Raaz.Primitive.Util as Raaz.Cipher.ChaCha20.Util) - requires (Raaz.Primitive.Implementation as Raaz.Primitive.ChaCha20.Implementation.CPortable) - ----------------------------- Executables ------------------------------------------------- - -executable raaz - import: defaults - hs-source-dirs: bin - main-is: Main.hs - other-modules: Command.Checksum - , Command.Rand - , Command.Info - , Usage - build-depends: optparse-applicative >= 0.13.0.0 - , raaz-core - , raaz - if impl(ghc < 8) - -- 'transformers' needed for "Control.Monad.IO.Class" only - -- starting with base-4.9 we don't need 'transformers' anymore - build-depends: transformers - --- ---------------------------- Test suit ----------------------------------------------------- - -test-suite spec - import: defaults - type: exitcode-stdio-1.0 - hs-source-dirs: spec - main-is: Spec.hs - - build-depends: raaz - , raaz-core - build-depends: HUnit >= 1.2 - , QuickCheck >= 2.4 - , hspec - , hspec-discover - , transformers - , vector - - build-tool-depends: hspec-discover:hspec-discover - if !os(windows) - cpp-options: -DHAVE_DEV_NULL - - other-modules: Common - , Common.Cipher - , Common.Hash - , Common.Imports - , Common.Instances - , Common.Utils - , Raaz.Cipher.ChaCha20Spec - , Raaz.Core.ByteSourceSpec - , Raaz.Core.EncodeSpec - , Raaz.Core.MemorySpec - , Raaz.Core.Types.WordSpec - , Raaz.Core.Util.ByteStringSpec - , Raaz.RandomSpec - , Raaz.Hash.Sha256Spec - , Raaz.Hash.Sha512Spec - , Raaz.Hash.Blake2Spec From 5fa53d4f67ea55a5039765a906cd053135de6e2b Mon Sep 17 00:00:00 2001 From: Piyush P Kurur Date: Thu, 20 Sep 2018 15:17:15 +0530 Subject: [PATCH 2/8] remove some unwanted LICENSE file. --- core-indef/LICENSE | 30 ------------------------------ core/LICENSE | 30 ------------------------------ implementation/LICENSE | 30 ------------------------------ 3 files changed, 90 deletions(-) delete mode 100644 core-indef/LICENSE delete mode 100644 core/LICENSE delete mode 100644 implementation/LICENSE diff --git a/core-indef/LICENSE b/core-indef/LICENSE deleted file mode 100644 index 028b9525e..000000000 --- a/core-indef/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Copyright (c) 2012, Piyush P Kurur - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of Piyush P Kurur nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/core/LICENSE b/core/LICENSE deleted file mode 100644 index 028b9525e..000000000 --- a/core/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Copyright (c) 2012, Piyush P Kurur - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of Piyush P Kurur nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/implementation/LICENSE b/implementation/LICENSE deleted file mode 100644 index 028b9525e..000000000 --- a/implementation/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Copyright (c) 2012, Piyush P Kurur - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of Piyush P Kurur nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. From 9b6a9c0f89db3dac3ea6153e3de1d41bfd1b2f8e Mon Sep 17 00:00:00 2001 From: Piyush P Kurur Date: Thu, 20 Sep 2018 15:20:13 +0530 Subject: [PATCH 3/8] cabal-file: set the appropriate conditionals. - options to the C compiler now based on flags - make some os specific flags fit on one line. --- raaz.cabal | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/raaz.cabal b/raaz.cabal index dc847f094..3e78f437a 100644 --- a/raaz.cabal +++ b/raaz.cabal @@ -75,14 +75,16 @@ common defaults , vector >= 0.7.1 && < 0.13 , mtl + ------------------------ Compiler optimisation flags ------------------------------------- + + if flag(native) { cc-options: -march=native } + if flag(avx2) { cc-options: -mavx2 } + ----------------------- System specific configurations ---------------------------------- - if os(linux) - cc-options: -DPLATFORM_LINUX - if os(osx) - cc-options: -DPLATFORM_OSX - if os(openbsd) - cc-options: -DPLATFORM_OPENBSD + if os(linux) { cc-options: -DPLATFORM_LINUX } + if os(osx) { cc-options: -DPLATFORM_OSX } + if os(openbsd) { cc-options: -DPLATFORM_OPENBSD } if os(windows) cc-options: -DPLATFORM_WINDOWS -DUNICODE cpp-options: -DPLATFORM_WINDOWS From d8d4a22e4d9eae0f2a8d7ff90bad5c6cee73118e Mon Sep 17 00:00:00 2001 From: Piyush P Kurur Date: Thu, 20 Sep 2018 15:29:04 +0530 Subject: [PATCH 4/8] benchmarks now added. --- raaz.cabal | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/raaz.cabal b/raaz.cabal index 3e78f437a..b8ab607df 100644 --- a/raaz.cabal +++ b/raaz.cabal @@ -256,3 +256,40 @@ test-suite spec , Raaz.Hash.Sha256Spec , Raaz.Hash.Sha512Spec , Raaz.Hash.Blake2Spec + +--------------------------- Benchmarkings --------------------------------------------- + +library benchmark-internal + import: defaults + hs-source-dirs: implementation/benchmarks/internal + exposed-modules: Benchmark.Primitive + , Benchmark.Types + build-depends: criterion-measurement >= 0.1 + , pretty + , core + , core-indef + +benchmark primitives + import: defaults + hs-source-dirs: implementation/benchmarks + main-is: Main.hs + type: exitcode-stdio-1.0 + build-depends: pretty + , core + , implementation + , benchmark-internal + + mixins: benchmark-internal (Benchmark.Primitive as Benchmark.Blake2b.CPortable, Benchmark.Types) + requires (Raaz.Primitive.Implementation as Raaz.Primitive.Blake2b.Implementation.CPortable) + + , benchmark-internal (Benchmark.Primitive as Benchmark.Blake2s.CPortable) + requires (Raaz.Primitive.Implementation as Raaz.Primitive.Blake2s.Implementation.CPortable) + + , benchmark-internal (Benchmark.Primitive as Benchmark.ChaCha20.CPortable) + requires (Raaz.Primitive.Implementation as Raaz.Primitive.ChaCha20.Implementation.CPortable) + + , benchmark-internal (Benchmark.Primitive as Benchmark.Sha256.CPortable) + requires (Raaz.Primitive.Implementation as Raaz.Primitive.Sha256.Implementation.CPortable) + + , benchmark-internal (Benchmark.Primitive as Benchmark.Sha512.CPortable) + requires (Raaz.Primitive.Implementation as Raaz.Primitive.Sha512.Implementation.CPortable) From 25ef657075f3a92f71ba994bb85a80a55e0897f3 Mon Sep 17 00:00:00 2001 From: Piyush P Kurur Date: Thu, 20 Sep 2018 16:12:55 +0530 Subject: [PATCH 5/8] better source dir for tests and benchmarks. --- {implementation/benchmarks => benchmarks}/Cipher.hs | 0 {implementation/benchmarks => benchmarks}/Main.hs | 0 .../internal/Benchmark/Primitive.hs | 0 .../benchmarks => benchmarks}/internal/Benchmark/Types.hs | 0 raaz.cabal | 8 ++++---- {raaz/spec => tests}/Common.hs | 0 {raaz/spec => tests}/Common/Cipher.hs | 0 {raaz/spec => tests}/Common/Hash.hs | 0 {raaz/spec => tests}/Common/Imports.hs | 0 {raaz/spec => tests}/Common/Instances.hs | 0 {raaz/spec => tests}/Common/Utils.hs | 0 {raaz/spec => tests}/Raaz/Cipher/ChaCha20Spec.hs | 0 {raaz/spec => tests}/Raaz/Core/ByteSourceSpec.hs | 0 {raaz/spec => tests}/Raaz/Core/EncodeSpec.hs | 0 {raaz/spec => tests}/Raaz/Core/MemorySpec.hs | 0 {raaz/spec => tests}/Raaz/Core/Types/WordSpec.hs | 0 {raaz/spec => tests}/Raaz/Core/Util/ByteStringSpec.hs | 0 {raaz/spec => tests}/Raaz/Hash/Blake2Spec.hs | 0 {raaz/spec => tests}/Raaz/Hash/Sha256Spec.hs | 0 {raaz/spec => tests}/Raaz/Hash/Sha512Spec.hs | 0 {raaz/spec => tests}/Raaz/RandomSpec.hs | 0 {raaz/spec => tests}/Spec.hs | 0 {raaz/spec => tests}/entropyquality.sh | 0 {raaz/spec => tests}/prgquality.sh | 0 24 files changed, 4 insertions(+), 4 deletions(-) rename {implementation/benchmarks => benchmarks}/Cipher.hs (100%) rename {implementation/benchmarks => benchmarks}/Main.hs (100%) rename {implementation/benchmarks => benchmarks}/internal/Benchmark/Primitive.hs (100%) rename {implementation/benchmarks => benchmarks}/internal/Benchmark/Types.hs (100%) rename {raaz/spec => tests}/Common.hs (100%) rename {raaz/spec => tests}/Common/Cipher.hs (100%) rename {raaz/spec => tests}/Common/Hash.hs (100%) rename {raaz/spec => tests}/Common/Imports.hs (100%) rename {raaz/spec => tests}/Common/Instances.hs (100%) rename {raaz/spec => tests}/Common/Utils.hs (100%) rename {raaz/spec => tests}/Raaz/Cipher/ChaCha20Spec.hs (100%) rename {raaz/spec => tests}/Raaz/Core/ByteSourceSpec.hs (100%) rename {raaz/spec => tests}/Raaz/Core/EncodeSpec.hs (100%) rename {raaz/spec => tests}/Raaz/Core/MemorySpec.hs (100%) rename {raaz/spec => tests}/Raaz/Core/Types/WordSpec.hs (100%) rename {raaz/spec => tests}/Raaz/Core/Util/ByteStringSpec.hs (100%) rename {raaz/spec => tests}/Raaz/Hash/Blake2Spec.hs (100%) rename {raaz/spec => tests}/Raaz/Hash/Sha256Spec.hs (100%) rename {raaz/spec => tests}/Raaz/Hash/Sha512Spec.hs (100%) rename {raaz/spec => tests}/Raaz/RandomSpec.hs (100%) rename {raaz/spec => tests}/Spec.hs (100%) rename {raaz/spec => tests}/entropyquality.sh (100%) rename {raaz/spec => tests}/prgquality.sh (100%) diff --git a/implementation/benchmarks/Cipher.hs b/benchmarks/Cipher.hs similarity index 100% rename from implementation/benchmarks/Cipher.hs rename to benchmarks/Cipher.hs diff --git a/implementation/benchmarks/Main.hs b/benchmarks/Main.hs similarity index 100% rename from implementation/benchmarks/Main.hs rename to benchmarks/Main.hs diff --git a/implementation/benchmarks/internal/Benchmark/Primitive.hs b/benchmarks/internal/Benchmark/Primitive.hs similarity index 100% rename from implementation/benchmarks/internal/Benchmark/Primitive.hs rename to benchmarks/internal/Benchmark/Primitive.hs diff --git a/implementation/benchmarks/internal/Benchmark/Types.hs b/benchmarks/internal/Benchmark/Types.hs similarity index 100% rename from implementation/benchmarks/internal/Benchmark/Types.hs rename to benchmarks/internal/Benchmark/Types.hs diff --git a/raaz.cabal b/raaz.cabal index b8ab607df..7f08705e6 100644 --- a/raaz.cabal +++ b/raaz.cabal @@ -221,10 +221,10 @@ executable raaz -- ---------------------------- Test suit ----------------------------------------------------- -test-suite spec +test-suite tests import: defaults type: exitcode-stdio-1.0 - hs-source-dirs: raaz/spec + hs-source-dirs: tests main-is: Spec.hs build-depends: raaz @@ -261,7 +261,7 @@ test-suite spec library benchmark-internal import: defaults - hs-source-dirs: implementation/benchmarks/internal + hs-source-dirs: benchmarks/internal exposed-modules: Benchmark.Primitive , Benchmark.Types build-depends: criterion-measurement >= 0.1 @@ -271,7 +271,7 @@ library benchmark-internal benchmark primitives import: defaults - hs-source-dirs: implementation/benchmarks + hs-source-dirs: benchmarks main-is: Main.hs type: exitcode-stdio-1.0 build-depends: pretty diff --git a/raaz/spec/Common.hs b/tests/Common.hs similarity index 100% rename from raaz/spec/Common.hs rename to tests/Common.hs diff --git a/raaz/spec/Common/Cipher.hs b/tests/Common/Cipher.hs similarity index 100% rename from raaz/spec/Common/Cipher.hs rename to tests/Common/Cipher.hs diff --git a/raaz/spec/Common/Hash.hs b/tests/Common/Hash.hs similarity index 100% rename from raaz/spec/Common/Hash.hs rename to tests/Common/Hash.hs diff --git a/raaz/spec/Common/Imports.hs b/tests/Common/Imports.hs similarity index 100% rename from raaz/spec/Common/Imports.hs rename to tests/Common/Imports.hs diff --git a/raaz/spec/Common/Instances.hs b/tests/Common/Instances.hs similarity index 100% rename from raaz/spec/Common/Instances.hs rename to tests/Common/Instances.hs diff --git a/raaz/spec/Common/Utils.hs b/tests/Common/Utils.hs similarity index 100% rename from raaz/spec/Common/Utils.hs rename to tests/Common/Utils.hs diff --git a/raaz/spec/Raaz/Cipher/ChaCha20Spec.hs b/tests/Raaz/Cipher/ChaCha20Spec.hs similarity index 100% rename from raaz/spec/Raaz/Cipher/ChaCha20Spec.hs rename to tests/Raaz/Cipher/ChaCha20Spec.hs diff --git a/raaz/spec/Raaz/Core/ByteSourceSpec.hs b/tests/Raaz/Core/ByteSourceSpec.hs similarity index 100% rename from raaz/spec/Raaz/Core/ByteSourceSpec.hs rename to tests/Raaz/Core/ByteSourceSpec.hs diff --git a/raaz/spec/Raaz/Core/EncodeSpec.hs b/tests/Raaz/Core/EncodeSpec.hs similarity index 100% rename from raaz/spec/Raaz/Core/EncodeSpec.hs rename to tests/Raaz/Core/EncodeSpec.hs diff --git a/raaz/spec/Raaz/Core/MemorySpec.hs b/tests/Raaz/Core/MemorySpec.hs similarity index 100% rename from raaz/spec/Raaz/Core/MemorySpec.hs rename to tests/Raaz/Core/MemorySpec.hs diff --git a/raaz/spec/Raaz/Core/Types/WordSpec.hs b/tests/Raaz/Core/Types/WordSpec.hs similarity index 100% rename from raaz/spec/Raaz/Core/Types/WordSpec.hs rename to tests/Raaz/Core/Types/WordSpec.hs diff --git a/raaz/spec/Raaz/Core/Util/ByteStringSpec.hs b/tests/Raaz/Core/Util/ByteStringSpec.hs similarity index 100% rename from raaz/spec/Raaz/Core/Util/ByteStringSpec.hs rename to tests/Raaz/Core/Util/ByteStringSpec.hs diff --git a/raaz/spec/Raaz/Hash/Blake2Spec.hs b/tests/Raaz/Hash/Blake2Spec.hs similarity index 100% rename from raaz/spec/Raaz/Hash/Blake2Spec.hs rename to tests/Raaz/Hash/Blake2Spec.hs diff --git a/raaz/spec/Raaz/Hash/Sha256Spec.hs b/tests/Raaz/Hash/Sha256Spec.hs similarity index 100% rename from raaz/spec/Raaz/Hash/Sha256Spec.hs rename to tests/Raaz/Hash/Sha256Spec.hs diff --git a/raaz/spec/Raaz/Hash/Sha512Spec.hs b/tests/Raaz/Hash/Sha512Spec.hs similarity index 100% rename from raaz/spec/Raaz/Hash/Sha512Spec.hs rename to tests/Raaz/Hash/Sha512Spec.hs diff --git a/raaz/spec/Raaz/RandomSpec.hs b/tests/Raaz/RandomSpec.hs similarity index 100% rename from raaz/spec/Raaz/RandomSpec.hs rename to tests/Raaz/RandomSpec.hs diff --git a/raaz/spec/Spec.hs b/tests/Spec.hs similarity index 100% rename from raaz/spec/Spec.hs rename to tests/Spec.hs diff --git a/raaz/spec/entropyquality.sh b/tests/entropyquality.sh similarity index 100% rename from raaz/spec/entropyquality.sh rename to tests/entropyquality.sh diff --git a/raaz/spec/prgquality.sh b/tests/prgquality.sh similarity index 100% rename from raaz/spec/prgquality.sh rename to tests/prgquality.sh From 71a32a293542276485ebb18b1d58d06b397aaae1 Mon Sep 17 00:00:00 2001 From: Piyush P Kurur Date: Thu, 20 Sep 2018 16:20:18 +0530 Subject: [PATCH 6/8] expose the RandomT monad transformer. --- raaz/Raaz/Random.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raaz/Raaz/Random.hs b/raaz/Raaz/Random.hs index 45d2ca09e..984c3e402 100644 --- a/raaz/Raaz/Random.hs +++ b/raaz/Raaz/Random.hs @@ -5,7 +5,7 @@ module Raaz.Random ( -- * Cryptographically secure randomness. -- $randomness$ - RT, RandM + RandomT, RT, RandM , random, randomByteString -- ** Types that can be generated randomly , RandomStorable(..), unsafeFillRandomElements From b8228f59a8e6468ee3007f15a393ebcade5694b8 Mon Sep 17 00:00:00 2001 From: Piyush P Kurur Date: Thu, 20 Sep 2018 16:59:50 +0530 Subject: [PATCH 7/8] adjust the export lists of various component. --- raaz.cabal | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/raaz.cabal b/raaz.cabal index 7f08705e6..738c19951 100644 --- a/raaz.cabal +++ b/raaz.cabal @@ -97,25 +97,25 @@ library core import: defaults hs-source-dirs: core exposed-modules: Raaz.Core - , Raaz.Core.ByteSource , Raaz.Core.CpuSupports - , Raaz.Core.Encode - , Raaz.Core.Memory - , Raaz.Core.MonoidalAction - , Raaz.Core.Parse.Applicative - , Raaz.Core.Primitive + , Raaz.Core.Transfer , Raaz.Core.Types , Raaz.Core.Types.Internal - , Raaz.Core.Util - , Raaz.Core.Transfer , Raaz.Entropy - , Raaz.Primitive.HashMemory , Raaz.Primitive.Blake2.Internal , Raaz.Primitive.Sha256.Internal , Raaz.Primitive.Sha512.Internal , Raaz.Primitive.ChaCha20.Internal + , Raaz.Primitive.HashMemory - other-modules: Raaz.Core.Constants + other-modules: Raaz.Core.ByteSource + , Raaz.Core.Encode + , Raaz.Core.Memory + , Raaz.Core.MonoidalAction + , Raaz.Core.Parse.Applicative + , Raaz.Core.Primitive + , Raaz.Core.Util + , Raaz.Core.Constants , Raaz.Core.Encode.Internal , Raaz.Core.Encode.Base16 , Raaz.Core.Encode.Base64 @@ -126,6 +126,7 @@ library core , Raaz.Core.Types.Equality , Raaz.Core.Types.Endian , Raaz.Core.Types.Copying + c-sources: core/cbits/raaz/core/endian.c , core/cbits/raaz/core/memory.c , core/cbits/raaz/core/cpusupports.c @@ -182,14 +183,18 @@ library build-depends: core , core-indef , implementation + reexported-modules: Raaz.Core + , Raaz.Core.Types exposed-modules: Raaz , Raaz.Hash , Raaz.Cipher , Raaz.Random , Raaz.Random.Internal , Raaz.Random.ChaCha20PRG - , Paths_raaz + autogen-modules: Paths_raaz + other-modules: Paths_raaz + mixins: core-indef (Raaz.Primitive.Util as Raaz.Hash.Blake2b.Util) requires (Raaz.Primitive.Implementation as Raaz.Primitive.Blake2b.Implementation.CPortable) , core-indef (Raaz.Primitive.Util as Raaz.Hash.Blake2s.Util) From 7c91603a148dd704f7ededb7a99d64c626f99021 Mon Sep 17 00:00:00 2001 From: Piyush P Kurur Date: Thu, 20 Sep 2018 17:11:48 +0530 Subject: [PATCH 8/8] core-indef becomes indef. --- .../Raaz/Primitive/Implementation.hsig | 0 {core-indef => indef}/Raaz/Primitive/Util.hs | 0 raaz.cabal | 18 +++++++++--------- 3 files changed, 9 insertions(+), 9 deletions(-) rename {core-indef => indef}/Raaz/Primitive/Implementation.hsig (100%) rename {core-indef => indef}/Raaz/Primitive/Util.hs (100%) diff --git a/core-indef/Raaz/Primitive/Implementation.hsig b/indef/Raaz/Primitive/Implementation.hsig similarity index 100% rename from core-indef/Raaz/Primitive/Implementation.hsig rename to indef/Raaz/Primitive/Implementation.hsig diff --git a/core-indef/Raaz/Primitive/Util.hs b/indef/Raaz/Primitive/Util.hs similarity index 100% rename from core-indef/Raaz/Primitive/Util.hs rename to indef/Raaz/Primitive/Util.hs diff --git a/raaz.cabal b/raaz.cabal index 738c19951..7383d6a32 100644 --- a/raaz.cabal +++ b/raaz.cabal @@ -144,10 +144,10 @@ library core ---------------------- The signatures relevant for core --------------------------- -library core-indef +library indef import: defaults build-depends: core - hs-source-dirs: core-indef + hs-source-dirs: indef signatures: Raaz.Primitive.Implementation exposed-modules: Raaz.Primitive.Util @@ -181,7 +181,7 @@ library import: defaults hs-source-dirs: raaz build-depends: core - , core-indef + , indef , implementation reexported-modules: Raaz.Core , Raaz.Core.Types @@ -195,15 +195,15 @@ library autogen-modules: Paths_raaz other-modules: Paths_raaz - mixins: core-indef (Raaz.Primitive.Util as Raaz.Hash.Blake2b.Util) + mixins: indef (Raaz.Primitive.Util as Raaz.Hash.Blake2b.Util) requires (Raaz.Primitive.Implementation as Raaz.Primitive.Blake2b.Implementation.CPortable) - , core-indef (Raaz.Primitive.Util as Raaz.Hash.Blake2s.Util) + , indef (Raaz.Primitive.Util as Raaz.Hash.Blake2s.Util) requires (Raaz.Primitive.Implementation as Raaz.Primitive.Blake2s.Implementation.CPortable) - , core-indef (Raaz.Primitive.Util as Raaz.Hash.Sha256.Util) + , indef (Raaz.Primitive.Util as Raaz.Hash.Sha256.Util) requires (Raaz.Primitive.Implementation as Raaz.Primitive.Sha256.Implementation.CPortable) - , core-indef (Raaz.Primitive.Util as Raaz.Hash.Sha512.Util) + , indef (Raaz.Primitive.Util as Raaz.Hash.Sha512.Util) requires (Raaz.Primitive.Implementation as Raaz.Primitive.Sha512.Implementation.CPortable) - , core-indef (Raaz.Primitive.Util as Raaz.Cipher.ChaCha20.Util) + , indef (Raaz.Primitive.Util as Raaz.Cipher.ChaCha20.Util) requires (Raaz.Primitive.Implementation as Raaz.Primitive.ChaCha20.Implementation.CPortable) ---------------------------- Executables ------------------------------------------------- @@ -272,7 +272,7 @@ library benchmark-internal build-depends: criterion-measurement >= 0.1 , pretty , core - , core-indef + , indef benchmark primitives import: defaults