Skip to main content

Module simd_vectorization

Module simd_vectorization 

Source
Expand description

SIMD Vectorization: Batch hash operations

Provides batch hash processing for parallel hash operations. Leverages existing SIMD in sha2 crate (asm feature) + Rayon for CPU-core parallelization.

Provides batch functions for:

  • SHA256 and double SHA256 (Bitcoin standard)
  • RIPEMD160 and HASH160 (OP_HASH160)

Uses chunked processing for better cache locality and parallelizes across CPU cores when batch size is large enough (≥8 items).

Reference: BLVM Optimization Pass 5 - SIMD Vectorization

Functions§

batch_double_sha256
Batch double SHA256: Compute SHA256(SHA256(x)) for multiple inputs
batch_double_sha256_aligned
Batch double SHA256 with cache-aligned output
batch_hash160
Batch HASH160: Compute RIPEMD160(SHA256(x)) for multiple inputs
batch_ripemd160
Batch RIPEMD160: Compute RIPEMD160 for multiple inputs
batch_sha256
Batch SHA256: Compute SHA256 for multiple independent inputs