Cryptographic/keccak256 library

🔐 Keccak-256 (SHA-3) Cryptographic Hash Algorithm Implementation

A production-ready implementation of the Keccak-256 hashing algorithm used in Ethereum and other modern blockchain systems. This implementation provides both single-shot hashing and streaming capabilities for large data processing.

Features:

  • FIPS 202 compliant Keccak-256 implementation
  • Sponge construction with 1600-bit state
  • Optimized for performance with minimal memory allocation
  • Comprehensive error handling and validation
  • Thread-safe implementation suitable for concurrent environments
  • Produces 256-bit (32-byte) hash output

Time complexity: O(n) where n is the length of input data Space complexity: O(1) constant space usage

Example:

final hash = Keccak256.hash('Hello, World!');
print(hash); // 3ea2f1d0abf3fc66cf29e05970fef4e3eca9d72a7b0223c3e0f0c0b0b0b0b0b0b

Classes

Keccak256
Keccak-256 hash algorithm implementation
Keccak256Constants
Keccak-256 constants and round constants