FPGARelated.com
Forums

Bob Jenkins Hash on FPGA

Started by Bobby29999 6 years ago5 replieslatest reply 6 years ago549 views
Summary A developer is seeking advice on implementing the Bob Jenkins Hash algorithm on an FPGA, specifically regarding fundamental RTL design parameters and potential implementation challenges.The discussion highlights that while logic operations like bit-shifting are straightforward in hardware, memory limitations and high-level synthesis (HLS) tools are the primary considerations for a successful implementation.

A developer is seeking advice on implementing the Bob Jenkins Hash algorithm on an FPGA, specifically regarding fundamental RTL design parameters and potential implementation challenges.

The discussion highlights that while logic operations like bit-shifting are straightforward in hardware, memory limitations and high-level synthesis (HLS) tools are the primary considerations for a successful implementation.

  • FPGA memory resources act as the hash table while the logic functions map inputs to indices.
  • Mixing operations are highly efficient in hardware because bit-shifts are implemented as simple wire redirections.
  • Using High-Level Synthesis (HLS) tools allows for direct translation of existing C-code into RTL.
  • The Xilinx Vitis security library offers reference implementations for other cryptographic hashes like SHA that can serve as structural guides.
FPGAHLSHashing Algorithms

Hi,

I am working on an algorithm which uses the following Bob Jenkins Hash. Below are the reference of Bob Jenkins:
http://burtleburtle.net/bob/hash/evahash.html
(https://burtleburtle.net/bob/c/lookup2.c)

It hashes arbitrary size string and outputs an integer seed. I would like to implement the this Jenkins hash on FPGA. Please help me in following questions

My questions:

- What should be my fundamental RTL design parameters for this hash to be implemented on FPGA? I mean I am looking for most basic considerations that should be taken into account.   Looking for a starting point.
- What could be the challenges (if any)?

I would be really happy to have some helping answers.

[ - ]
Reply by kazApril 10, 2020

The data base terminology in your link directly maps to fpga, the terminology becomes:

keys = inputs to your design

hash function: logic for mapping those inputs to address of memory (index)

hash table : memory (or registers)

In fpgas memory is of limited size, you may also consider registers, are more expensive but allow simulataneous multiple indexing at same time.

So in short you can directly implement what you want on fpga but with limited memory size yet it can be fast and even access all array in one clock period if that is needed.

[ - ]
Reply by Bobby29999April 10, 2020

Ok thanks....And what about the mixing step involved in the code? How can mixing be implemented?

[ - ]
Reply by oliviertApril 10, 2020

Mixing is even easier in logic as shifting are just wire redirection.

If your target is a Xilinx SoC/MPSoC/Versal ACAP then give a try to Vitis and Vitis HLS. If it is a Xilinx FPGA give a chance to Vivado HLS (pretty soon replaced by Vitis HLS).

You can start by just giving the C-code to the tool, and then can think about optimization.

[ - ]
Reply by Bobby29999April 10, 2020

Thanks a lot ! Do Vivado HLS has some examples on Jenkins Hash?

[ - ]
Reply by oliviertApril 10, 2020

There is nothing specifically on Jenkins Hash, but you can still have a look to the open-source "security" Vitis library that contains sha??? IPs:

https://github.com/Xilinx/Vitis_Libraries/tree/mas...