Skip to content

Hash functions

Karel Kubicek edited this page Apr 12, 2018 · 4 revisions

Generator hash server as a base class for SHA-3 candidates functions and other hash functions.

For more information on SHA-3 candidate hash functions and project background, see the official SHA-3 competition webpage. Hash functions used in CryptoStreams should be enough documented at hash functions list.

Project configuration

An exemplary configuration for SHA-3 stream in EACirc:

"stream" : {
    "type" : "hash",
    "algorithm" : "Keccak",
    "input_size" : 32,
    "source" : {
        "type" : "counter"
    },
    "round" : 3,
    "hash_size" : 32,
},
  • type : hash selects class of hash functions.
  • algorithm specifies the hash function to use; see table of hash functions.
  • input_size defines the length of the hash function's input. It is in bytes, as operation on bits is not available right now.
  • source contains JSON subtree with source of data Stream. Recommended are counter or strict avalanche criterion sac.
  • round limits the number of rounds for the selected algorithm.
  • hash_size is the length of the output hash in bytes for the algorithm (for supported lengths see table of hash functions).

Developer documentation

All SHA-3 candidate algorithms must support 224, 256, 384, and 512-bit message digests, and must support a maximum message length of at least 264 bits. Other hash functions have different sizes, for function-specific information, refer to hash functions list.

The project functionality is separated into several files:

  • hash_stream
    The main project file, implements stream interface. Contains method next() for outputing a test vector.
  • hash_factory
    This file contains links all the hash functions and contains factory that initializes the selected function for the computation.
  • hash_interface
    The interface provides unified access to all hash functions.
  • Directories sha3 and hash
    These folders contain hash_functions folders with sub-folders for concrete implementation.