Sha256: ca7d94989db5a4809eec029a74e19e83f6f66f2ff388e11b13a287f43d17c453

Contents?: true

Size: 495 Bytes

Versions: 3

Compression:

Stored size: 495 Bytes

Contents

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

void crypto_auth_verify(const string &a,const string &m,const string &k)
{
  if (k.size() != crypto_auth_KEYBYTES) throw "incorrect key length";
  if (a.size() != crypto_auth_BYTES) throw "incorrect authenticator length";
  if (crypto_auth_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_auth/wrapper-verify.cpp
ruby_nacl-0.1.1 ext/ruby_nacl/NaCl/crypto_auth/wrapper-verify.cpp
ruby_nacl-0.1.0 ext/ruby_nacl/NaCl/crypto_auth/wrapper-verify.cpp