mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-07-26 02:31:48 +02:00
.github
bin
cmake
module
vendor
CPR
CivetWeb
ConcurrentQueue
DPP
buildtools
cmake
docpages
include
library
library-vcpkg
src
testdata
vcpkg
win32
32
bin
include
openssl
opus
sodium
core.h
crypto_aead_aes256gcm.h
crypto_aead_chacha20poly1305.h
crypto_aead_xchacha20poly1305.h
crypto_auth.h
crypto_auth_hmacsha256.h
crypto_auth_hmacsha512.h
crypto_auth_hmacsha512256.h
crypto_box.h
crypto_box_curve25519xchacha20poly1305.h
crypto_box_curve25519xsalsa20poly1305.h
crypto_core_ed25519.h
crypto_core_hchacha20.h
crypto_core_hsalsa20.h
crypto_core_ristretto255.h
crypto_core_salsa20.h
crypto_core_salsa2012.h
crypto_core_salsa208.h
crypto_generichash.h
crypto_generichash_blake2b.h
crypto_hash.h
crypto_hash_sha256.h
crypto_hash_sha512.h
crypto_kdf.h
crypto_kdf_blake2b.h
crypto_kx.h
crypto_onetimeauth.h
crypto_onetimeauth_poly1305.h
crypto_pwhash.h
crypto_pwhash_argon2i.h
crypto_pwhash_argon2id.h
crypto_pwhash_scryptsalsa208sha256.h
crypto_scalarmult.h
crypto_scalarmult_curve25519.h
crypto_scalarmult_ed25519.h
crypto_scalarmult_ristretto255.h
crypto_secretbox.h
crypto_secretbox_xchacha20poly1305.h
crypto_secretbox_xsalsa20poly1305.h
crypto_secretstream_xchacha20poly1305.h
crypto_shorthash.h
crypto_shorthash_siphash24.h
crypto_sign.h
crypto_sign_ed25519.h
crypto_sign_edwards25519sha512batch.h
crypto_stream.h
crypto_stream_chacha20.h
crypto_stream_salsa20.h
crypto_stream_salsa2012.h
crypto_stream_salsa208.h
crypto_stream_xchacha20.h
crypto_stream_xsalsa20.h
crypto_verify_16.h
crypto_verify_32.h
crypto_verify_64.h
export.h
randombytes.h
randombytes_internal_random.h
randombytes_sysrandom.h
runtime.h
utils.h
version.h
sodium.h
zconf.h
zlib.h
lib
CMakeLists.txt
CMakeSettings.json
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Dockerfile
Doxyfile
LICENSE
README.md
SECURITY.md
dpp.pc.in
makerelease.sh
settings.json
Fmt
Inja
JSON
MDBC
MaxmindDB
POCO
PUGIXML
RPMalloc
SAJSON
SimpleIni
Squirrel
TinyDir
UTF8
ZMQ
xxHash
CMakeLists.txt
.gitignore
.gitmodules
CMakeLists.txt
LICENSE
README.md
62 lines
1.8 KiB
C
62 lines
1.8 KiB
C
#ifndef crypto_stream_xsalsa20_H
|
|
#define crypto_stream_xsalsa20_H
|
|
|
|
/*
|
|
* WARNING: This is just a stream cipher. It is NOT authenticated encryption.
|
|
* While it provides some protection against eavesdropping, it does NOT
|
|
* provide any security against active attacks.
|
|
* Unless you know what you're doing, what you are looking for is probably
|
|
* the crypto_box functions.
|
|
*/
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include "export.h"
|
|
|
|
#ifdef __cplusplus
|
|
# ifdef __GNUC__
|
|
# pragma GCC diagnostic ignored "-Wlong-long"
|
|
# endif
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define crypto_stream_xsalsa20_KEYBYTES 32U
|
|
SODIUM_EXPORT
|
|
size_t crypto_stream_xsalsa20_keybytes(void);
|
|
|
|
#define crypto_stream_xsalsa20_NONCEBYTES 24U
|
|
SODIUM_EXPORT
|
|
size_t crypto_stream_xsalsa20_noncebytes(void);
|
|
|
|
#define crypto_stream_xsalsa20_MESSAGEBYTES_MAX SODIUM_SIZE_MAX
|
|
SODIUM_EXPORT
|
|
size_t crypto_stream_xsalsa20_messagebytes_max(void);
|
|
|
|
SODIUM_EXPORT
|
|
int crypto_stream_xsalsa20(unsigned char *c, unsigned long long clen,
|
|
const unsigned char *n, const unsigned char *k)
|
|
__attribute__ ((nonnull));
|
|
|
|
SODIUM_EXPORT
|
|
int crypto_stream_xsalsa20_xor(unsigned char *c, const unsigned char *m,
|
|
unsigned long long mlen, const unsigned char *n,
|
|
const unsigned char *k)
|
|
__attribute__ ((nonnull));
|
|
|
|
SODIUM_EXPORT
|
|
int crypto_stream_xsalsa20_xor_ic(unsigned char *c, const unsigned char *m,
|
|
unsigned long long mlen,
|
|
const unsigned char *n, uint64_t ic,
|
|
const unsigned char *k)
|
|
__attribute__ ((nonnull));
|
|
|
|
SODIUM_EXPORT
|
|
void crypto_stream_xsalsa20_keygen(unsigned char k[crypto_stream_xsalsa20_KEYBYTES])
|
|
__attribute__ ((nonnull));
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|