#include "cron.ih"

    // by cron1.cc erifypassphrase.cc 

// static
string Cron::hmac(string const &passphrase)
{
    string use{ passphrase };

    while (use.length() <= 32)        // hmac needs 32 byte strings
        use += passphrase;
    use.resize(32);

    HMacBuf hmacbuf(use, "aes-256-cbc", "sha256", 1024);

    ostream out(&hmacbuf);
    out << use << eoi;

    return hmacbuf.hash();
}

