Module simd

Module simd 

Source
Expand description

SIMD-accelerated cryptographic operations

This module provides SIMD (Single Instruction Multiple Data) optimized implementations of common cryptographic operations for improved performance on modern CPUs.

§Features

  • Parallel XOR: SIMD-accelerated XOR operations for stream ciphers and key mixing
  • Constant-time equality: SIMD-accelerated constant-time comparisons
  • Memory operations: Fast memory copying and zeroization
  • Parallel hashing: Multi-threaded hash computation for large data

§Platform Support

This module automatically detects CPU features and uses the best available SIMD instructions (AVX2, SSE2, NEON) or falls back to scalar operations.

Enums§

SimdError
SIMD operation errors

Functions§

batch_constant_time_eq
Batch constant-time comparison
constant_time_eq
SIMD-accelerated constant-time equality check
constant_time_eq_v2
SIMD-accelerated constant-time equality check (alternative using subtract_borrow trick)
parallel_hash
Parallel hash computation for large data
parallel_hash_with_threads
Parallel hash computation with custom thread count
secure_copy
SIMD-optimized memory copy for cryptographic data
secure_zero
Secure memory zeroization using volatile writes
xor_buffers
SIMD-accelerated XOR operation for buffers
xor_keystream
Parallel XOR with key stream for encryption/decryption

Type Aliases§

SimdResult
Result type for SIMD operations