This is a quick and simple implementation of the Goldreich-Goldwasser-Micali construction of pseudorandom functions [GGM'84].
The GGM construction requires a length-doubling pseudorandom generator (PRG). Such PRGs can be constructed from one-way functions (OWF). This implementation uses the Blake3 hash function as an OWF.
This implementation depends on this bit array library, and the Blake3 hash function implementation. Both are bundled. You don't anything besides the standard C build tools.
To build, just run:
make
Then, run ./prf
and enter the decimal value of input to get output of PRF.
Enter a non-numeric input to exit.