Sha256: 908eb86c8ec6cf813845be15e7362d72b59b8950f53b213c00436d20612f612a

Contents?: true

Size: 764 Bytes

Versions: 5

Compression:

Stored size: 764 Bytes

Contents

#include "api.h"
#include "utils.h"

int crypto_box(
  unsigned char *c,
  const unsigned char *m,unsigned long long mlen,
  const unsigned char *n,
  const unsigned char *pk,
  const unsigned char *sk
)
{
  unsigned char k[crypto_box_BEFORENMBYTES];
  int           ret;

  crypto_box_beforenm(k,pk,sk);
  ret = crypto_box_afternm(c,m,mlen,n,k);
  sodium_memzero(k, sizeof k);

  return ret;
}

int crypto_box_open(
  unsigned char *m,
  const unsigned char *c,unsigned long long clen,
  const unsigned char *n,
  const unsigned char *pk,
  const unsigned char *sk
)
{
  unsigned char k[crypto_box_BEFORENMBYTES];
  int           ret;

  crypto_box_beforenm(k,pk,sk);
  ret = crypto_box_open_afternm(m,c,clen,n,k);
  sodium_memzero(k, sizeof k);

  return ret;
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rbnacl-libsodium-1.0.6 vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/box_curve25519xsalsa20poly1305.c
rbnacl-libsodium-1.0.5 vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/box_curve25519xsalsa20poly1305.c
rbnacl-libsodium-1.0.4 vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/box_curve25519xsalsa20poly1305.c
rbnacl-libsodium-1.0.3 vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/box_curve25519xsalsa20poly1305.c
rbnacl-libsodium-1.0.2 vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/box_curve25519xsalsa20poly1305.c