Sha256: 33b7d7541ed54047b2d07aa04f207baedea48f3fee1333f9662b3c5fe00569f4

Contents?: true

Size: 530 Bytes

Versions: 3

Compression:

Stored size: 530 Bytes

Contents

#include <string>
using std::string;
#include "crypto_onetimeauth.h"

void crypto_onetimeauth_verify(const string &a,const string &m,const string &k)
{
  if (k.size() != crypto_onetimeauth_KEYBYTES) throw "incorrect key length";
  if (a.size() != crypto_onetimeauth_BYTES) throw "incorrect authenticator length";
  if (crypto_onetimeauth_verify(
       (const unsigned char *) a.c_str(),
       (const unsigned char *) m.c_str(),m.size(),
       (const unsigned char *) k.c_str()) == 0) return;
  throw "invalid authenticator";
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby_nacl-0.1.2 ext/ruby_nacl/NaCl/crypto_onetimeauth/wrapper-verify.cpp
ruby_nacl-0.1.1 ext/ruby_nacl/NaCl/crypto_onetimeauth/wrapper-verify.cpp
ruby_nacl-0.1.0 ext/ruby_nacl/NaCl/crypto_onetimeauth/wrapper-verify.cpp