packages feed

cryptohash 0.11.6 → 0.11.7

raw patch · 41 files changed

+165/−165 lines, 41 filesdep ~basePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base

API changes (from Hackage documentation)

- Crypto.Hash: hmacGetDigest :: HMAC a -> Digest a
- Crypto.Hash: instance Byteable (HMAC a)
- Crypto.Hash: instance Eq (HMAC a)
- Crypto.Hash: instance HashAlgorithm MD2
- Crypto.Hash: instance HashAlgorithm MD4
- Crypto.Hash: instance HashAlgorithm MD5
- Crypto.Hash: instance HashAlgorithm RIPEMD160
- Crypto.Hash: instance HashAlgorithm SHA1
- Crypto.Hash: instance HashAlgorithm SHA224
- Crypto.Hash: instance HashAlgorithm SHA256
- Crypto.Hash: instance HashAlgorithm SHA384
- Crypto.Hash: instance HashAlgorithm SHA3_224
- Crypto.Hash: instance HashAlgorithm SHA3_256
- Crypto.Hash: instance HashAlgorithm SHA3_384
- Crypto.Hash: instance HashAlgorithm SHA3_512
- Crypto.Hash: instance HashAlgorithm SHA512
- Crypto.Hash: instance HashAlgorithm Skein256_224
- Crypto.Hash: instance HashAlgorithm Skein256_256
- Crypto.Hash: instance HashAlgorithm Skein512_224
- Crypto.Hash: instance HashAlgorithm Skein512_256
- Crypto.Hash: instance HashAlgorithm Skein512_384
- Crypto.Hash: instance HashAlgorithm Skein512_512
- Crypto.Hash: instance HashAlgorithm Tiger
- Crypto.Hash: instance HashAlgorithm Whirlpool
- Crypto.Hash: instance Show MD2
- Crypto.Hash: instance Show MD4
- Crypto.Hash: instance Show MD5
- Crypto.Hash: instance Show RIPEMD160
- Crypto.Hash: instance Show SHA1
- Crypto.Hash: instance Show SHA224
- Crypto.Hash: instance Show SHA256
- Crypto.Hash: instance Show SHA384
- Crypto.Hash: instance Show SHA3_224
- Crypto.Hash: instance Show SHA3_256
- Crypto.Hash: instance Show SHA3_384
- Crypto.Hash: instance Show SHA3_512
- Crypto.Hash: instance Show SHA512
- Crypto.Hash: instance Show Skein256_224
- Crypto.Hash: instance Show Skein256_256
- Crypto.Hash: instance Show Skein512_224
- Crypto.Hash: instance Show Skein512_256
- Crypto.Hash: instance Show Skein512_384
- Crypto.Hash: instance Show Skein512_512
- Crypto.Hash: instance Show Tiger
- Crypto.Hash: instance Show Whirlpool
- Crypto.Hash.Types: instance Byteable (Context a)
- Crypto.Hash.Types: instance Byteable (Digest a)
- Crypto.Hash.Types: instance Eq (Digest a)
- Crypto.Hash.Types: instance Ord (Digest a)
- Crypto.Hash.Types: instance Show (Digest a)
- Crypto.MAC: hmacGetDigest :: HMAC a -> Digest a
- Crypto.MAC.SHA3: getDigest224 :: MAC224 -> Digest SHA3_224
- Crypto.MAC.SHA3: getDigest256 :: MAC256 -> Digest SHA3_256
- Crypto.MAC.SHA3: getDigest384 :: MAC384 -> Digest SHA3_384
- Crypto.MAC.SHA3: getDigest512 :: MAC512 -> Digest SHA3_512
- Crypto.MAC.SHA3: instance Byteable MAC224
- Crypto.MAC.SHA3: instance Byteable MAC256
- Crypto.MAC.SHA3: instance Byteable MAC384
- Crypto.MAC.SHA3: instance Byteable MAC512
- Crypto.MAC.SHA3: instance Eq MAC224
- Crypto.MAC.SHA3: instance Eq MAC256
- Crypto.MAC.SHA3: instance Eq MAC384
- Crypto.MAC.SHA3: instance Eq MAC512
+ Crypto.Hash: [hmacGetDigest] :: HMAC a -> Digest a
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.MD2
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.MD4
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.MD5
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.RIPEMD160
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.SHA1
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.SHA224
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.SHA256
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.SHA384
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.SHA3_224
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.SHA3_256
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.SHA3_384
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.SHA3_512
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.SHA512
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.Skein256_224
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.Skein256_256
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.Skein512_224
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.Skein512_256
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.Skein512_384
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.Skein512_512
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.Tiger
+ Crypto.Hash: instance Crypto.Hash.Types.HashAlgorithm Crypto.Hash.Whirlpool
+ Crypto.Hash: instance Data.Byteable.Byteable (Crypto.Hash.HMAC a)
+ Crypto.Hash: instance GHC.Classes.Eq (Crypto.Hash.HMAC a)
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.MD2
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.MD4
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.MD5
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.RIPEMD160
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.SHA1
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.SHA224
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.SHA256
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.SHA384
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.SHA3_224
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.SHA3_256
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.SHA3_384
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.SHA3_512
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.SHA512
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.Skein256_224
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.Skein256_256
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.Skein512_224
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.Skein512_256
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.Skein512_384
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.Skein512_512
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.Tiger
+ Crypto.Hash: instance GHC.Show.Show Crypto.Hash.Whirlpool
+ Crypto.Hash.Types: instance Data.Byteable.Byteable (Crypto.Hash.Types.Context a)
+ Crypto.Hash.Types: instance Data.Byteable.Byteable (Crypto.Hash.Types.Digest a)
+ Crypto.Hash.Types: instance GHC.Classes.Eq (Crypto.Hash.Types.Digest a)
+ Crypto.Hash.Types: instance GHC.Classes.Ord (Crypto.Hash.Types.Digest a)
+ Crypto.Hash.Types: instance GHC.Show.Show (Crypto.Hash.Types.Digest a)
+ Crypto.MAC: [hmacGetDigest] :: HMAC a -> Digest a
+ Crypto.MAC.SHA3: [getDigest224] :: MAC224 -> Digest SHA3_224
+ Crypto.MAC.SHA3: [getDigest256] :: MAC256 -> Digest SHA3_256
+ Crypto.MAC.SHA3: [getDigest384] :: MAC384 -> Digest SHA3_384
+ Crypto.MAC.SHA3: [getDigest512] :: MAC512 -> Digest SHA3_512
+ Crypto.MAC.SHA3: instance Data.Byteable.Byteable Crypto.MAC.SHA3.MAC224
+ Crypto.MAC.SHA3: instance Data.Byteable.Byteable Crypto.MAC.SHA3.MAC256
+ Crypto.MAC.SHA3: instance Data.Byteable.Byteable Crypto.MAC.SHA3.MAC384
+ Crypto.MAC.SHA3: instance Data.Byteable.Byteable Crypto.MAC.SHA3.MAC512
+ Crypto.MAC.SHA3: instance GHC.Classes.Eq Crypto.MAC.SHA3.MAC224
+ Crypto.MAC.SHA3: instance GHC.Classes.Eq Crypto.MAC.SHA3.MAC256
+ Crypto.MAC.SHA3: instance GHC.Classes.Eq Crypto.MAC.SHA3.MAC384
+ Crypto.MAC.SHA3: instance GHC.Classes.Eq Crypto.MAC.SHA3.MAC512

Files

Crypto/Hash/MD2.hs view
@@ -84,13 +84,13 @@ withCtxNewThrow :: (Ptr Ctx -> IO a) -> IO a withCtxNewThrow f = allocaBytes sizeCtx (f . castPtr) -foreign import ccall unsafe "md2.h md2_init"+foreign import ccall unsafe "md2.h cryptohash_md2_init"     c_md2_init :: Ptr Ctx -> IO () -foreign import ccall "md2.h md2_update"+foreign import ccall "md2.h cryptohash_md2_update"     c_md2_update :: Ptr Ctx -> Ptr Word8 -> Word32 -> IO () -foreign import ccall unsafe "md2.h md2_finalize"+foreign import ccall unsafe "md2.h cryptohash_md2_finalize"     c_md2_finalize :: Ptr Ctx -> Ptr Word8 -> IO ()  updateInternalIO :: Ptr Ctx -> ByteString -> IO ()
Crypto/Hash/MD4.hs view
@@ -84,13 +84,13 @@ withCtxNewThrow :: (Ptr Ctx -> IO a) -> IO a withCtxNewThrow f = allocaBytes sizeCtx (f . castPtr) -foreign import ccall unsafe "md4.h md4_init"+foreign import ccall unsafe "md4.h cryptohash_md4_init"     c_md4_init :: Ptr Ctx -> IO () -foreign import ccall "md4.h md4_update"+foreign import ccall "md4.h cryptohash_md4_update"     c_md4_update :: Ptr Ctx -> Ptr Word8 -> Word32 -> IO () -foreign import ccall unsafe "md4.h md4_finalize"+foreign import ccall unsafe "md4.h cryptohash_md4_finalize"     c_md4_finalize :: Ptr Ctx -> Ptr Word8 -> IO ()  updateInternalIO :: Ptr Ctx -> ByteString -> IO ()
Crypto/Hash/MD5.hs view
@@ -84,13 +84,13 @@ withCtxNewThrow :: (Ptr Ctx -> IO a) -> IO a withCtxNewThrow f = allocaBytes sizeCtx (f . castPtr) -foreign import ccall unsafe "md5.h md5_init"+foreign import ccall unsafe "md5.h cryptohash_md5_init"     c_md5_init :: Ptr Ctx -> IO () -foreign import ccall "md5.h md5_update"+foreign import ccall "md5.h cryptohash_md5_update"     c_md5_update :: Ptr Ctx -> Ptr Word8 -> Word32 -> IO () -foreign import ccall unsafe "md5.h md5_finalize"+foreign import ccall unsafe "md5.h cryptohash_md5_finalize"     c_md5_finalize :: Ptr Ctx -> Ptr Word8 -> IO ()  updateInternalIO :: Ptr Ctx -> ByteString -> IO ()
Crypto/Hash/RIPEMD160.hs view
@@ -84,13 +84,13 @@ withCtxNewThrow :: (Ptr Ctx -> IO a) -> IO a withCtxNewThrow f = allocaBytes sizeCtx (f . castPtr) -foreign import ccall unsafe "ripemd.h ripemd160_init"+foreign import ccall unsafe "ripemd.h cryptohash_ripemd160_init"     c_ripemd160_init :: Ptr Ctx -> IO () -foreign import ccall "ripemd.h ripemd160_update"+foreign import ccall "ripemd.h cryptohash_ripemd160_update"     c_ripemd160_update :: Ptr Ctx -> Ptr Word8 -> Word32 -> IO () -foreign import ccall unsafe "ripemd.h ripemd160_finalize"+foreign import ccall unsafe "ripemd.h cryptohash_ripemd160_finalize"     c_ripemd160_finalize :: Ptr Ctx -> Ptr Word8 -> IO ()  updateInternalIO :: Ptr Ctx -> ByteString -> IO ()
Crypto/Hash/SHA1.hs view
@@ -84,13 +84,13 @@ withCtxNewThrow :: (Ptr Ctx -> IO a) -> IO a withCtxNewThrow f = allocaBytes sizeCtx (f . castPtr) -foreign import ccall unsafe "sha1.h sha1_init"+foreign import ccall unsafe "sha1.h cryptohash_sha1_init"     c_sha1_init :: Ptr Ctx -> IO () -foreign import ccall "sha1.h sha1_update"+foreign import ccall "sha1.h cryptohash_sha1_update"     c_sha1_update :: Ptr Ctx -> Ptr Word8 -> Word32 -> IO () -foreign import ccall unsafe "sha1.h sha1_finalize"+foreign import ccall unsafe "sha1.h cryptohash_sha1_finalize"     c_sha1_finalize :: Ptr Ctx -> Ptr Word8 -> IO ()  updateInternalIO :: Ptr Ctx -> ByteString -> IO ()
Crypto/Hash/SHA224.hs view
@@ -84,13 +84,13 @@ withCtxNewThrow :: (Ptr Ctx -> IO a) -> IO a withCtxNewThrow f = allocaBytes sizeCtx (f . castPtr) -foreign import ccall unsafe "sha256.h sha224_init"+foreign import ccall unsafe "sha256.h cryptohash_sha224_init"     c_sha224_init :: Ptr Ctx -> IO () -foreign import ccall "sha256.h sha224_update"+foreign import ccall "sha256.h cryptohash_sha224_update"     c_sha224_update :: Ptr Ctx -> Ptr Word8 -> Word32 -> IO () -foreign import ccall unsafe "sha256.h sha224_finalize"+foreign import ccall unsafe "sha256.h cryptohash_sha224_finalize"     c_sha224_finalize :: Ptr Ctx -> Ptr Word8 -> IO ()  updateInternalIO :: Ptr Ctx -> ByteString -> IO ()
Crypto/Hash/SHA256.hs view
@@ -84,13 +84,13 @@ withCtxNewThrow :: (Ptr Ctx -> IO a) -> IO a withCtxNewThrow f = allocaBytes sizeCtx (f . castPtr) -foreign import ccall unsafe "sha256.h sha256_init"+foreign import ccall unsafe "sha256.h cryptohash_sha256_init"     c_sha256_init :: Ptr Ctx -> IO () -foreign import ccall "sha256.h sha256_update"+foreign import ccall "sha256.h cryptohash_sha256_update"     c_sha256_update :: Ptr Ctx -> Ptr Word8 -> Word32 -> IO () -foreign import ccall unsafe "sha256.h sha256_finalize"+foreign import ccall unsafe "sha256.h cryptohash_sha256_finalize"     c_sha256_finalize :: Ptr Ctx -> Ptr Word8 -> IO ()  updateInternalIO :: Ptr Ctx -> ByteString -> IO ()
Crypto/Hash/SHA3.hs view
@@ -84,13 +84,13 @@ withCtxNewThrow :: (Ptr Ctx -> IO a) -> IO a withCtxNewThrow f = allocaBytes sizeCtx (f . castPtr) -foreign import ccall unsafe "sha3.h sha3_init"+foreign import ccall unsafe "sha3.h cryptohash_sha3_init"     c_sha3_init :: Ptr Ctx -> Word32 -> IO () -foreign import ccall "sha3.h sha3_update"+foreign import ccall "sha3.h cryptohash_sha3_update"     c_sha3_update :: Ptr Ctx -> Ptr Word8 -> Word32 -> IO () -foreign import ccall unsafe "sha3.h sha3_finalize"+foreign import ccall unsafe "sha3.h cryptohash_sha3_finalize"     c_sha3_finalize :: Ptr Ctx -> Ptr Word8 -> IO ()  updateInternalIO :: Ptr Ctx -> ByteString -> IO ()
Crypto/Hash/SHA384.hs view
@@ -84,13 +84,13 @@ withCtxNewThrow :: (Ptr Ctx -> IO a) -> IO a withCtxNewThrow f = allocaBytes sizeCtx (f . castPtr) -foreign import ccall unsafe "sha512.h sha384_init"+foreign import ccall unsafe "sha512.h cryptohash_sha384_init"     c_sha384_init :: Ptr Ctx -> IO () -foreign import ccall "sha512.h sha384_update"+foreign import ccall "sha512.h cryptohash_sha384_update"     c_sha384_update :: Ptr Ctx -> Ptr Word8 -> Word32 -> IO () -foreign import ccall unsafe "sha512.h sha384_finalize"+foreign import ccall unsafe "sha512.h cryptohash_sha384_finalize"     c_sha384_finalize :: Ptr Ctx -> Ptr Word8 -> IO ()  updateInternalIO :: Ptr Ctx -> ByteString -> IO ()
Crypto/Hash/SHA512.hs view
@@ -85,16 +85,16 @@ withCtxNewThrow :: (Ptr Ctx -> IO a) -> IO a withCtxNewThrow f = allocaBytes sizeCtx (f . castPtr) -foreign import ccall unsafe "sha512.h sha512_init"+foreign import ccall unsafe "sha512.h cryptohash_sha512_init"     c_sha512_init :: Ptr Ctx -> IO () -foreign import ccall "sha512.h sha512_update"+foreign import ccall "sha512.h cryptohash_sha512_update"     c_sha512_update :: Ptr Ctx -> Ptr Word8 -> Word32 -> IO () -foreign import ccall unsafe "sha512.h sha512_finalize"+foreign import ccall unsafe "sha512.h cryptohash_sha512_finalize"     c_sha512_finalize :: Ptr Ctx -> Ptr Word8 -> IO () -foreign import ccall unsafe "sha512.h sha512_init_t"+foreign import ccall unsafe "sha512.h cryptohash_sha512_init_t"     c_sha512_init_t :: Ptr Ctx -> Int -> IO ()  {-# NOINLINE init_t #-}
Crypto/Hash/Skein256.hs view
@@ -84,13 +84,13 @@ withCtxNewThrow :: (Ptr Ctx -> IO a) -> IO a withCtxNewThrow f = allocaBytes sizeCtx (f . castPtr) -foreign import ccall unsafe "skein256.h skein256_init"+foreign import ccall unsafe "skein256.h cryptohash_skein256_init"     c_skein256_init :: Ptr Ctx -> Word32 -> IO () -foreign import ccall "skein256.h skein256_update"+foreign import ccall "skein256.h cryptohash_skein256_update"     c_skein256_update :: Ptr Ctx -> Ptr Word8 -> Word32 -> IO () -foreign import ccall unsafe "skein256.h skein256_finalize"+foreign import ccall unsafe "skein256.h cryptohash_skein256_finalize"     c_skein256_finalize :: Ptr Ctx -> Ptr Word8 -> IO ()  updateInternalIO :: Ptr Ctx -> ByteString -> IO ()
Crypto/Hash/Skein512.hs view
@@ -84,13 +84,13 @@ withCtxNewThrow :: (Ptr Ctx -> IO a) -> IO a withCtxNewThrow f = allocaBytes sizeCtx (f . castPtr) -foreign import ccall unsafe "skein512.h skein512_init"+foreign import ccall unsafe "skein512.h cryptohash_skein512_init"     c_skein512_init :: Ptr Ctx -> Word32 -> IO () -foreign import ccall "skein512.h skein512_update"+foreign import ccall "skein512.h cryptohash_skein512_update"     c_skein512_update :: Ptr Ctx -> Ptr Word8 -> Word32 -> IO () -foreign import ccall unsafe "skein512.h skein512_finalize"+foreign import ccall unsafe "skein512.h cryptohash_skein512_finalize"     c_skein512_finalize :: Ptr Ctx -> Ptr Word8 -> IO ()  updateInternalIO :: Ptr Ctx -> ByteString -> IO ()
Crypto/Hash/Tiger.hs view
@@ -84,13 +84,13 @@ withCtxNewThrow :: (Ptr Ctx -> IO a) -> IO a withCtxNewThrow f = allocaBytes sizeCtx (f . castPtr) -foreign import ccall unsafe "tiger.h tiger_init"+foreign import ccall unsafe "tiger.h cryptohash_tiger_init"     c_tiger_init :: Ptr Ctx -> IO () -foreign import ccall "tiger.h tiger_update"+foreign import ccall "tiger.h cryptohash_tiger_update"     c_tiger_update :: Ptr Ctx -> Ptr Word8 -> Word32 -> IO () -foreign import ccall unsafe "tiger.h tiger_finalize"+foreign import ccall unsafe "tiger.h cryptohash_tiger_finalize"     c_tiger_finalize :: Ptr Ctx -> Ptr Word8 -> IO ()  updateInternalIO :: Ptr Ctx -> ByteString -> IO ()
Crypto/Hash/Whirlpool.hs view
@@ -84,13 +84,13 @@ withCtxNewThrow :: (Ptr Ctx -> IO a) -> IO a withCtxNewThrow f = allocaBytes sizeCtx (f . castPtr) -foreign import ccall unsafe "whirlpool.h whirlpool_init"+foreign import ccall unsafe "whirlpool.h cryptohash_whirlpool_init"     c_whirlpool_init :: Ptr Ctx -> IO () -foreign import ccall "whirlpool.h whirlpool_update"+foreign import ccall "whirlpool.h cryptohash_whirlpool_update"     c_whirlpool_update :: Ptr Ctx -> Ptr Word8 -> Word32 -> IO () -foreign import ccall unsafe "whirlpool.h whirlpool_finalize"+foreign import ccall unsafe "whirlpool.h cryptohash_whirlpool_finalize"     c_whirlpool_finalize :: Ptr Ctx -> Ptr Word8 -> IO ()  updateInternalIO :: Ptr Ctx -> ByteString -> IO ()
README.md view
@@ -1,15 +1,15 @@ CryptoHash ========== -hs-cryptohash provides lots of different secure digest algorithms, also-called cryptohashes. It exposes every common hashes, but also some-more exotic hashes, provides an extensive list of hashes available-with a consistant API.+`hs-cryptohash` provides many different secure digest algorithms, also+called cryptographic hash functions or, simply, cryptohashes. The package+exports common hash functions, as well as some more exotic ones, and+provides a single API for them all. -The general performance are comparable to the most optimised hashes+The general performance is comparable to the most optimised implementations available. -The complete list of supported hashes:+Here is the complete list of supported algorithms:  * MD2, MD4, MD5  * RIPEMD160@@ -24,11 +24,9 @@      import qualified Crypto.Hash.<HASH> as <Hash> -suggestion: it's easier to import qualified since there's-a collision with the init symbol, but for only importing-the hash or hashlazy function there's no such need.--Every hashes, exposes a very similar API.+We recommend using `import qualified` because the APIs are similar and+many of the modules reuse the same names. However, if you are ony using+one module, there is no need to qualify the names.  Incremental API ---------------
cbits/bitfn.h view
@@ -175,6 +175,8 @@ #elif defined( __QNXNTO__ ) && defined( __BIGENDIAN__ )   # define BIG_ENDIAN 1234   # define BYTE_ORDER    BIG_ENDIAN+#elif defined( _AIX )+  # include <sys/machine.h> #else   # include <endian.h> #endif
cbits/md2.c view
@@ -27,7 +27,7 @@ #include "bitfn.h" #include "md2.h" -void md2_init(struct md2_ctx *ctx)+void cryptohash_md2_init(struct md2_ctx *ctx) { 	memset(ctx, 0, sizeof(*ctx)); 	ctx->sz = 0ULL;@@ -96,7 +96,7 @@ 		t = ctx->cksum[i] ^= S_table[buf[i] ^ t]; } -void md2_update(struct md2_ctx *ctx, uint8_t *data, uint32_t len)+void cryptohash_md2_update(struct md2_ctx *ctx, uint8_t *data, uint32_t len) { 	uint32_t index, to_fill; @@ -122,14 +122,14 @@ 		memcpy(ctx->buf + index, data, len); } -void md2_finalize(struct md2_ctx *ctx, uint8_t *out)+void cryptohash_md2_finalize(struct md2_ctx *ctx, uint8_t *out) { 	uint32_t index, padlen;  	index = ctx->sz & 0xf; 	padlen = 16 - index; -	md2_update(ctx, padding_table[padlen], padlen);-	md2_update(ctx, ctx->cksum, 16);+	cryptohash_md2_update(ctx, padding_table[padlen], padlen);+	cryptohash_md2_update(ctx, ctx->cksum, 16); 	memcpy(out, ctx->h, 16); }
cbits/md2.h view
@@ -37,8 +37,8 @@ #define MD2_DIGEST_SIZE		16 #define MD2_CTX_SIZE		sizeof(struct md2_ctx) -void md2_init(struct md2_ctx *ctx);-void md2_update(struct md2_ctx *ctx, uint8_t *data, uint32_t len);-void md2_finalize(struct md2_ctx *ctx, uint8_t *out);+void cryptohash_md2_init(struct md2_ctx *ctx);+void cryptohash_md2_update(struct md2_ctx *ctx, uint8_t *data, uint32_t len);+void cryptohash_md2_finalize(struct md2_ctx *ctx, uint8_t *out);  #endif
cbits/md4.c view
@@ -27,7 +27,7 @@ #include "bitfn.h" #include "md4.h" -void md4_init(struct md4_ctx *ctx)+void cryptohash_md4_init(struct md4_ctx *ctx) { 	memset(ctx, 0, sizeof(*ctx)); @@ -113,7 +113,7 @@ 	ctx->h[0] += a; ctx->h[1] += b; ctx->h[2] += c; ctx->h[3] += d; } -void md4_update(struct md4_ctx *ctx, uint8_t *data, uint32_t len)+void cryptohash_md4_update(struct md4_ctx *ctx, uint8_t *data, uint32_t len) { 	uint32_t index, to_fill; @@ -139,7 +139,7 @@ 		memcpy(ctx->buf + index, data, len); } -void md4_finalize(struct md4_ctx *ctx, uint8_t *out)+void cryptohash_md4_finalize(struct md4_ctx *ctx, uint8_t *out) { 	static uint8_t padding[64] = { 0x80, }; 	uint64_t bits;@@ -151,10 +151,10 @@ 	/* pad out to 56 */ 	index = (uint32_t) (ctx->sz & 0x3f); 	padlen = (index < 56) ? (56 - index) : ((64 + 56) - index);-	md4_update(ctx, padding, padlen);+	cryptohash_md4_update(ctx, padding, padlen);  	/* append length */-	md4_update(ctx, (uint8_t *) &bits, sizeof(bits));+	cryptohash_md4_update(ctx, (uint8_t *) &bits, sizeof(bits));  	/* output hash */ 	le32_to_cpu_array((uint32_t *) out, ctx->h, 4);
cbits/md4.h view
@@ -36,8 +36,8 @@ #define MD4_DIGEST_SIZE		16 #define MD4_CTX_SIZE		sizeof(struct md4_ctx) -void md4_init(struct md4_ctx *ctx);-void md4_update(struct md4_ctx *ctx, uint8_t *data, uint32_t len);-void md4_finalize(struct md4_ctx *ctx, uint8_t *out);+void cryptohash_md4_init(struct md4_ctx *ctx);+void cryptohash_md4_update(struct md4_ctx *ctx, uint8_t *data, uint32_t len);+void cryptohash_md4_finalize(struct md4_ctx *ctx, uint8_t *out);  #endif
cbits/md5.c view
@@ -27,7 +27,7 @@ #include "bitfn.h" #include "md5.h" -void md5_init(struct md5_ctx *ctx)+void cryptohash_md5_init(struct md5_ctx *ctx) { 	memset(ctx, 0, sizeof(*ctx)); @@ -126,7 +126,7 @@ 	ctx->h[0] += a; ctx->h[1] += b; ctx->h[2] += c; ctx->h[3] += d; } -void md5_update(struct md5_ctx *ctx, uint8_t *data, uint32_t len)+void cryptohash_md5_update(struct md5_ctx *ctx, uint8_t *data, uint32_t len) { 	uint32_t index, to_fill; @@ -152,7 +152,7 @@ 		memcpy(ctx->buf + index, data, len); } -void md5_finalize(struct md5_ctx *ctx, uint8_t *out)+void cryptohash_md5_finalize(struct md5_ctx *ctx, uint8_t *out) { 	static uint8_t padding[64] = { 0x80, }; 	uint64_t bits;@@ -165,10 +165,10 @@ 	/* pad out to 56 */ 	index = (uint32_t) (ctx->sz & 0x3f); 	padlen = (index < 56) ? (56 - index) : ((64 + 56) - index);-	md5_update(ctx, padding, padlen);+	cryptohash_md5_update(ctx, padding, padlen);  	/* append length */-	md5_update(ctx, (uint8_t *) &bits, sizeof(bits));+	cryptohash_md5_update(ctx, (uint8_t *) &bits, sizeof(bits));  	/* output hash */ 	p[0] = cpu_to_le32(ctx->h[0]);
cbits/md5.h view
@@ -36,8 +36,8 @@ #define MD5_DIGEST_SIZE		16 #define MD5_CTX_SIZE		sizeof(struct md5_ctx) -void md5_init(struct md5_ctx *ctx);-void md5_update(struct md5_ctx *ctx, uint8_t *data, uint32_t len);-void md5_finalize(struct md5_ctx *ctx, uint8_t *out);+void cryptohash_md5_init(struct md5_ctx *ctx);+void cryptohash_md5_update(struct md5_ctx *ctx, uint8_t *data, uint32_t len);+void cryptohash_md5_finalize(struct md5_ctx *ctx, uint8_t *out);  #endif
cbits/ripemd.c view
@@ -26,7 +26,7 @@ #include "bitfn.h" #include <string.h> -void ripemd160_init(struct ripemd160_ctx *ctx)+void cryptohash_ripemd160_init(struct ripemd160_ctx *ctx) { 	memset(ctx, 0, sizeof(*ctx)); @@ -249,7 +249,7 @@ 	ctx->h[0] = d2; } -void ripemd160_update(struct ripemd160_ctx *ctx, uint8_t *data, uint32_t len)+void cryptohash_ripemd160_update(struct ripemd160_ctx *ctx, uint8_t *data, uint32_t len) { 	uint32_t index, to_fill; @@ -272,7 +272,7 @@ 		memcpy(ctx->buf + index, data, len); } -void ripemd160_finalize(struct ripemd160_ctx *ctx, uint8_t *out)+void cryptohash_ripemd160_finalize(struct ripemd160_ctx *ctx, uint8_t *out) { 	static uint8_t padding[64] = { 0x80, }; 	uint64_t bits;@@ -285,10 +285,10 @@ 	/* pad out to 56 */ 	index = (uint32_t) (ctx->sz & 0x3f); 	padlen = (index < 56) ? (56 - index) : ((64 + 56) - index);-	ripemd160_update(ctx, padding, padlen);+	cryptohash_ripemd160_update(ctx, padding, padlen);  	/* append length */-	ripemd160_update(ctx, (uint8_t *) &bits, sizeof(bits));+	cryptohash_ripemd160_update(ctx, (uint8_t *) &bits, sizeof(bits));  	/* output digest */ 	p[0] = cpu_to_le32(ctx->h[0]);
cbits/ripemd.h view
@@ -36,8 +36,8 @@ #define RIPEMD160_DIGEST_SIZE	20 #define RIPEMD160_CTX_SIZE	sizeof(struct ripemd160_ctx) -void ripemd160_init(struct ripemd160_ctx *ctx);-void ripemd160_update(struct ripemd160_ctx *ctx, uint8_t *data, uint32_t len);-void ripemd160_finalize(struct ripemd160_ctx *ctx, uint8_t *out);+void cryptohash_ripemd160_init(struct ripemd160_ctx *ctx);+void cryptohash_ripemd160_update(struct ripemd160_ctx *ctx, uint8_t *data, uint32_t len);+void cryptohash_ripemd160_finalize(struct ripemd160_ctx *ctx, uint8_t *out);  #endif
cbits/sha1.c view
@@ -26,7 +26,7 @@ #include "sha1.h" #include "bitfn.h" -void sha1_init(struct sha1_ctx *ctx)+void cryptohash_sha1_init(struct sha1_ctx *ctx) { 	memset(ctx, 0, sizeof(*ctx)); @@ -155,7 +155,7 @@ 	ctx->h[4] += e; } -void sha1_update(struct sha1_ctx *ctx, uint8_t *data, uint32_t len)+void cryptohash_sha1_update(struct sha1_ctx *ctx, uint8_t *data, uint32_t len) { 	uint32_t index, to_fill; @@ -182,7 +182,7 @@ 		memcpy(ctx->buf + index, data, len); } -void sha1_finalize(struct sha1_ctx *ctx, uint8_t *out)+void cryptohash_sha1_finalize(struct sha1_ctx *ctx, uint8_t *out) { 	static uint8_t padding[64] = { 0x80, }; 	uint64_t bits;@@ -195,10 +195,10 @@ 	/* pad out to 56 */ 	index = (uint32_t) (ctx->sz & 0x3f); 	padlen = (index < 56) ? (56 - index) : ((64 + 56) - index);-	sha1_update(ctx, padding, padlen);+	cryptohash_sha1_update(ctx, padding, padlen);  	/* append length */-	sha1_update(ctx, (uint8_t *) &bits, sizeof(bits));+	cryptohash_sha1_update(ctx, (uint8_t *) &bits, sizeof(bits));  	/* output hash */ 	p[0] = cpu_to_be32(ctx->h[0]);
cbits/sha1.h view
@@ -36,8 +36,8 @@ #define SHA1_DIGEST_SIZE	20 #define SHA1_CTX_SIZE 		(sizeof(struct sha1_ctx)) -void sha1_init(struct sha1_ctx *ctx);-void sha1_update(struct sha1_ctx *ctx, uint8_t *data, uint32_t len);-void sha1_finalize(struct sha1_ctx *ctx, uint8_t *out);+void cryptohash_sha1_init(struct sha1_ctx *ctx);+void cryptohash_sha1_update(struct sha1_ctx *ctx, uint8_t *data, uint32_t len);+void cryptohash_sha1_finalize(struct sha1_ctx *ctx, uint8_t *out);  #endif
cbits/sha256.c view
@@ -26,7 +26,7 @@ #include "sha256.h" #include "bitfn.h" -void sha224_init(struct sha224_ctx *ctx)+void cryptohash_sha224_init(struct sha224_ctx *ctx) { 	memset(ctx, 0, sizeof(*ctx)); @@ -40,7 +40,7 @@ 	ctx->h[7] = 0xbefa4fa4; } -void sha256_init(struct sha256_ctx *ctx)+void cryptohash_sha256_init(struct sha256_ctx *ctx) { 	memset(ctx, 0, sizeof(*ctx)); @@ -110,12 +110,12 @@ 	ctx->h[4] += e; ctx->h[5] += f; ctx->h[6] += g; ctx->h[7] += h; } -void sha224_update(struct sha224_ctx *ctx, uint8_t *data, uint32_t len)+void cryptohash_sha224_update(struct sha224_ctx *ctx, uint8_t *data, uint32_t len) {-	return sha256_update(ctx, data, len);+	return cryptohash_sha256_update(ctx, data, len); } -void sha256_update(struct sha256_ctx *ctx, uint8_t *data, uint32_t len)+void cryptohash_sha256_update(struct sha256_ctx *ctx, uint8_t *data, uint32_t len) { 	uint32_t index, to_fill; @@ -143,15 +143,15 @@ 		memcpy(ctx->buf + index, data, len); } -void sha224_finalize(struct sha224_ctx *ctx, uint8_t *out)+void cryptohash_sha224_finalize(struct sha224_ctx *ctx, uint8_t *out) { 	uint8_t intermediate[SHA256_DIGEST_SIZE]; -	sha256_finalize(ctx, intermediate);+	cryptohash_sha256_finalize(ctx, intermediate); 	memcpy(out, intermediate, SHA224_DIGEST_SIZE); } -void sha256_finalize(struct sha256_ctx *ctx, uint8_t *out)+void cryptohash_sha256_finalize(struct sha256_ctx *ctx, uint8_t *out) { 	static uint8_t padding[64] = { 0x80, }; 	uint64_t bits;@@ -164,10 +164,10 @@ 	/* pad out to 56 */ 	index = (uint32_t) (ctx->sz & 0x3f); 	padlen = (index < 56) ? (56 - index) : ((64 + 56) - index);-	sha256_update(ctx, padding, padlen);+	cryptohash_sha256_update(ctx, padding, padlen);  	/* append length */-	sha256_update(ctx, (uint8_t *) &bits, sizeof(bits));+	cryptohash_sha256_update(ctx, (uint8_t *) &bits, sizeof(bits));  	/* store to digest */ 	for (i = 0; i < 8; i++)
cbits/sha256.h view
@@ -42,12 +42,12 @@ #define SHA256_DIGEST_SIZE	32 #define SHA256_CTX_SIZE		sizeof(struct sha256_ctx) -void sha224_init(struct sha224_ctx *ctx);-void sha224_update(struct sha224_ctx *ctx, uint8_t *data, uint32_t len);-void sha224_finalize(struct sha224_ctx *ctx, uint8_t *out);+void cryptohash_sha224_init(struct sha224_ctx *ctx);+void cryptohash_sha224_update(struct sha224_ctx *ctx, uint8_t *data, uint32_t len);+void cryptohash_sha224_finalize(struct sha224_ctx *ctx, uint8_t *out); -void sha256_init(struct sha256_ctx *ctx);-void sha256_update(struct sha256_ctx *ctx, uint8_t *data, uint32_t len);-void sha256_finalize(struct sha256_ctx *ctx, uint8_t *out);+void cryptohash_sha256_init(struct sha256_ctx *ctx);+void cryptohash_sha256_update(struct sha256_ctx *ctx, uint8_t *data, uint32_t len);+void cryptohash_sha256_finalize(struct sha256_ctx *ctx, uint8_t *out);  #endif
cbits/sha3.c view
@@ -97,14 +97,14 @@ 	} } -void sha3_init(struct sha3_ctx *ctx, uint32_t hashlen)+void cryptohash_sha3_init(struct sha3_ctx *ctx, uint32_t hashlen) { 	memset(ctx, 0, sizeof(*ctx)); 	ctx->hashlen = hashlen / 8; 	ctx->bufsz = 200 - 2 * ctx->hashlen; } -void sha3_update(struct sha3_ctx *ctx, uint8_t *data, uint32_t len)+void cryptohash_sha3_update(struct sha3_ctx *ctx, uint8_t *data, uint32_t len) { 	uint32_t to_fill; @@ -135,7 +135,7 @@ 	} } -void sha3_finalize(struct sha3_ctx *ctx, uint8_t *out)+void cryptohash_sha3_finalize(struct sha3_ctx *ctx, uint8_t *out) { 	uint64_t w[25]; 
cbits/sha3.h view
@@ -38,8 +38,8 @@  #define SHA3_CTX_SIZE		sizeof(struct sha3_ctx) -void sha3_init(struct sha3_ctx *ctx, uint32_t hashlen);-void sha3_update(struct sha3_ctx *ctx, uint8_t *data, uint32_t len);-void sha3_finalize(struct sha3_ctx *ctx, uint8_t *out);+void cryptohash_sha3_init(struct sha3_ctx *ctx, uint32_t hashlen);+void cryptohash_sha3_update(struct sha3_ctx *ctx, uint8_t *data, uint32_t len);+void cryptohash_sha3_finalize(struct sha3_ctx *ctx, uint8_t *out);  #endif
cbits/sha512.c view
@@ -26,7 +26,7 @@ #include "bitfn.h" #include "sha512.h" -void sha384_init(struct sha512_ctx *ctx)+void cryptohash_sha384_init(struct sha512_ctx *ctx) { 	memset(ctx, 0, sizeof(*ctx)); @@ -40,7 +40,7 @@ 	ctx->h[7] = 0x47b5481dbefa4fa4ULL; } -void sha512_init(struct sha512_ctx *ctx)+void cryptohash_sha512_init(struct sha512_ctx *ctx) { 	memset(ctx, 0, sizeof(*ctx)); @@ -127,12 +127,12 @@ 	ctx->h[4] += e; ctx->h[5] += f; ctx->h[6] += g; ctx->h[7] += h; } -void sha384_update(struct sha384_ctx *ctx, uint8_t *data, uint32_t len)+void cryptohash_sha384_update(struct sha384_ctx *ctx, uint8_t *data, uint32_t len) {-	return sha512_update(ctx, data, len);+	return cryptohash_sha512_update(ctx, data, len); } -void sha512_update(struct sha512_ctx *ctx, uint8_t *data, uint32_t len)+void cryptohash_sha512_update(struct sha512_ctx *ctx, uint8_t *data, uint32_t len) { 	unsigned int index, to_fill; @@ -162,15 +162,15 @@ 		memcpy(ctx->buf + index, data, len); } -void sha384_finalize(struct sha384_ctx *ctx, uint8_t *out)+void cryptohash_sha384_finalize(struct sha384_ctx *ctx, uint8_t *out) { 	uint8_t intermediate[SHA512_DIGEST_SIZE]; -	sha512_finalize(ctx, intermediate);+	cryptohash_sha512_finalize(ctx, intermediate); 	memcpy(out, intermediate, SHA384_DIGEST_SIZE); } -void sha512_finalize(struct sha512_ctx *ctx, uint8_t *out)+void cryptohash_sha512_finalize(struct sha512_ctx *ctx, uint8_t *out) { 	static uint8_t padding[128] = { 0x80, }; 	uint32_t i, index, padlen;@@ -184,10 +184,10 @@ 	/* pad out to 56 */ 	index = (unsigned int) (ctx->sz[0] & 0x7f); 	padlen = (index < 112) ? (112 - index) : ((128 + 112) - index);-	sha512_update(ctx, padding, padlen);+	cryptohash_sha512_update(ctx, padding, padlen);  	/* append length */-	sha512_update(ctx, (uint8_t *) bits, sizeof(bits));+	cryptohash_sha512_update(ctx, (uint8_t *) bits, sizeof(bits));  	/* store to digest */ 	for (i = 0; i < 8; i++)@@ -196,7 +196,7 @@  #include <stdio.h> -void sha512_init_t(struct sha512_ctx *ctx, int t)+void cryptohash_sha512_init_t(struct sha512_ctx *ctx, int t) { 	memset(ctx, 0, sizeof(*ctx)); 	if (t >= 512)@@ -228,13 +228,13 @@ 		uint8_t out[64]; 		int i; -		sha512_init(ctx);+		cryptohash_sha512_init(ctx); 		for (i = 0; i < 8; i++) 			ctx->h[i] ^= 0xa5a5a5a5a5a5a5a5ULL;  		i = sprintf(buf, "SHA-512/%d", t);-		sha512_update(ctx, buf, i);-		sha512_finalize(ctx, out);+		cryptohash_sha512_update(ctx, buf, i);+		cryptohash_sha512_finalize(ctx, out);  		/* re-init the context, otherwise len is changed */ 		memset(ctx, 0, sizeof(*ctx));
cbits/sha512.h view
@@ -35,20 +35,20 @@  #define sha384_ctx sha512_ctx -#define SHA384_DIGEST_SIZE	64+#define SHA384_DIGEST_SIZE	48 #define SHA384_CTX_SIZE		sizeof(struct sha384_ctx)  #define SHA512_DIGEST_SIZE	64 #define SHA512_CTX_SIZE		sizeof(struct sha512_ctx) -void sha384_init(struct sha384_ctx *ctx);-void sha384_update(struct sha384_ctx *ctx, uint8_t *data, uint32_t len);-void sha384_finalize(struct sha384_ctx *ctx, uint8_t *out);+void cryptohash_sha384_init(struct sha384_ctx *ctx);+void cryptohash_sha384_update(struct sha384_ctx *ctx, uint8_t *data, uint32_t len);+void cryptohash_sha384_finalize(struct sha384_ctx *ctx, uint8_t *out); -void sha512_init(struct sha512_ctx *ctx);-void sha512_update(struct sha512_ctx *ctx, uint8_t *data, uint32_t len);-void sha512_finalize(struct sha512_ctx *ctx, uint8_t *out);+void cryptohash_sha512_init(struct sha512_ctx *ctx);+void cryptohash_sha512_update(struct sha512_ctx *ctx, uint8_t *data, uint32_t len);+void cryptohash_sha512_finalize(struct sha512_ctx *ctx, uint8_t *out); -void sha512_init_t(struct sha512_ctx *ctx, int t);+void cryptohash_sha512_init_t(struct sha512_ctx *ctx, int t);  #endif
cbits/skein256.c view
@@ -103,7 +103,7 @@         ctx->h[3] = x[3] ^ cpu_to_le64(buf[3]); } -void skein256_init(struct skein256_ctx *ctx, uint32_t hashlen)+void cryptohash_skein256_init(struct skein256_ctx *ctx, uint32_t hashlen) { 	uint64_t buf[4]; 	memset(ctx, 0, sizeof(*ctx));@@ -120,7 +120,7 @@ 	SET_TYPE(ctx, FLAG_FIRST | FLAG_TYPE(TYPE_MSG)); } -void skein256_update(struct skein256_ctx *ctx, uint8_t *data, uint32_t len)+void cryptohash_skein256_update(struct skein256_ctx *ctx, uint8_t *data, uint32_t len) { 	uint32_t to_fill; @@ -155,7 +155,7 @@ 	} } -void skein256_finalize(struct skein256_ctx *ctx, uint8_t *out)+void cryptohash_skein256_finalize(struct skein256_ctx *ctx, uint8_t *out) { 	uint32_t outsize; 	uint64_t *p = (uint64_t *) out;
cbits/skein256.h view
@@ -38,8 +38,8 @@  #define SKEIN256_CTX_SIZE		sizeof(struct skein256_ctx) -void skein256_init(struct skein256_ctx *ctx, uint32_t hashlen);-void skein256_update(struct skein256_ctx *ctx, uint8_t *data, uint32_t len);-void skein256_finalize(struct skein256_ctx *ctx, uint8_t *out);+void cryptohash_skein256_init(struct skein256_ctx *ctx, uint32_t hashlen);+void cryptohash_skein256_update(struct skein256_ctx *ctx, uint8_t *data, uint32_t len);+void cryptohash_skein256_finalize(struct skein256_ctx *ctx, uint8_t *out);  #endif
cbits/skein512.c view
@@ -121,7 +121,7 @@         ctx->h[7] = x[7] ^ cpu_to_le64(buf[7]); } -void skein512_init(struct skein512_ctx *ctx, uint32_t hashlen)+void cryptohash_skein512_init(struct skein512_ctx *ctx, uint32_t hashlen) { 	uint64_t buf[8]; 	memset(ctx, 0, sizeof(*ctx));@@ -138,7 +138,7 @@ 	SET_TYPE(ctx, FLAG_FIRST | FLAG_TYPE(TYPE_MSG)); } -void skein512_update(struct skein512_ctx *ctx, uint8_t *data, uint32_t len)+void cryptohash_skein512_update(struct skein512_ctx *ctx, uint8_t *data, uint32_t len) { 	uint32_t to_fill; @@ -173,7 +173,7 @@ 	} } -void skein512_finalize(struct skein512_ctx *ctx, uint8_t *out)+void cryptohash_skein512_finalize(struct skein512_ctx *ctx, uint8_t *out) { 	uint32_t outsize; 	uint64_t *p = (uint64_t *) out;
cbits/skein512.h view
@@ -38,8 +38,8 @@  #define SKEIN512_CTX_SIZE		sizeof(struct skein512_ctx) -void skein512_init(struct skein512_ctx *ctx, uint32_t hashlen);-void skein512_update(struct skein512_ctx *ctx, uint8_t *data, uint32_t len);-void skein512_finalize(struct skein512_ctx *ctx, uint8_t *out);+void cryptohash_skein512_init(struct skein512_ctx *ctx, uint32_t hashlen);+void cryptohash_skein512_update(struct skein512_ctx *ctx, uint8_t *data, uint32_t len);+void cryptohash_skein512_finalize(struct skein512_ctx *ctx, uint8_t *out);  #endif
cbits/tiger.c view
@@ -296,7 +296,7 @@ 	0xcd56d9430ea8280eULL,0xc12591d7535f5065ULL, 0xc83223f1720aef96ULL,0xc3a0396f7363a51fULL, };  -void tiger_init(struct tiger_ctx *ctx)+void cryptohash_tiger_init(struct tiger_ctx *ctx) { 	memset(ctx, 0, sizeof(*ctx)); @@ -363,7 +363,7 @@ 	ctx->h[2] += c; } -void tiger_update(struct tiger_ctx *ctx, uint8_t *data, uint32_t len)+void cryptohash_tiger_update(struct tiger_ctx *ctx, uint8_t *data, uint32_t len) { 	uint32_t index, to_fill; @@ -390,7 +390,7 @@ 		memcpy(ctx->buf + index, data, len); } -void tiger_finalize(struct tiger_ctx *ctx, uint8_t *out)+void cryptohash_tiger_finalize(struct tiger_ctx *ctx, uint8_t *out) { 	static uint8_t padding[64] = { 0x01, }; 	uint64_t bits;@@ -403,10 +403,10 @@ 	/* pad out to 56 */ 	index = (uint32_t) (ctx->sz & 0x3f); 	padlen = (index < 56) ? (56 - index) : ((64 + 56) - index);-	tiger_update(ctx, padding, padlen);+	cryptohash_tiger_update(ctx, padding, padlen);  	/* append length */-	tiger_update(ctx, (uint8_t *) &bits, sizeof(bits));+	cryptohash_tiger_update(ctx, (uint8_t *) &bits, sizeof(bits));  	/* output hash */ 	p[0] = cpu_to_le64(ctx->h[0]);
cbits/tiger.h view
@@ -36,8 +36,8 @@ #define TIGER_DIGEST_SIZE	24 #define TIGER_CTX_SIZE 		(sizeof(struct tiger_ctx)) -void tiger_init(struct tiger_ctx *ctx);-void tiger_update(struct tiger_ctx *ctx, uint8_t *data, uint32_t len);-void tiger_finalize(struct tiger_ctx *ctx, uint8_t *out);+void cryptohash_tiger_init(struct tiger_ctx *ctx);+void cryptohash_tiger_update(struct tiger_ctx *ctx, uint8_t *data, uint32_t len);+void cryptohash_tiger_finalize(struct tiger_ctx *ctx, uint8_t *out);  #endif
cbits/whirlpool.c view
@@ -828,7 +828,7 @@ /**  * Initialize the hashing state.  */-void whirlpool_init(struct whirlpool_ctx * const ctx)+void cryptohash_whirlpool_init(struct whirlpool_ctx * const ctx) { 	int i; @@ -848,7 +848,7 @@  *  * This method maintains the invariant: bufferBits < DIGESTBITS  */-void whirlpool_update(struct whirlpool_ctx * const ctx, const uint8_t * const source, uint32_t sourceBytes)+void cryptohash_whirlpool_update(struct whirlpool_ctx * const ctx, const uint8_t * const source, uint32_t sourceBytes) { 	/* 	   sourcePos@@ -966,7 +966,7 @@  *   * This method uses the invariant: bufferBits < DIGESTBITS  */-void whirlpool_finalize(struct whirlpool_ctx * const ctx, uint8_t * const result)+void cryptohash_whirlpool_finalize(struct whirlpool_ctx * const ctx, uint8_t * const result) { 	int i; 	uint8_t *buffer    = ctx->buffer;
cbits/whirlpool.h view
@@ -24,8 +24,8 @@ 	uint64_t hash[DIGESTBYTES/8];    /* the hashing state */
 } whirlpool_ctx;
 
-void whirlpool_init(struct whirlpool_ctx * const ctx);
-void whirlpool_update(struct whirlpool_ctx * const ctx, const uint8_t * const source, uint32_t len);
-void whirlpool_finalize(struct whirlpool_ctx * const ctx, uint8_t * const result);
+void cryptohash_whirlpool_init(struct whirlpool_ctx * const ctx);
+void cryptohash_whirlpool_update(struct whirlpool_ctx * const ctx, const uint8_t * const source, uint32_t len);
+void cryptohash_whirlpool_finalize(struct whirlpool_ctx * const ctx, uint8_t * const result);
 
 #endif
cryptohash.cabal view
@@ -1,5 +1,5 @@ Name:                cryptohash-Version:             0.11.6+Version:             0.11.7 Description:     A collection of crypto hashes, with a practical incremental and one-pass, pure APIs,     with performance close to the fastest implementations available in other languages.