hasherkawpow-sys

Crates.iohasherkawpow-sys
lib.rshasherkawpow-sys
version0.1.0
created_at2025-09-04 03:15:33.748017+00
updated_at2025-09-04 03:15:33.748017+00
descriptionLow-level Rust bindings for KawPow hashing and verification.
homepagehttps://github.com/vpalmerio/hasherkawpow-sys
repositoryhttps://github.com/vpalmerio/hasherkawpow-sys
max_upload_size
id1823571
size189,777
Vincent Palmerio (vpalmerio)

documentation

README

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

Commit count: 12

cargo fmt