Optimization for SPHINCS+ using Intel Secure Hash Algorithm Extensions

Thomas Hanson, Qian Wang, Santosh Ghosh, Fernando Virdia, Anne Reinders, Manoj R. SastryIACR ePrint 2022

Introduction

As the era of quantum computing approaches, traditional digital signature schemes such as RSA and ECDSA are becoming increasingly vulnerable. In response, the National Institute of Standards and Technology (NIST) is standardizing Post-Quantum Cryptography (PQC) to ensure long-term data security. SPHINCS+ is a leading stateless hash-based signature scheme favored for its robust security properties, which rely entirely on the strength of cryptographic hash functions. However, SPHINCS+ is computationally intensive—often performing up to 100 times slower than its lattice-based competitors. This research addresses this efficiency gap by optimizing the underlying SHA-256 hash function execution on modern Intel CPUs.

Methodology: A Hybrid Optimization Strategy

The study focuses on the SPHINCS+-128f-simple instantiation. The core innovation is a hybrid optimization strategy that intelligently combines two distinct sets of Intel CPU instructions:

  1. Intel SHA-NI (Secure Hash Algorithm Extensions): These specialized instructions accelerate single-buffer (serial) hashing, significantly reducing latency for sequential hash chains.
  2. AVX2 (Advanced Vector Extensions): These SIMD (Single Instruction, Multiple Data) instructions allow the CPU to process multiple hashes in parallel (multi-buffering).

Previous high-performance implementations focused heavily on AVX2 to speed up parallelizable components like Merkle tree construction. However, SPHINCS+ also contains numerous serial hashing operations, such as WOTS+ chaining, where AVX2 units remain idle. By integrating SHA-NI to handle these serial bottlenecks, the authors created a more balanced and efficient execution pipeline.

Analysis of Hashing Patterns

The effectiveness of this hybrid approach is rooted in the specific hashing patterns of the SPHINCS+ algorithm. The researchers analyzed the distribution of single-buffered (serial) versus multi-buffered (parallel) hash calls across different functions.

Distribution of single-buffered (x1) and multi-buffered (x8) hash operations across SPHINCS+ functions.

The data reveals that while signing is highly parallelizable (99.8% multi-buffered), verification is significantly more serial, with 25.5% of hash calls being single-buffered. This disparity explains why verification benefits disproportionately from SHA-NI acceleration, which is crucial for real-world scenarios where a single signature may be verified by thousands of devices.

Performance Results

The optimized library was benchmarked on an Intel Core i7-1185G7 (Tiger Lake) processor. Compared to a standard reference implementation without hardware acceleration, the hybrid approach achieved a massive speedup of over 70% across key generation, signing, and verification.

When compared against an existing state-of-the-art AVX2-optimized reference, the hybrid SHA-NI + AVX2 implementation demonstrated clear incremental gains, particularly in verification tasks.

Performance comparison of the hybrid SHA-NI + AVX2 implementation against an AVX2-only reference.

The results show an 8.7% speedup in signing and a substantial 23% speedup in verification. At the instruction level, SHA-NI reduced the cycle count for a single SHA-256 hash from 901 cycles (base) to just 270 cycles.

Conclusion and Future Work

By leveraging the synergy between SHA-NI and AVX2, this work significantly narrows the performance gap between hash-based and lattice-based signatures. While this study focused on the SHA-256 "128f" parameter set, future research will explore other variants like SHAKE and Haraka. Additionally, the authors plan to extend this work to utilize AVX-512 instructions, which could potentially double parallel processing power and further enhance the viability of SPHINCS+ for high-traffic applications.

Summary updated

BibTeX
@article{hanson2022optimization,
  author = {Thomas Hanson and Qian Wang and Santosh Ghosh and Fernando Virdia and Anne Reinders and Manoj R. Sastry},
  title = {{Optimization for SPHINCS+ using Intel Secure Hash Algorithm Extensions}},
  journal = {IACR Cryptol. ePrint Arch.},
  year = {2022},
}
Figure