Sha256: 6582ba23ece2d5994d970e78db1c3b0ee0759339847f87ba7500a73334cd5529

Contents?: true

Size: 827 Bytes

Versions: 1

Compression:

Stored size: 827 Bytes

Contents

#include "crypto_stream.h"
#include "randombytes.h"

size_t
crypto_stream_keybytes(void)
{
    return crypto_stream_KEYBYTES;
}

size_t
crypto_stream_noncebytes(void)
{
    return crypto_stream_NONCEBYTES;
}

const char *
crypto_stream_primitive(void)
{
    return crypto_stream_PRIMITIVE;
}

int
crypto_stream(unsigned char *c, unsigned long long clen,
              const unsigned char *n, const unsigned char *k)
{
    return crypto_stream_xsalsa20(c, clen, n, k);
}


int
crypto_stream_xor(unsigned char *c, const unsigned char *m,
                  unsigned long long mlen, const unsigned char *n,
                  const unsigned char *k)
{
    return crypto_stream_xsalsa20_xor(c, m, mlen, n, k);
}

void
crypto_stream_keygen(unsigned char k[crypto_stream_KEYBYTES])
{
    randombytes_buf(k, crypto_stream_KEYBYTES);
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rbnacl-libsodium-1.0.13 vendor/libsodium/src/libsodium/crypto_stream/crypto_stream.c