hush-core
Core cryptographic primitives for the Clawdstrike attestation system.
Features
- Ed25519 -- Key generation, signing, and verification
- SHA-256 -- Standard cryptographic hashing
- Keccak-256 -- Ethereum-compatible hashing
- Merkle trees -- RFC 6962-compatible construction and inclusion proof verification
- Canonical JSON -- RFC 8785 deterministic serialization for hashing and signing
- Receipts -- Signed attestation types (
Receipt,SignedReceipt,Verdict,Provenance) - TPM support -- Sealed seed signing via platform TPM (non-WASM targets)
Quick Start
use ;
// Hash some data
let hash = sha256;
assert_eq!;
// Keccak-256 (Ethereum-compatible)
let eth_hash = keccak256;
assert_eq!;
// Sign and verify
let keypair = generate;
let message = b"important message";
let signature = keypair.sign;
assert!;
Merkle Trees
use MerkleTree;
let leaves = vec!;
let tree = from_leaves.unwrap;
// Generate and verify inclusion proof
let proof = tree.inclusion_proof.unwrap;
assert!;
Cargo Features
default-- Core crypto primitiveswasm-- WebAssembly target support (usesgetrandomJS backend)
License
Apache-2.0