3 #include "crypto_onetimeauth.h"
5 void crypto_onetimeauth_verify(const string
&a
,const string
&m
,const string
&k
)
7 if (k
.size() != crypto_onetimeauth_KEYBYTES
) throw "incorrect key length";
8 if (a
.size() != crypto_onetimeauth_BYTES
) throw "incorrect authenticator length";
9 if (crypto_onetimeauth_verify(
10 (const unsigned char *) a
.c_str(),
11 (const unsigned char *) m
.c_str(),m
.size(),
12 (const unsigned char *) k
.c_str()) == 0) return;
13 throw "invalid authenticator";