hasherkawpow-sys 0.1.0

Low-level Rust bindings for KawPow hashing and verification.
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented3 out of 3 items with examples
  • Size
  • Source code size: 189.77 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 278.08 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • vpalmerio/hasherkawpow-sys
    2 1 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • vpalmerio

hasherkawpow-sys

Low-level Rust bindings for KawPow hashing and verification.

This crate provides two functions:

  • hash_kawpow — compute a KawPow hash from a header hash, nonce, and block height.
  • verify_kawpow — verify a previously computed KawPow hash.

These functions wrap FFI calls to native implementations via unsafe code,
but expose a safe Rust API with fixed-size arrays.


Upstream Source

The underlying C source code is from
MintPond's hasher-kawpow library,
which itself adapts most of its native code from the
Ravencoin project.


Example

use hasherkawpow_sys::{hash_kawpow, verify_kawpow};

let header_hash = [0u8; 32];
let nonce: u64 = 42;
let block_height = 100;

// Compute a hash
let (mix, hash) = hash_kawpow(&header_hash, &nonce, block_height);

// Verify the hash
assert!(verify_kawpow(&header_hash, &nonce, block_height, &mix, &hash));

Testing

Run tests with cargo test -- --test-threads=1. cargo test will occasionally fail at src/ethash/progpow.cpp:190