cryptonight-hash

Crates.iocryptonight-hash
lib.rscryptonight-hash
version0.1.2
sourcesrc
created_at2019-10-25 14:46:01.567835
updated_at2019-10-25 21:30:23.873684
descriptionA pure-rust implementation of the CryptoNight digest algorithm.
homepage
repositoryhttps://github.com/bertptrs/cryptonight-hash
max_upload_size
id175626
size29,803
Bert Peters (bertptrs)

documentation

https://docs.rs/cryptonight-hash

README

cryptonight-hash

Build Status Crates.io Documentation Crates.io

A pure-rust implementation of the CryptoNight digest algorithm. The implementation is based on the specification in CryptoNote standard 8.

The crate is compiled with support for AES CPU extensions if the platform supports it, currently only on x86 and x86_64. It is possible to disable this by disabling the default features.

Features

  • digest-compatible implementation of the CryptoNight digest.
  • No non-rust dependencies.
  • Support for SSE2 and AES CPU extensions.
  • Full fallback implementation for other platforms.
  • Performance comparable to competing implementations.

Compared to others

There are already different crates that also implement this digest algorithm, but there are some differences. In decreasing order of downloads (as of 2019-10-25):

  • cryptonight-rs simply wraps the function from the original Monero C code. It also claims to be unstable.
  • yellowsun implements the digest completely in Rust but does so in a way that requires using AES CPU extensions. If your platform doesn't have those, you can't use it.
  • cryptonight requires SSE (but not AES) extensions for the hash. It indirectly depends on some C-code to implement the secondary hashes.

Aside from the differences above, this crate is the only one that can easily compute hashes incrementally and that can operate with the traits in the digest crate.

Wish list

  • Support CPU extensions for key generation
  • nostd support
Commit count: 50

cargo fmt