Changes to update Tomato RAF.
[tomato.git] / release / src / router / dnscrypt / src / libnacl / crypto_onetimeauth / wrapper-auth.cpp
blobf4279607fdbbf2a82f368dfecdb2c2fae1cd93d8
1 #include <string>
2 using std::string;
3 #include "crypto_onetimeauth.h"
5 string crypto_onetimeauth(const string &m,const string &k)
7 if (k.size() != crypto_onetimeauth_KEYBYTES) throw "incorrect key length";
8 unsigned char a[crypto_onetimeauth_BYTES];
9 crypto_onetimeauth(a,(const unsigned char *) m.c_str(),m.size(),(const unsigned char *) k.c_str());
10 return string((char *) a,crypto_onetimeauth_BYTES);