Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Hyperscan MPM integration v6 #1965
This PR adds support for using Intel's Hyperscan regex engine as an MPM algo, namely "hs".
It has a couple of notable features over a straightforward implementation:
More info on Hyperscan: https://01.org/hyperscan
MpmAddPatternCI and MpmAddPatternCS had arguments for offset and depth, but these were not being passed in by the caller.
This adds an MPM implementation that uses the Hyperscan regex engine library from Intel, accessible as the "hs" mpm-algo.
By default, hashlittle() will read off the end of the key, up to the next four-byte boundary, although the data beyond the end of the key doesn't affect the hash. This read causes uninitialized read warnings from Valgrind and Address Sanitizer. Here we add hashlittle_safe(), which avoids reading off the end of the buffer (using the code inside the VALGRIND-guarded block in the original hashlittle() implementation).
Prscript still passes: