cryptohash: collection of crypto hashes, fast, pure and practical

[ bsd3, cryptography, data, library ] [ Propose Tags ]

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.

The implementations are made in C with a haskell FFI wrapper that hide the C implementation.


[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
test

Build unit test

Disabled
benchmark

Build benchmark test

Disabled
cryptoapi

Defines crypto-api instances

Enabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.4, 0.4.1, 0.5, 0.5.1, 0.5.2, 0.5.3, 0.6, 0.6.1, 0.6.2, 0.6.3, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5, 0.7.6, 0.7.7, 0.7.8, 0.7.9, 0.7.10, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.9.0, 0.9.1, 0.10.0, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.11.4, 0.11.5, 0.11.6, 0.11.7, 0.11.8, 0.11.9
Dependencies base (>=4 && <6), bytestring, cereal (>=0.2), criterion, crypto-api (>=0.5), HUnit, tagged (>=0.1) [details]
License BSD-3-Clause
Copyright Vincent Hanquez <vincent@snarc.org>
Author Vincent Hanquez <vincent@snarc.org>
Maintainer Vincent Hanquez <vincent@snarc.org>
Category Data, Cryptography
Home page http://github.com/vincenthz/hs-cryptohash
Source repo head: git clone git://github.com/vincenthz/hs-cryptohash
Uploaded by VincentHanquez at 2012-04-22T16:38:10Z
Distributions Arch:0.11.9, Debian:0.11.9, Fedora:0.11.9, FreeBSD:0.11.6, LTSHaskell:0.11.9, NixOS:0.11.9, Stackage:0.11.9
Reverse Dependencies 157 direct, 3389 indirect [details]
Executables Bench, Tests
Downloads 186114 total (163 in the last 30 days)
Rating 1.25 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for cryptohash-0.7.5

[back to package description]

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