Search code examples
clinuxencryptioncryptographylibsodium

Algorand's Verifiable Random Function (VRF) implementation


I have been trying for a while to compile the VRF implementation that algorand open-sourced more than a year ago (available here). There is little to no documentation, so I haven't able to do it. I have tried in both Mac OS and Linux without much luck. It seems like the installation scripts on their fork of libsodium just skip compiling the VRF files. With so much code, is difficult to get what is the error. Has anybody done this?


Solution

  • The 1.0.16 release doesn't seem to include the VRF files at all. One change mentions crypto_vrf.c, but that is not in the tarball.

    Cloning the repository includes crypto_vrf.c and the code was compiled.

    Use:

    git clone [email protected]:algorand/libsodium.git
    cd libsodium
    sh autogen.sh
    ./configure
    make
    

    This recipe appeared to work fine on a MacBook Pro running macOS 10.14.6 Mojave, both when using the Xcode clang compiler and when using my home-built GCC 9.3.0 (gcc). I would expect the same recipe to work on Linux too.

    The recipe given does assume you have sufficiently modern versions of the 'AutoTools' — autoconf, automake, libtool (and m4). They don't have to be all that modern. I have autoconf v2.69 (copyright date: 2012) and automake v1.15 (copyright date: 2015) — and used /usr/bin/m4 and the libtool included in the package. I compiled autoconf and automake so that they're installed in /opt/gnu/bin (though you could probably get pre-built sets using Brew or one of the other systems for obtaining open source packages for macOS).