Skip to main content

Module sha_ni

Module sha_ni 

Source
Expand description

Intel SHA Extensions (SHA-NI) optimized SHA256

This module provides hardware-accelerated SHA256 using Intel SHA Extensions. Optimized for single-hash and small-batch operations.

§Performance

  • Expected: 10-15x faster than sha2 crate for single hashes
  • Uses dedicated SHA256 hardware instructions
  • Low latency, optimized for single-hash speed

§CPU Support

  • Intel: Ice Lake (2019+), all newer generations
  • AMD: All Ryzen (Zen microarchitecture, 2017+)

§Reference

Based on Intel’s SHA-NI reference implementation and the reference sha256_shani.cpp

Functions§

hash256
Double SHA256 (SHA256D) using SHA-NI
is_sha_ni_available
Check if SHA-NI is available at runtime
sha256
Public API: Single SHA256 with automatic dispatch