Skip to content

Tool for evolutionary design of new hash functions using grammatical evolution with specialization for hashing IPv6 addresses

License

Notifications You must be signed in to change notification settings

xfreib00/GEHash

Repository files navigation

GEHash

Author: Adam Freiberg

e-mail: [email protected]

Introduction

GEhash was developed as a part of my bachelor's thesis about Evolutionary Design of Hash Functions Using Grammatical Evolution.

Its main focus is on generating hash function for IPv6 used in network flow monitoring.


Build

Project uses CMake to generate build files.

For basic configuration run following commands:

cmake -S . -B build
cmake --build build

Run

There are two ways to run program.

First is to run program directly:

./build/src/GEHash ... [parameters]

Or use provided shell script:

./eval.sh ... [parameters]

Second option automaticaly handles multiple runs (to avoid statistical error) and output files.

To display all parameters and their usage, run following command:

./build/src/GEHash [-h|--help]

Output

Output files are in JSON format for easier processing. There are two main categories of status parameter. First is progress and second is result, which indicates stage of evoluion run.

Example of output data:

[
    ...,
    {
        "fitness": 24579.0,
        "gen": 4,
        "status": "progress"
    },
    {
        "fitness": 24579.0,
        "gen": 5,
        "phenotype": {
            "code": "hash = ~(hash+(~(key)^key<<3)+hash);"
        },
        "status": "result"
    }
]

CMake options

Documentation

  • ENABLE_DOCS - generate documentation wih Doxygen

Dynamic analyzers

  • ENABLE_SANITIZER_ADDRESS - use address sanitizer
  • ENABLE_SANITIZER_LEAK - use memory leak sanitizer
  • ENABLE_SANITIZER_UNDEFINED_BEHAVIOR - use undefined behaviour sanitizer

Staic analyzers

  • ENABLE_CLANG_TIDY - use Clang-tidy static analyzer tool

Dependecies

Gram library available at GitHub.

ChaiScript library available at GitHub.

Nlohmann JSON used lightweight version available at GitHub due to extensive size of original repository. Full version available here

Catch2 test library for C++ available at GitHub. Currently using v2.13.4.


Testing

Testing will be added in future releases.

Unit testing

Acceptance testing