cryptohash 0.7.2 → 0.7.3
raw patch · 6 files changed
+85/−44 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- README +0/−22
- README.md +63/−0
- Tests.hs +18/−18
- cbits/skein256.c +1/−1
- cbits/skein512.c +1/−1
- cryptohash.cabal +2/−2
− README
@@ -1,22 +0,0 @@-hs-cryptohash provides lots of different secure digest algorithms.--All different cryptohashes contains the exact same API, for ease of-switching between different hashes; this API is separated two folds:-the incremental API and the one-pass API.--= Incremental API--The incremental API permits the user to compute the digest incrementally,-with the overhead of having to box and unbox the context in and out-the computing function.--this API is made of: init, update and finalize; this is similar-to how a digest algorithm works in other languages.--= One Pass API--The one pass API permits a single shot computation that doesn't have-the overhead of boxing and unboxing at each step.--this API is made of: hash and hashlazy. hash works on a strict bytestring,-whereas hashlazy works on a lazy bytestring.
+ README.md view
@@ -0,0 +1,63 @@+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.++The general performance are comparable to the most optimised hashes+available.++The complete list of supported hashes:++* MD2, MD4, MD5 +* RIPEMD160+* SHA1+* SHA-2 family: 224, 256, 384, 512 and the newer 512t+* Skein: 256, 512+* Tiger++You can easily import any hash with the following:++ 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.++Incremental API+---------------++it's based on 3 different functions, similar to the lowlevel operations+of a typical hash:++* init: create a new hash context+* update: update non-destructively a new hash context with a strict bytestring+* finalize: finalize the context and returns a digest bytestring.++all those operations are completely pure, and instead of changing the+context as usual in others language, it create a new context each time.++One Pass API+------------++The one pass API use the incremental API under the hood, but expose+common operations to create digests out of a bytestring and lazy bytestring.++* hash: create a digest (init+update+finalize) from a strict bytestring+* hashlazy: create a digest (init+update+finalize) from a lazy bytestring++Integration with crypto-api+---------------------------++cryptohash is fully integrated with crypto-api and you can use the+related function in crypto-api to use any cryptohash modules.++Performance+-----------++Cryptohash uses C implementations to provides maximum performance.+see the cbits directory for more information
Tests.hs view
@@ -100,29 +100,29 @@ "6d12a41e72e644f017b6f0e2f7b44c6285f06dd5d2c5b075", "a8f04b0f7201a0d728101c9d26525b31764a3493fcd8458f" ]) , ("Skein256-160", skein256Hash 160, [- "2ab89f14cfb3a5cb4655379386c42df7a45ccaf7",- "c86ef8411dc1deb008a3c175091691b74643631e",- "2775e79484bc087b58eb78d977c143a3029471be" ])+ "ff800bed6d2044ee9d604a674e3fda50d9b24a72",+ "3265703c166aa3e0d7da070b9cf1b1a5953f0a77",+ "17b29aa1424b3ec022505bd215ff73fd2e6d1e5a" ]) , ("Skein256-256", skein256Hash 256, [- "0b04103b828cddaebcf592ac845ecafd5887f61230a755406d38d85376e1ae08",- "a7e63c4dc73d0cb77184e319ebb6f69b73bfc8b945c1b371fafd01223a2ade1c",- "2174ca46353601a53826b430b52e76fca51bb0419f7a20ac7ffd53c4c448fa51" ])+ "c8877087da56e072870daa843f176e9453115929094c3a40c463a196c29bf7ba",+ "c0fbd7d779b20f0a4614a66697f9e41859eaf382f14bf857e8cdb210adb9b3fe",+ "fb2f2f2deed0e1dd7ee2b91cee34e2d1c22072e1f5eaee288c35a0723eb653cd" ]) , ("Skein512-160", skein512Hash 160, [- "b034bcc065b01b0c486159b3dba3e03aa52fdd70",- "9709e7d913bc3eee240e1f302840a0da9d9acc48",- "fb2cc0959e884d66927346552df8b51d2d98690c" ])+ "49daf1ccebb3544bc93cb5019ba91b0eea8876ee",+ "826325ee55a6dd18c3b2dbbc9c10420f5475975e",+ "7544ec7a35712ec953f02b0d0c86641cae4eb6e5" ]) , ("Skein512-384", skein512Hash 384, [- "2c3fe10673f4d6904f27585fc3df455a678bc12d7d39d6be4b37f47b80a43889181103bc727a7db4b4e2d2dec1ded86a",- "19d373842a6dd304454d6673cb3a8b7871f139477ac28900de739a31789f6e2846d3b641b2e8386f65061efe602d7cac",- "bbc4e1089364dd69b0847a06bff6ce19889fed18bf57c901402c74e22ba763bf0dacb9b1d24efc78d969170fd434dad7" ])+ "dd5aaf4589dc227bd1eb7bc68771f5baeaa3586ef6c7680167a023ec8ce26980f06c4082c488b4ac9ef313f8cbe70808",+ "f814c107f3465e7c54048a5503547deddc377264f05c706b0d19db4847b354855ee52ab6a785c238c9e710d848542041",+ "e06520eeadc1d0a44fee1d2492547499c1e58526387c8b9c53905e5edb79f9840575cbf844e21b1ad1ea126dd8a8ca6f" ]) , ("Skein512-512", skein512Hash 512, [- "5af68a4912e0a6187a004947a9d2a37d7a1f0873f0bdd9dc64838ece60da5535c2a55d039bd58e178948996b7a8336486ed969c894be658e47d595a5a9b86a8b",- "e38e8ec4814aa2ca485c8ace47c929691ec6acabf2d2795006306267210728d5576d6b7d361bbf99fb1e843d9027b340f828ad074315a5d4b71361de34c511c0",- "cd90f50e10e7fe59e263c3796b92795a78fcf561f0fea07b04faeb4e602edb4d6d9f927cc0b5f2b0671e7c7e5fc42ca8875222bcfd42936c542d8f2312fd3615" ])+ "bc5b4c50925519c290cc634277ae3d6257212395cba733bbad37a4af0fa06af41fca7903d06564fea7a2d3730dbdb80c1f85562dfcc070334ea4d1d9e72cba7a",+ "94c2ae036dba8783d0b3f7d6cc111ff810702f5c77707999be7e1c9486ff238a7044de734293147359b4ac7e1d09cd247c351d69826b78dcddd951f0ef912713",+ "7f81113575e4b4d3441940e87aca331e6d63d103fe5107f29cd877af0d0f5e0ea34164258c60da5190189d0872e63a96596d2ef25e709099842da71d64111e0f" ]) , ("Skein512-896", skein512Hash 896, [- "bcc274c53cfa75284f8dcf71e28d19bf52f0e218c241cc1c23e2da043bf61c383899c67fdcbb7511de1831a9113720125127876df2bd0cd57d99ef303baf209c00998bc7d3749f6845d9eaf32ac629de84ac3b494efa29a68cb93d65fd25a2dcef515484b78381eede4af762a1d2f188",- "7ad8b71b5bdcaff6f785c9b80b2b1f5fe56030f3ead98965d1ebd20ae75388c2e94097b32a01b7d11a32cef60ea9268170db51726cddf9ee62c3f33e3f84f8ec470053affb564952da6a9cb5e8a4baba8e72b9612ea95863c99b7e59a461288459990ef063fe0b066f8f24fb3794e708",- "14b22fe85d5b22f8aa921f32bab0e2cca9d88971dd6f7624506c6662faec9c7429be5bc54be37734c52f10cd866612d0e364023e1db888579b6d9462530807ade129d308adb09eb3308ad8c8731aedb1559f6cefd7d4d9761627f727a79a149788fb267439004d5f7a8dad69a6046d8b" ])+ "b95175236c83a459ce7ec6c12b761a838b22d750e765b3fdaa892201b2aa714bc3d1d887dd64028bbf177c1dd11baa09c6c4ddb598fd07d6a8c131a09fc5b958e2999a8006754b25abe3bf8492b7eabec70e52e04e5ac867df2393c573f16eee3244554f1d2b724f2c0437c62007f770",+ "3265708553e7d146e5c7bcbc97b3e9e9f5b53a5e4af53612bdd6454da4fa7b13d413184fe34ed57b6574be10e389d0ec4b1d2b1dd2c80e0257d5a76b2cd86a19a27b1bcb3cc24d911b5dc5ee74d19ad558fd85b5f024e99f56d1d3199f1f9f88ed85fab9f945f11cf9fc00e94e3ca4c7",+ "3d23d3db9be719bbd2119f8402a28f38d8225faa79d5b68b80738c64a82004aafc7a840cd6dd9bced6644fa894a3d8d7d2ee89525fd1956a2db052c4c2f8d2111c91ef46b0997540d42bcf384826af1a5ef6510077f52d0574cf2b46f1b6a5dad07ed40f3d21a13ca2d079fa602ff02d" ]) ] hexalise s =
cbits/skein256.c view
@@ -42,7 +42,7 @@ uint64_t ts[3]; uint64_t ks[4+1]; - ks[4] = 0x5555555555555555ULL;+ ks[4] = 0x1bd11bdaa9fc1a22ULL; ks[0] = ctx->h[0]; ks[4] ^= ctx->h[0]; ks[1] = ctx->h[1]; ks[4] ^= ctx->h[1]; ks[2] = ctx->h[2]; ks[4] ^= ctx->h[2];
cbits/skein512.c view
@@ -42,7 +42,7 @@ uint64_t ts[3]; uint64_t ks[8+1]; - ks[8] = 0x5555555555555555ULL;+ ks[8] = 0x1bd11bdaa9fc1a22ULL; ks[0] = ctx->h[0]; ks[8] ^= ctx->h[0]; ks[1] = ctx->h[1]; ks[8] ^= ctx->h[1]; ks[2] = ctx->h[2]; ks[8] ^= ctx->h[2];
cryptohash.cabal view
@@ -1,5 +1,5 @@ Name: cryptohash-Version: 0.7.2+Version: 0.7.3 Description: A collection of crypto hashes, with a practical incremental and one-pass, pure APIs, with performance close to the fastest implementations available in others languages.@@ -16,7 +16,7 @@ Build-Type: Simple Cabal-Version: >=1.6 Homepage: http://github.com/vincenthz/hs-cryptohash-data-files: README+data-files: README.md extra-source-files: cbits/bitfn.h cbits/md2.h cbits/md4.h cbits/md5.h