Sha256: 3334c35901c907ab54f89722637761681415b1dced9f1022125d923b12a078f7

Contents?: true

Size: 556 Bytes

Versions: 10

Compression:

Stored size: 556 Bytes

Contents

/*
version 20080913
D. J. Bernstein
Public domain.
*/

#include "api.h"
#include "crypto_core_hsalsa20.h"
#include "crypto_stream_salsa20.h"

static const unsigned char sigma[16] = {
    'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k'
};

int crypto_stream_xor(
        unsigned char *c,
  const unsigned char *m,unsigned long long mlen,
  const unsigned char *n,
  const unsigned char *k
)
{
  unsigned char subkey[32];
  crypto_core_hsalsa20(subkey,n,k,sigma);
  return crypto_stream_salsa20_xor(c,m,mlen,n + 16,subkey);
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rbnacl-libsodium-1.0.1 vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c
rbnacl-libsodium-1.0.0 vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c
rbnacl-libsodium-0.7.0 vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c
rbnacl-libsodium-0.6.1 vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c
rbnacl-libsodium-0.6.0 vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c
rbnacl-libsodium-0.5.0.1 vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c
rbnacl-libsodium-0.5.0.1.pre vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c
rbnacl-libsodium-0.5.0 vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c
rbnacl-libsodium-0.4.5 vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c
rbnacl-libsodium-0.4.5a vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c