mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-01 04:50:58 +02:00
Update IDF to a0468b2 (#2108)
* Update IDF to a0468b2 * add missing ld file * Fix PIO builds and change coex policy
This commit is contained in:
68
tools/sdk/include/libsodium/sodium.h
Normal file
68
tools/sdk/include/libsodium/sodium.h
Normal file
@ -0,0 +1,68 @@
|
||||
|
||||
#ifndef sodium_H
|
||||
#define sodium_H
|
||||
|
||||
#include "sodium/version.h"
|
||||
|
||||
#include "sodium/core.h"
|
||||
#include "sodium/crypto_aead_aes256gcm.h"
|
||||
#include "sodium/crypto_aead_chacha20poly1305.h"
|
||||
#include "sodium/crypto_aead_xchacha20poly1305.h"
|
||||
#include "sodium/crypto_auth.h"
|
||||
#include "sodium/crypto_auth_hmacsha256.h"
|
||||
#include "sodium/crypto_auth_hmacsha512.h"
|
||||
#include "sodium/crypto_auth_hmacsha512256.h"
|
||||
#include "sodium/crypto_box.h"
|
||||
#include "sodium/crypto_box_curve25519xsalsa20poly1305.h"
|
||||
#include "sodium/crypto_core_hsalsa20.h"
|
||||
#include "sodium/crypto_core_hchacha20.h"
|
||||
#include "sodium/crypto_core_salsa20.h"
|
||||
#include "sodium/crypto_core_salsa2012.h"
|
||||
#include "sodium/crypto_core_salsa208.h"
|
||||
#include "sodium/crypto_generichash.h"
|
||||
#include "sodium/crypto_generichash_blake2b.h"
|
||||
#include "sodium/crypto_hash.h"
|
||||
#include "sodium/crypto_hash_sha256.h"
|
||||
#include "sodium/crypto_hash_sha512.h"
|
||||
#include "sodium/crypto_kdf.h"
|
||||
#include "sodium/crypto_kdf_blake2b.h"
|
||||
#include "sodium/crypto_kx.h"
|
||||
#include "sodium/crypto_onetimeauth.h"
|
||||
#include "sodium/crypto_onetimeauth_poly1305.h"
|
||||
#include "sodium/crypto_pwhash.h"
|
||||
#include "sodium/crypto_pwhash_argon2i.h"
|
||||
#include "sodium/crypto_pwhash_scryptsalsa208sha256.h"
|
||||
#include "sodium/crypto_scalarmult.h"
|
||||
#include "sodium/crypto_scalarmult_curve25519.h"
|
||||
#include "sodium/crypto_secretbox.h"
|
||||
#include "sodium/crypto_secretbox_xsalsa20poly1305.h"
|
||||
#include "sodium/crypto_shorthash.h"
|
||||
#include "sodium/crypto_shorthash_siphash24.h"
|
||||
#include "sodium/crypto_sign.h"
|
||||
#include "sodium/crypto_sign_ed25519.h"
|
||||
#include "sodium/crypto_stream.h"
|
||||
#include "sodium/crypto_stream_chacha20.h"
|
||||
#include "sodium/crypto_stream_salsa20.h"
|
||||
#include "sodium/crypto_stream_xsalsa20.h"
|
||||
#include "sodium/crypto_verify_16.h"
|
||||
#include "sodium/crypto_verify_32.h"
|
||||
#include "sodium/crypto_verify_64.h"
|
||||
#include "sodium/randombytes.h"
|
||||
#ifdef __native_client__
|
||||
# include "sodium/randombytes_nativeclient.h"
|
||||
#endif
|
||||
#include "sodium/randombytes_salsa20_random.h"
|
||||
#include "sodium/randombytes_sysrandom.h"
|
||||
#include "sodium/runtime.h"
|
||||
#include "sodium/utils.h"
|
||||
|
||||
#ifndef SODIUM_LIBRARY_MINIMAL
|
||||
# include "sodium/crypto_box_curve25519xchacha20poly1305.h"
|
||||
# include "sodium/crypto_secretbox_xchacha20poly1305.h"
|
||||
# include "sodium/crypto_stream_aes128ctr.h"
|
||||
# include "sodium/crypto_stream_salsa2012.h"
|
||||
# include "sodium/crypto_stream_salsa208.h"
|
||||
# include "sodium/crypto_stream_xchacha20.h"
|
||||
#endif
|
||||
|
||||
#endif
|
19
tools/sdk/include/libsodium/sodium/core.h
Normal file
19
tools/sdk/include/libsodium/sodium/core.h
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
#ifndef sodium_core_H
|
||||
#define sodium_core_H
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_init(void)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
145
tools/sdk/include/libsodium/sodium/crypto_aead_aes256gcm.h
Normal file
145
tools/sdk/include/libsodium/sodium/crypto_aead_aes256gcm.h
Normal file
@ -0,0 +1,145 @@
|
||||
#ifndef crypto_aead_aes256gcm_H
|
||||
#define crypto_aead_aes256gcm_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_aes256gcm_is_available(void);
|
||||
|
||||
#define crypto_aead_aes256gcm_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_aes256gcm_keybytes(void);
|
||||
|
||||
#define crypto_aead_aes256gcm_NSECBYTES 0U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_aes256gcm_nsecbytes(void);
|
||||
|
||||
#define crypto_aead_aes256gcm_NPUBBYTES 12U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_aes256gcm_npubbytes(void);
|
||||
|
||||
#define crypto_aead_aes256gcm_ABYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_aes256gcm_abytes(void);
|
||||
|
||||
typedef CRYPTO_ALIGN(16) unsigned char crypto_aead_aes256gcm_state[512];
|
||||
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_aes256gcm_statebytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_aes256gcm_encrypt(unsigned char *c,
|
||||
unsigned long long *clen_p,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *nsec,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_aes256gcm_decrypt(unsigned char *m,
|
||||
unsigned long long *mlen_p,
|
||||
unsigned char *nsec,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_aes256gcm_encrypt_detached(unsigned char *c,
|
||||
unsigned char *mac,
|
||||
unsigned long long *maclen_p,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *nsec,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_aes256gcm_decrypt_detached(unsigned char *m,
|
||||
unsigned char *nsec,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *mac,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
/* -- Precomputation interface -- */
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_aes256gcm_beforenm(crypto_aead_aes256gcm_state *ctx_,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_aes256gcm_encrypt_afternm(unsigned char *c,
|
||||
unsigned long long *clen_p,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *nsec,
|
||||
const unsigned char *npub,
|
||||
const crypto_aead_aes256gcm_state *ctx_);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_aes256gcm_decrypt_afternm(unsigned char *m,
|
||||
unsigned long long *mlen_p,
|
||||
unsigned char *nsec,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *npub,
|
||||
const crypto_aead_aes256gcm_state *ctx_)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_aes256gcm_encrypt_detached_afternm(unsigned char *c,
|
||||
unsigned char *mac,
|
||||
unsigned long long *maclen_p,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *nsec,
|
||||
const unsigned char *npub,
|
||||
const crypto_aead_aes256gcm_state *ctx_);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_aes256gcm_decrypt_detached_afternm(unsigned char *m,
|
||||
unsigned char *nsec,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *mac,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *npub,
|
||||
const crypto_aead_aes256gcm_state *ctx_)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_aead_aes256gcm_keygen(unsigned char k[crypto_aead_aes256gcm_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,162 @@
|
||||
#ifndef crypto_aead_chacha20poly1305_H
|
||||
#define crypto_aead_chacha20poly1305_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* -- IETF ChaCha20-Poly1305 construction with a 96-bit nonce and a 32-bit internal counter -- */
|
||||
|
||||
#define crypto_aead_chacha20poly1305_ietf_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_chacha20poly1305_ietf_keybytes(void);
|
||||
|
||||
#define crypto_aead_chacha20poly1305_ietf_NSECBYTES 0U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_chacha20poly1305_ietf_nsecbytes(void);
|
||||
|
||||
#define crypto_aead_chacha20poly1305_ietf_NPUBBYTES 12U
|
||||
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_chacha20poly1305_ietf_npubbytes(void);
|
||||
|
||||
#define crypto_aead_chacha20poly1305_ietf_ABYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_chacha20poly1305_ietf_abytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_chacha20poly1305_ietf_encrypt(unsigned char *c,
|
||||
unsigned long long *clen_p,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *nsec,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_chacha20poly1305_ietf_decrypt(unsigned char *m,
|
||||
unsigned long long *mlen_p,
|
||||
unsigned char *nsec,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_chacha20poly1305_ietf_encrypt_detached(unsigned char *c,
|
||||
unsigned char *mac,
|
||||
unsigned long long *maclen_p,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *nsec,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_chacha20poly1305_ietf_decrypt_detached(unsigned char *m,
|
||||
unsigned char *nsec,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *mac,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_aead_chacha20poly1305_ietf_keygen(unsigned char k[crypto_aead_chacha20poly1305_ietf_KEYBYTES]);
|
||||
|
||||
/* -- Original ChaCha20-Poly1305 construction with a 64-bit nonce and a 64-bit internal counter -- */
|
||||
|
||||
#define crypto_aead_chacha20poly1305_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_chacha20poly1305_keybytes(void);
|
||||
|
||||
#define crypto_aead_chacha20poly1305_NSECBYTES 0U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_chacha20poly1305_nsecbytes(void);
|
||||
|
||||
#define crypto_aead_chacha20poly1305_NPUBBYTES 8U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_chacha20poly1305_npubbytes(void);
|
||||
|
||||
#define crypto_aead_chacha20poly1305_ABYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_chacha20poly1305_abytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_chacha20poly1305_encrypt(unsigned char *c,
|
||||
unsigned long long *clen_p,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *nsec,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_chacha20poly1305_decrypt(unsigned char *m,
|
||||
unsigned long long *mlen_p,
|
||||
unsigned char *nsec,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_chacha20poly1305_encrypt_detached(unsigned char *c,
|
||||
unsigned char *mac,
|
||||
unsigned long long *maclen_p,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *nsec,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_chacha20poly1305_decrypt_detached(unsigned char *m,
|
||||
unsigned char *nsec,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *mac,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_aead_chacha20poly1305_keygen(unsigned char k[crypto_aead_chacha20poly1305_KEYBYTES]);
|
||||
|
||||
/* Aliases */
|
||||
|
||||
#define crypto_aead_chacha20poly1305_IETF_KEYBYTES crypto_aead_chacha20poly1305_ietf_KEYBYTES
|
||||
#define crypto_aead_chacha20poly1305_IETF_NSECBYTES crypto_aead_chacha20poly1305_ietf_NSECBYTES
|
||||
#define crypto_aead_chacha20poly1305_IETF_NPUBBYTES crypto_aead_chacha20poly1305_ietf_NPUBBYTES
|
||||
#define crypto_aead_chacha20poly1305_IETF_ABYTES crypto_aead_chacha20poly1305_ietf_ABYTES
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,91 @@
|
||||
#ifndef crypto_aead_xchacha20poly1305_H
|
||||
#define crypto_aead_xchacha20poly1305_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_aead_xchacha20poly1305_ietf_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_xchacha20poly1305_ietf_keybytes(void);
|
||||
|
||||
#define crypto_aead_xchacha20poly1305_ietf_NSECBYTES 0U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_xchacha20poly1305_ietf_nsecbytes(void);
|
||||
|
||||
#define crypto_aead_xchacha20poly1305_ietf_NPUBBYTES 24U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_xchacha20poly1305_ietf_npubbytes(void);
|
||||
|
||||
#define crypto_aead_xchacha20poly1305_ietf_ABYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_xchacha20poly1305_ietf_abytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_xchacha20poly1305_ietf_encrypt(unsigned char *c,
|
||||
unsigned long long *clen_p,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *nsec,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_xchacha20poly1305_ietf_decrypt(unsigned char *m,
|
||||
unsigned long long *mlen_p,
|
||||
unsigned char *nsec,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_xchacha20poly1305_ietf_encrypt_detached(unsigned char *c,
|
||||
unsigned char *mac,
|
||||
unsigned long long *maclen_p,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *nsec,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_xchacha20poly1305_ietf_decrypt_detached(unsigned char *m,
|
||||
unsigned char *nsec,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *mac,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_aead_xchacha20poly1305_ietf_keygen(unsigned char k[crypto_aead_xchacha20poly1305_ietf_KEYBYTES]);
|
||||
|
||||
/* Aliases */
|
||||
|
||||
#define crypto_aead_xchacha20poly1305_IETF_KEYBYTES crypto_aead_xchacha20poly1305_ietf_KEYBYTES
|
||||
#define crypto_aead_xchacha20poly1305_IETF_NSECBYTES crypto_aead_xchacha20poly1305_ietf_NSECBYTES
|
||||
#define crypto_aead_xchacha20poly1305_IETF_NPUBBYTES crypto_aead_xchacha20poly1305_ietf_NPUBBYTES
|
||||
#define crypto_aead_xchacha20poly1305_IETF_ABYTES crypto_aead_xchacha20poly1305_ietf_ABYTES
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
44
tools/sdk/include/libsodium/sodium/crypto_auth.h
Normal file
44
tools/sdk/include/libsodium/sodium/crypto_auth.h
Normal file
@ -0,0 +1,44 @@
|
||||
#ifndef crypto_auth_H
|
||||
#define crypto_auth_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "crypto_auth_hmacsha512256.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_auth_BYTES crypto_auth_hmacsha512256_BYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_bytes(void);
|
||||
|
||||
#define crypto_auth_KEYBYTES crypto_auth_hmacsha512256_KEYBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_keybytes(void);
|
||||
|
||||
#define crypto_auth_PRIMITIVE "hmacsha512256"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_auth_primitive(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen, const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_verify(const unsigned char *h, const unsigned char *in,
|
||||
unsigned long long inlen, const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_auth_keygen(unsigned char k[crypto_auth_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
68
tools/sdk/include/libsodium/sodium/crypto_auth_hmacsha256.h
Normal file
68
tools/sdk/include/libsodium/sodium/crypto_auth_hmacsha256.h
Normal file
@ -0,0 +1,68 @@
|
||||
#ifndef crypto_auth_hmacsha256_H
|
||||
#define crypto_auth_hmacsha256_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "crypto_hash_sha256.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_auth_hmacsha256_BYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_hmacsha256_bytes(void);
|
||||
|
||||
#define crypto_auth_hmacsha256_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_hmacsha256_keybytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha256(unsigned char *out,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha256_verify(const unsigned char *h,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
typedef struct crypto_auth_hmacsha256_state {
|
||||
crypto_hash_sha256_state ictx;
|
||||
crypto_hash_sha256_state octx;
|
||||
} crypto_auth_hmacsha256_state;
|
||||
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_hmacsha256_statebytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha256_init(crypto_auth_hmacsha256_state *state,
|
||||
const unsigned char *key,
|
||||
size_t keylen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha256_update(crypto_auth_hmacsha256_state *state,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha256_final(crypto_auth_hmacsha256_state *state,
|
||||
unsigned char *out);
|
||||
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_auth_hmacsha256_keygen(unsigned char k[crypto_auth_hmacsha256_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
67
tools/sdk/include/libsodium/sodium/crypto_auth_hmacsha512.h
Normal file
67
tools/sdk/include/libsodium/sodium/crypto_auth_hmacsha512.h
Normal file
@ -0,0 +1,67 @@
|
||||
#ifndef crypto_auth_hmacsha512_H
|
||||
#define crypto_auth_hmacsha512_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "crypto_hash_sha512.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_auth_hmacsha512_BYTES 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_hmacsha512_bytes(void);
|
||||
|
||||
#define crypto_auth_hmacsha512_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_hmacsha512_keybytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha512(unsigned char *out,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha512_verify(const unsigned char *h,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
typedef struct crypto_auth_hmacsha512_state {
|
||||
crypto_hash_sha512_state ictx;
|
||||
crypto_hash_sha512_state octx;
|
||||
} crypto_auth_hmacsha512_state;
|
||||
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_hmacsha512_statebytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha512_init(crypto_auth_hmacsha512_state *state,
|
||||
const unsigned char *key,
|
||||
size_t keylen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha512_update(crypto_auth_hmacsha512_state *state,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha512_final(crypto_auth_hmacsha512_state *state,
|
||||
unsigned char *out);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_auth_hmacsha512_keygen(unsigned char k[crypto_auth_hmacsha512_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,62 @@
|
||||
#ifndef crypto_auth_hmacsha512256_H
|
||||
#define crypto_auth_hmacsha512256_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "crypto_auth_hmacsha512.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_auth_hmacsha512256_BYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_hmacsha512256_bytes(void);
|
||||
|
||||
#define crypto_auth_hmacsha512256_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_hmacsha512256_keybytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha512256(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen,const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha512256_verify(const unsigned char *h,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
typedef crypto_auth_hmacsha512_state crypto_auth_hmacsha512256_state;
|
||||
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_hmacsha512256_statebytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha512256_init(crypto_auth_hmacsha512256_state *state,
|
||||
const unsigned char *key,
|
||||
size_t keylen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha512256_update(crypto_auth_hmacsha512256_state *state,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha512256_final(crypto_auth_hmacsha512256_state *state,
|
||||
unsigned char *out);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_auth_hmacsha512256_keygen(unsigned char k[crypto_auth_hmacsha512256_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
169
tools/sdk/include/libsodium/sodium/crypto_box.h
Normal file
169
tools/sdk/include/libsodium/sodium/crypto_box.h
Normal file
@ -0,0 +1,169 @@
|
||||
#ifndef crypto_box_H
|
||||
#define crypto_box_H
|
||||
|
||||
/*
|
||||
* THREAD SAFETY: crypto_box_keypair() is thread-safe,
|
||||
* provided that sodium_init() was called before.
|
||||
*
|
||||
* Other functions are always thread-safe.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "crypto_box_curve25519xsalsa20poly1305.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_box_SEEDBYTES crypto_box_curve25519xsalsa20poly1305_SEEDBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_seedbytes(void);
|
||||
|
||||
#define crypto_box_PUBLICKEYBYTES crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_publickeybytes(void);
|
||||
|
||||
#define crypto_box_SECRETKEYBYTES crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_secretkeybytes(void);
|
||||
|
||||
#define crypto_box_NONCEBYTES crypto_box_curve25519xsalsa20poly1305_NONCEBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_noncebytes(void);
|
||||
|
||||
#define crypto_box_MACBYTES crypto_box_curve25519xsalsa20poly1305_MACBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_macbytes(void);
|
||||
|
||||
#define crypto_box_PRIMITIVE "curve25519xsalsa20poly1305"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_box_primitive(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_seed_keypair(unsigned char *pk, unsigned char *sk,
|
||||
const unsigned char *seed);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_keypair(unsigned char *pk, unsigned char *sk);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_easy(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen, const unsigned char *n,
|
||||
const unsigned char *pk, const unsigned char *sk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_open_easy(unsigned char *m, const unsigned char *c,
|
||||
unsigned long long clen, const unsigned char *n,
|
||||
const unsigned char *pk, const unsigned char *sk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_detached(unsigned char *c, unsigned char *mac,
|
||||
const unsigned char *m, unsigned long long mlen,
|
||||
const unsigned char *n, const unsigned char *pk,
|
||||
const unsigned char *sk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_open_detached(unsigned char *m, const unsigned char *c,
|
||||
const unsigned char *mac,
|
||||
unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *pk,
|
||||
const unsigned char *sk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
/* -- Precomputation interface -- */
|
||||
|
||||
#define crypto_box_BEFORENMBYTES crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_beforenmbytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_beforenm(unsigned char *k, const unsigned char *pk,
|
||||
const unsigned char *sk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_easy_afternm(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen, const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_open_easy_afternm(unsigned char *m, const unsigned char *c,
|
||||
unsigned long long clen, const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_detached_afternm(unsigned char *c, unsigned char *mac,
|
||||
const unsigned char *m, unsigned long long mlen,
|
||||
const unsigned char *n, const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_open_detached_afternm(unsigned char *m, const unsigned char *c,
|
||||
const unsigned char *mac,
|
||||
unsigned long long clen, const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
/* -- Ephemeral SK interface -- */
|
||||
|
||||
#define crypto_box_SEALBYTES (crypto_box_PUBLICKEYBYTES + crypto_box_MACBYTES)
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_sealbytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_seal(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen, const unsigned char *pk);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_seal_open(unsigned char *m, const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *pk, const unsigned char *sk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
/* -- NaCl compatibility interface ; Requires padding -- */
|
||||
|
||||
#define crypto_box_ZEROBYTES crypto_box_curve25519xsalsa20poly1305_ZEROBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_zerobytes(void);
|
||||
|
||||
#define crypto_box_BOXZEROBYTES crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_boxzerobytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
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)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
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)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_afternm(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen, const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_open_afternm(unsigned char *m, const unsigned char *c,
|
||||
unsigned long long clen, const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,130 @@
|
||||
|
||||
#ifndef crypto_box_curve25519xchacha20poly1305_H
|
||||
#define crypto_box_curve25519xchacha20poly1305_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_box_curve25519xchacha20poly1305_SEEDBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xchacha20poly1305_seedbytes(void);
|
||||
|
||||
#define crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xchacha20poly1305_publickeybytes(void);
|
||||
|
||||
#define crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xchacha20poly1305_secretkeybytes(void);
|
||||
|
||||
#define crypto_box_curve25519xchacha20poly1305_BEFORENMBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xchacha20poly1305_beforenmbytes(void);
|
||||
|
||||
#define crypto_box_curve25519xchacha20poly1305_NONCEBYTES 24U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xchacha20poly1305_noncebytes(void);
|
||||
|
||||
#define crypto_box_curve25519xchacha20poly1305_MACBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xchacha20poly1305_macbytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xchacha20poly1305_seed_keypair(unsigned char *pk,
|
||||
unsigned char *sk,
|
||||
const unsigned char *seed);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xchacha20poly1305_keypair(unsigned char *pk,
|
||||
unsigned char *sk);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xchacha20poly1305_easy(unsigned char *c,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *pk,
|
||||
const unsigned char *sk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xchacha20poly1305_open_easy(unsigned char *m,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *pk,
|
||||
const unsigned char *sk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xchacha20poly1305_detached(unsigned char *c,
|
||||
unsigned char *mac,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *pk,
|
||||
const unsigned char *sk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xchacha20poly1305_open_detached(unsigned char *m,
|
||||
const unsigned char *c,
|
||||
const unsigned char *mac,
|
||||
unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *pk,
|
||||
const unsigned char *sk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
/* -- Precomputation interface -- */
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xchacha20poly1305_beforenm(unsigned char *k,
|
||||
const unsigned char *pk,
|
||||
const unsigned char *sk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xchacha20poly1305_easy_afternm(unsigned char *c,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xchacha20poly1305_open_easy_afternm(unsigned char *m,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xchacha20poly1305_detached_afternm(unsigned char *c,
|
||||
unsigned char *mac,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xchacha20poly1305_open_detached_afternm(unsigned char *m,
|
||||
const unsigned char *c,
|
||||
const unsigned char *mac,
|
||||
unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,100 @@
|
||||
#ifndef crypto_box_curve25519xsalsa20poly1305_H
|
||||
#define crypto_box_curve25519xsalsa20poly1305_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_SEEDBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xsalsa20poly1305_seedbytes(void);
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xsalsa20poly1305_publickeybytes(void);
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xsalsa20poly1305_secretkeybytes(void);
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xsalsa20poly1305_beforenmbytes(void);
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_NONCEBYTES 24U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xsalsa20poly1305_noncebytes(void);
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_MACBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xsalsa20poly1305_macbytes(void);
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xsalsa20poly1305_boxzerobytes(void);
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_ZEROBYTES \
|
||||
(crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES + \
|
||||
crypto_box_curve25519xsalsa20poly1305_MACBYTES)
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xsalsa20poly1305_zerobytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xsalsa20poly1305(unsigned char *c,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *pk,
|
||||
const unsigned char *sk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xsalsa20poly1305_open(unsigned char *m,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *pk,
|
||||
const unsigned char *sk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xsalsa20poly1305_seed_keypair(unsigned char *pk,
|
||||
unsigned char *sk,
|
||||
const unsigned char *seed);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xsalsa20poly1305_keypair(unsigned char *pk,
|
||||
unsigned char *sk);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xsalsa20poly1305_beforenm(unsigned char *k,
|
||||
const unsigned char *pk,
|
||||
const unsigned char *sk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xsalsa20poly1305_afternm(unsigned char *c,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_box_curve25519xsalsa20poly1305_open_afternm(unsigned char *m,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
35
tools/sdk/include/libsodium/sodium/crypto_core_hchacha20.h
Normal file
35
tools/sdk/include/libsodium/sodium/crypto_core_hchacha20.h
Normal file
@ -0,0 +1,35 @@
|
||||
#ifndef crypto_core_hchacha20_H
|
||||
#define crypto_core_hchacha20_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_core_hchacha20_OUTPUTBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_hchacha20_outputbytes(void);
|
||||
|
||||
#define crypto_core_hchacha20_INPUTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_hchacha20_inputbytes(void);
|
||||
|
||||
#define crypto_core_hchacha20_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_hchacha20_keybytes(void);
|
||||
|
||||
#define crypto_core_hchacha20_CONSTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_hchacha20_constbytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_core_hchacha20(unsigned char *out, const unsigned char *in,
|
||||
const unsigned char *k, const unsigned char *c);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
35
tools/sdk/include/libsodium/sodium/crypto_core_hsalsa20.h
Normal file
35
tools/sdk/include/libsodium/sodium/crypto_core_hsalsa20.h
Normal file
@ -0,0 +1,35 @@
|
||||
#ifndef crypto_core_hsalsa20_H
|
||||
#define crypto_core_hsalsa20_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_core_hsalsa20_OUTPUTBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_hsalsa20_outputbytes(void);
|
||||
|
||||
#define crypto_core_hsalsa20_INPUTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_hsalsa20_inputbytes(void);
|
||||
|
||||
#define crypto_core_hsalsa20_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_hsalsa20_keybytes(void);
|
||||
|
||||
#define crypto_core_hsalsa20_CONSTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_hsalsa20_constbytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_core_hsalsa20(unsigned char *out, const unsigned char *in,
|
||||
const unsigned char *k, const unsigned char *c);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
35
tools/sdk/include/libsodium/sodium/crypto_core_salsa20.h
Normal file
35
tools/sdk/include/libsodium/sodium/crypto_core_salsa20.h
Normal file
@ -0,0 +1,35 @@
|
||||
#ifndef crypto_core_salsa20_H
|
||||
#define crypto_core_salsa20_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_core_salsa20_OUTPUTBYTES 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa20_outputbytes(void);
|
||||
|
||||
#define crypto_core_salsa20_INPUTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa20_inputbytes(void);
|
||||
|
||||
#define crypto_core_salsa20_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa20_keybytes(void);
|
||||
|
||||
#define crypto_core_salsa20_CONSTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa20_constbytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_core_salsa20(unsigned char *out, const unsigned char *in,
|
||||
const unsigned char *k, const unsigned char *c);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
35
tools/sdk/include/libsodium/sodium/crypto_core_salsa2012.h
Normal file
35
tools/sdk/include/libsodium/sodium/crypto_core_salsa2012.h
Normal file
@ -0,0 +1,35 @@
|
||||
#ifndef crypto_core_salsa2012_H
|
||||
#define crypto_core_salsa2012_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_core_salsa2012_OUTPUTBYTES 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa2012_outputbytes(void);
|
||||
|
||||
#define crypto_core_salsa2012_INPUTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa2012_inputbytes(void);
|
||||
|
||||
#define crypto_core_salsa2012_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa2012_keybytes(void);
|
||||
|
||||
#define crypto_core_salsa2012_CONSTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa2012_constbytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_core_salsa2012(unsigned char *out, const unsigned char *in,
|
||||
const unsigned char *k, const unsigned char *c);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
35
tools/sdk/include/libsodium/sodium/crypto_core_salsa208.h
Normal file
35
tools/sdk/include/libsodium/sodium/crypto_core_salsa208.h
Normal file
@ -0,0 +1,35 @@
|
||||
#ifndef crypto_core_salsa208_H
|
||||
#define crypto_core_salsa208_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_core_salsa208_OUTPUTBYTES 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa208_outputbytes(void);
|
||||
|
||||
#define crypto_core_salsa208_INPUTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa208_inputbytes(void);
|
||||
|
||||
#define crypto_core_salsa208_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa208_keybytes(void);
|
||||
|
||||
#define crypto_core_salsa208_CONSTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa208_constbytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_core_salsa208(unsigned char *out, const unsigned char *in,
|
||||
const unsigned char *k, const unsigned char *c);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
75
tools/sdk/include/libsodium/sodium/crypto_generichash.h
Normal file
75
tools/sdk/include/libsodium/sodium/crypto_generichash.h
Normal file
@ -0,0 +1,75 @@
|
||||
#ifndef crypto_generichash_H
|
||||
#define crypto_generichash_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "crypto_generichash_blake2b.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_generichash_BYTES_MIN crypto_generichash_blake2b_BYTES_MIN
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_bytes_min(void);
|
||||
|
||||
#define crypto_generichash_BYTES_MAX crypto_generichash_blake2b_BYTES_MAX
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_bytes_max(void);
|
||||
|
||||
#define crypto_generichash_BYTES crypto_generichash_blake2b_BYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_bytes(void);
|
||||
|
||||
#define crypto_generichash_KEYBYTES_MIN crypto_generichash_blake2b_KEYBYTES_MIN
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_keybytes_min(void);
|
||||
|
||||
#define crypto_generichash_KEYBYTES_MAX crypto_generichash_blake2b_KEYBYTES_MAX
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_keybytes_max(void);
|
||||
|
||||
#define crypto_generichash_KEYBYTES crypto_generichash_blake2b_KEYBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_keybytes(void);
|
||||
|
||||
#define crypto_generichash_PRIMITIVE "blake2b"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_generichash_primitive(void);
|
||||
|
||||
typedef crypto_generichash_blake2b_state crypto_generichash_state;
|
||||
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_statebytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_generichash(unsigned char *out, size_t outlen,
|
||||
const unsigned char *in, unsigned long long inlen,
|
||||
const unsigned char *key, size_t keylen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_generichash_init(crypto_generichash_state *state,
|
||||
const unsigned char *key,
|
||||
const size_t keylen, const size_t outlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_generichash_update(crypto_generichash_state *state,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_generichash_final(crypto_generichash_state *state,
|
||||
unsigned char *out, const size_t outlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_generichash_keygen(unsigned char k[crypto_generichash_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
121
tools/sdk/include/libsodium/sodium/crypto_generichash_blake2b.h
Normal file
121
tools/sdk/include/libsodium/sodium/crypto_generichash_blake2b.h
Normal file
@ -0,0 +1,121 @@
|
||||
#ifndef crypto_generichash_blake2b_H
|
||||
#define crypto_generichash_blake2b_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(__IBMC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
# pragma pack(1)
|
||||
#else
|
||||
# pragma pack(push, 1)
|
||||
#endif
|
||||
|
||||
typedef CRYPTO_ALIGN(64) struct crypto_generichash_blake2b_state {
|
||||
uint64_t h[8];
|
||||
uint64_t t[2];
|
||||
uint64_t f[2];
|
||||
uint8_t buf[2 * 128];
|
||||
size_t buflen;
|
||||
uint8_t last_node;
|
||||
} crypto_generichash_blake2b_state;
|
||||
|
||||
#if defined(__IBMC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
# pragma pack()
|
||||
#else
|
||||
# pragma pack(pop)
|
||||
#endif
|
||||
|
||||
#define crypto_generichash_blake2b_BYTES_MIN 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_bytes_min(void);
|
||||
|
||||
#define crypto_generichash_blake2b_BYTES_MAX 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_bytes_max(void);
|
||||
|
||||
#define crypto_generichash_blake2b_BYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_bytes(void);
|
||||
|
||||
#define crypto_generichash_blake2b_KEYBYTES_MIN 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_keybytes_min(void);
|
||||
|
||||
#define crypto_generichash_blake2b_KEYBYTES_MAX 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_keybytes_max(void);
|
||||
|
||||
#define crypto_generichash_blake2b_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_keybytes(void);
|
||||
|
||||
#define crypto_generichash_blake2b_SALTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_saltbytes(void);
|
||||
|
||||
#define crypto_generichash_blake2b_PERSONALBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_personalbytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_statebytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_generichash_blake2b(unsigned char *out, size_t outlen,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *key, size_t keylen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_generichash_blake2b_salt_personal(unsigned char *out, size_t outlen,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *key,
|
||||
size_t keylen,
|
||||
const unsigned char *salt,
|
||||
const unsigned char *personal);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_generichash_blake2b_init(crypto_generichash_blake2b_state *state,
|
||||
const unsigned char *key,
|
||||
const size_t keylen, const size_t outlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_generichash_blake2b_init_salt_personal(crypto_generichash_blake2b_state *state,
|
||||
const unsigned char *key,
|
||||
const size_t keylen, const size_t outlen,
|
||||
const unsigned char *salt,
|
||||
const unsigned char *personal);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_generichash_blake2b_update(crypto_generichash_blake2b_state *state,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_generichash_blake2b_final(crypto_generichash_blake2b_state *state,
|
||||
unsigned char *out,
|
||||
const size_t outlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_generichash_blake2b_keygen(unsigned char k[crypto_generichash_blake2b_KEYBYTES]);
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int _crypto_generichash_blake2b_pick_best_implementation(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
40
tools/sdk/include/libsodium/sodium/crypto_hash.h
Normal file
40
tools/sdk/include/libsodium/sodium/crypto_hash.h
Normal file
@ -0,0 +1,40 @@
|
||||
#ifndef crypto_hash_H
|
||||
#define crypto_hash_H
|
||||
|
||||
/*
|
||||
* WARNING: Unless you absolutely need to use SHA512 for interoperatibility,
|
||||
* purposes, you might want to consider crypto_generichash() instead.
|
||||
* Unlike SHA512, crypto_generichash() is not vulnerable to length
|
||||
* extension attacks.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "crypto_hash_sha512.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_hash_BYTES crypto_hash_sha512_BYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_hash_bytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_hash(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen);
|
||||
|
||||
#define crypto_hash_PRIMITIVE "sha512"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_hash_primitive(void)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
57
tools/sdk/include/libsodium/sodium/crypto_hash_sha256.h
Normal file
57
tools/sdk/include/libsodium/sodium/crypto_hash_sha256.h
Normal file
@ -0,0 +1,57 @@
|
||||
#ifndef crypto_hash_sha256_H
|
||||
#define crypto_hash_sha256_H
|
||||
|
||||
/*
|
||||
* WARNING: Unless you absolutely need to use SHA256 for interoperatibility,
|
||||
* purposes, you might want to consider crypto_generichash() instead.
|
||||
* Unlike SHA256, crypto_generichash() is not vulnerable to length
|
||||
* extension attacks.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct crypto_hash_sha256_state {
|
||||
uint32_t state[8];
|
||||
uint64_t count;
|
||||
uint8_t buf[64];
|
||||
} crypto_hash_sha256_state;
|
||||
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_hash_sha256_statebytes(void);
|
||||
|
||||
#define crypto_hash_sha256_BYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_hash_sha256_bytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_hash_sha256(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_hash_sha256_init(crypto_hash_sha256_state *state);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_hash_sha256_update(crypto_hash_sha256_state *state,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_hash_sha256_final(crypto_hash_sha256_state *state,
|
||||
unsigned char *out);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
57
tools/sdk/include/libsodium/sodium/crypto_hash_sha512.h
Normal file
57
tools/sdk/include/libsodium/sodium/crypto_hash_sha512.h
Normal file
@ -0,0 +1,57 @@
|
||||
#ifndef crypto_hash_sha512_H
|
||||
#define crypto_hash_sha512_H
|
||||
|
||||
/*
|
||||
* WARNING: Unless you absolutely need to use SHA512 for interoperatibility,
|
||||
* purposes, you might want to consider crypto_generichash() instead.
|
||||
* Unlike SHA512, crypto_generichash() is not vulnerable to length
|
||||
* extension attacks.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct crypto_hash_sha512_state {
|
||||
uint64_t state[8];
|
||||
uint64_t count[2];
|
||||
uint8_t buf[128];
|
||||
} crypto_hash_sha512_state;
|
||||
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_hash_sha512_statebytes(void);
|
||||
|
||||
#define crypto_hash_sha512_BYTES 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_hash_sha512_bytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_hash_sha512(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_hash_sha512_init(crypto_hash_sha512_state *state);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_hash_sha512_update(crypto_hash_sha512_state *state,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_hash_sha512_final(crypto_hash_sha512_state *state,
|
||||
unsigned char *out);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
51
tools/sdk/include/libsodium/sodium/crypto_kdf.h
Normal file
51
tools/sdk/include/libsodium/sodium/crypto_kdf.h
Normal file
@ -0,0 +1,51 @@
|
||||
#ifndef crypto_kdf_H
|
||||
#define crypto_kdf_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "crypto_kdf_blake2b.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_kdf_BYTES_MIN crypto_kdf_blake2b_BYTES_MIN
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kdf_bytes_min(void);
|
||||
|
||||
#define crypto_kdf_BYTES_MAX crypto_kdf_blake2b_BYTES_MAX
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kdf_bytes_max(void);
|
||||
|
||||
#define crypto_kdf_CONTEXTBYTES crypto_kdf_blake2b_CONTEXTBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kdf_contextbytes(void);
|
||||
|
||||
#define crypto_kdf_KEYBYTES crypto_kdf_blake2b_KEYBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kdf_keybytes(void);
|
||||
|
||||
#define crypto_kdf_PRIMITIVE "blake2b"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_kdf_primitive(void)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_kdf_derive_from_key(unsigned char *subkey, size_t subkey_len,
|
||||
uint64_t subkey_id,
|
||||
const char ctx[crypto_kdf_CONTEXTBYTES],
|
||||
const unsigned char key[crypto_kdf_KEYBYTES]);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_kdf_keygen(unsigned char k[crypto_kdf_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
42
tools/sdk/include/libsodium/sodium/crypto_kdf_blake2b.h
Normal file
42
tools/sdk/include/libsodium/sodium/crypto_kdf_blake2b.h
Normal file
@ -0,0 +1,42 @@
|
||||
#ifndef crypto_kdf_blake2b_H
|
||||
#define crypto_kdf_blake2b_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "crypto_kdf_blake2b.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_kdf_blake2b_BYTES_MIN 16
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kdf_blake2b_bytes_min(void);
|
||||
|
||||
#define crypto_kdf_blake2b_BYTES_MAX 64
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kdf_blake2b_bytes_max(void);
|
||||
|
||||
#define crypto_kdf_blake2b_CONTEXTBYTES 8
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kdf_blake2b_contextbytes(void);
|
||||
|
||||
#define crypto_kdf_blake2b_KEYBYTES 32
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kdf_blake2b_keybytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_kdf_blake2b_derive_from_key(unsigned char *subkey, size_t subkey_len,
|
||||
uint64_t subkey_id,
|
||||
const char ctx[crypto_kdf_blake2b_CONTEXTBYTES],
|
||||
const unsigned char key[crypto_kdf_blake2b_KEYBYTES]);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
64
tools/sdk/include/libsodium/sodium/crypto_kx.h
Normal file
64
tools/sdk/include/libsodium/sodium/crypto_kx.h
Normal file
@ -0,0 +1,64 @@
|
||||
#ifndef crypto_kx_H
|
||||
#define crypto_kx_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_kx_PUBLICKEYBYTES 32
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kx_publickeybytes(void);
|
||||
|
||||
#define crypto_kx_SECRETKEYBYTES 32
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kx_secretkeybytes(void);
|
||||
|
||||
#define crypto_kx_SEEDBYTES 32
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kx_seedbytes(void);
|
||||
|
||||
#define crypto_kx_SESSIONKEYBYTES 32
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kx_sessionkeybytes(void);
|
||||
|
||||
#define crypto_kx_PRIMITIVE "x25519blake2b"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_kx_primitive(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_kx_seed_keypair(unsigned char pk[crypto_kx_PUBLICKEYBYTES],
|
||||
unsigned char sk[crypto_kx_SECRETKEYBYTES],
|
||||
const unsigned char seed[crypto_kx_SEEDBYTES]);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_kx_keypair(unsigned char pk[crypto_kx_PUBLICKEYBYTES],
|
||||
unsigned char sk[crypto_kx_SECRETKEYBYTES]);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_kx_client_session_keys(unsigned char rx[crypto_kx_SESSIONKEYBYTES],
|
||||
unsigned char tx[crypto_kx_SESSIONKEYBYTES],
|
||||
const unsigned char client_pk[crypto_kx_PUBLICKEYBYTES],
|
||||
const unsigned char client_sk[crypto_kx_SECRETKEYBYTES],
|
||||
const unsigned char server_pk[crypto_kx_PUBLICKEYBYTES])
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_kx_server_session_keys(unsigned char rx[crypto_kx_SESSIONKEYBYTES],
|
||||
unsigned char tx[crypto_kx_SESSIONKEYBYTES],
|
||||
const unsigned char server_pk[crypto_kx_PUBLICKEYBYTES],
|
||||
const unsigned char server_sk[crypto_kx_SECRETKEYBYTES],
|
||||
const unsigned char client_pk[crypto_kx_PUBLICKEYBYTES])
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
62
tools/sdk/include/libsodium/sodium/crypto_onetimeauth.h
Normal file
62
tools/sdk/include/libsodium/sodium/crypto_onetimeauth.h
Normal file
@ -0,0 +1,62 @@
|
||||
#ifndef crypto_onetimeauth_H
|
||||
#define crypto_onetimeauth_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "crypto_onetimeauth_poly1305.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef crypto_onetimeauth_poly1305_state crypto_onetimeauth_state;
|
||||
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_onetimeauth_statebytes(void);
|
||||
|
||||
#define crypto_onetimeauth_BYTES crypto_onetimeauth_poly1305_BYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_onetimeauth_bytes(void);
|
||||
|
||||
#define crypto_onetimeauth_KEYBYTES crypto_onetimeauth_poly1305_KEYBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_onetimeauth_keybytes(void);
|
||||
|
||||
#define crypto_onetimeauth_PRIMITIVE "poly1305"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_onetimeauth_primitive(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_onetimeauth(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen, const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_onetimeauth_verify(const unsigned char *h, const unsigned char *in,
|
||||
unsigned long long inlen, const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_onetimeauth_init(crypto_onetimeauth_state *state,
|
||||
const unsigned char *key);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_onetimeauth_update(crypto_onetimeauth_state *state,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_onetimeauth_final(crypto_onetimeauth_state *state,
|
||||
unsigned char *out);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_onetimeauth_keygen(unsigned char k[crypto_onetimeauth_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,71 @@
|
||||
#ifndef crypto_onetimeauth_poly1305_H
|
||||
#define crypto_onetimeauth_poly1305_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
typedef CRYPTO_ALIGN(16) struct crypto_onetimeauth_poly1305_state {
|
||||
unsigned char opaque[256];
|
||||
} crypto_onetimeauth_poly1305_state;
|
||||
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_onetimeauth_poly1305_statebytes(void);
|
||||
|
||||
#define crypto_onetimeauth_poly1305_BYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_onetimeauth_poly1305_bytes(void);
|
||||
|
||||
#define crypto_onetimeauth_poly1305_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_onetimeauth_poly1305_keybytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_onetimeauth_poly1305(unsigned char *out,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_onetimeauth_poly1305_verify(const unsigned char *h,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_onetimeauth_poly1305_init(crypto_onetimeauth_poly1305_state *state,
|
||||
const unsigned char *key);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_onetimeauth_poly1305_update(crypto_onetimeauth_poly1305_state *state,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_onetimeauth_poly1305_final(crypto_onetimeauth_poly1305_state *state,
|
||||
unsigned char *out);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_onetimeauth_poly1305_keygen(unsigned char k[crypto_onetimeauth_poly1305_KEYBYTES]);
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int _crypto_onetimeauth_poly1305_pick_best_implementation(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
121
tools/sdk/include/libsodium/sodium/crypto_pwhash.h
Normal file
121
tools/sdk/include/libsodium/sodium/crypto_pwhash.h
Normal file
@ -0,0 +1,121 @@
|
||||
#ifndef crypto_pwhash_H
|
||||
#define crypto_pwhash_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "crypto_pwhash_argon2i.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_pwhash_ALG_ARGON2I13 crypto_pwhash_argon2i_ALG_ARGON2I13
|
||||
SODIUM_EXPORT
|
||||
int crypto_pwhash_alg_argon2i13(void);
|
||||
|
||||
#define crypto_pwhash_ALG_DEFAULT crypto_pwhash_ALG_ARGON2I13
|
||||
SODIUM_EXPORT
|
||||
int crypto_pwhash_alg_default(void);
|
||||
|
||||
#define crypto_pwhash_BYTES_MIN crypto_pwhash_argon2i_BYTES_MIN
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_bytes_min(void);
|
||||
|
||||
#define crypto_pwhash_BYTES_MAX crypto_pwhash_argon2i_BYTES_MAX
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_bytes_max(void);
|
||||
|
||||
#define crypto_pwhash_PASSWD_MIN crypto_pwhash_argon2i_PASSWD_MIN
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_passwd_min(void);
|
||||
|
||||
#define crypto_pwhash_PASSWD_MAX crypto_pwhash_argon2i_PASSWD_MAX
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_passwd_max(void);
|
||||
|
||||
#define crypto_pwhash_SALTBYTES crypto_pwhash_argon2i_SALTBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_saltbytes(void);
|
||||
|
||||
#define crypto_pwhash_STRBYTES crypto_pwhash_argon2i_STRBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_strbytes(void);
|
||||
|
||||
#define crypto_pwhash_STRPREFIX crypto_pwhash_argon2i_STRPREFIX
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_pwhash_strprefix(void);
|
||||
|
||||
#define crypto_pwhash_OPSLIMIT_MIN crypto_pwhash_argon2i_OPSLIMIT_MIN
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_opslimit_min(void);
|
||||
|
||||
#define crypto_pwhash_OPSLIMIT_MAX crypto_pwhash_argon2i_OPSLIMIT_MAX
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_opslimit_max(void);
|
||||
|
||||
#define crypto_pwhash_MEMLIMIT_MIN crypto_pwhash_argon2i_MEMLIMIT_MIN
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_memlimit_min(void);
|
||||
|
||||
#define crypto_pwhash_MEMLIMIT_MAX crypto_pwhash_argon2i_MEMLIMIT_MAX
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_memlimit_max(void);
|
||||
|
||||
#define crypto_pwhash_OPSLIMIT_INTERACTIVE crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_opslimit_interactive(void);
|
||||
|
||||
#define crypto_pwhash_MEMLIMIT_INTERACTIVE crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_memlimit_interactive(void);
|
||||
|
||||
#define crypto_pwhash_OPSLIMIT_MODERATE crypto_pwhash_argon2i_OPSLIMIT_MODERATE
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_opslimit_moderate(void);
|
||||
|
||||
#define crypto_pwhash_MEMLIMIT_MODERATE crypto_pwhash_argon2i_MEMLIMIT_MODERATE
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_memlimit_moderate(void);
|
||||
|
||||
#define crypto_pwhash_OPSLIMIT_SENSITIVE crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_opslimit_sensitive(void);
|
||||
|
||||
#define crypto_pwhash_MEMLIMIT_SENSITIVE crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_memlimit_sensitive(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_pwhash(unsigned char * const out, unsigned long long outlen,
|
||||
const char * const passwd, unsigned long long passwdlen,
|
||||
const unsigned char * const salt,
|
||||
unsigned long long opslimit, size_t memlimit, int alg)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_pwhash_str(char out[crypto_pwhash_STRBYTES],
|
||||
const char * const passwd, unsigned long long passwdlen,
|
||||
unsigned long long opslimit, size_t memlimit)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_pwhash_str_verify(const char str[crypto_pwhash_STRBYTES],
|
||||
const char * const passwd,
|
||||
unsigned long long passwdlen)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#define crypto_pwhash_PRIMITIVE "argon2i"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_pwhash_primitive(void)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
120
tools/sdk/include/libsodium/sodium/crypto_pwhash_argon2i.h
Normal file
120
tools/sdk/include/libsodium/sodium/crypto_pwhash_argon2i.h
Normal file
@ -0,0 +1,120 @@
|
||||
#ifndef crypto_pwhash_argon2i_H
|
||||
#define crypto_pwhash_argon2i_H
|
||||
|
||||
#include <limits.h>
|
||||
#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_pwhash_argon2i_ALG_ARGON2I13 1
|
||||
SODIUM_EXPORT
|
||||
int crypto_pwhash_argon2i_alg_argon2i13(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_BYTES_MIN 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_bytes_min(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_BYTES_MAX 4294967295U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_bytes_max(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_PASSWD_MIN 0U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_passwd_min(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_PASSWD_MAX 4294967295U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_passwd_max(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_SALTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_saltbytes(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_STRBYTES 128U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_strbytes(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_STRPREFIX "$argon2i$"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_pwhash_argon2i_strprefix(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_OPSLIMIT_MIN 3U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_opslimit_min(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_OPSLIMIT_MAX 4294967295U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_opslimit_max(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_MEMLIMIT_MIN 1U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_memlimit_min(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_MEMLIMIT_MAX ((SIZE_MAX >= 1ULL << 48) ? 4398046510080U : (SIZE_MAX >= 1ULL << 32) ? 2147483648U : 32768U)
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_memlimit_max(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE 4U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_opslimit_interactive(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE 33554432U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_memlimit_interactive(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_OPSLIMIT_MODERATE 6U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_opslimit_moderate(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_MEMLIMIT_MODERATE 134217728U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_memlimit_moderate(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE 8U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_opslimit_sensitive(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE 536870912U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_memlimit_sensitive(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_pwhash_argon2i(unsigned char * const out,
|
||||
unsigned long long outlen,
|
||||
const char * const passwd,
|
||||
unsigned long long passwdlen,
|
||||
const unsigned char * const salt,
|
||||
unsigned long long opslimit, size_t memlimit,
|
||||
int alg)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_pwhash_argon2i_str(char out[crypto_pwhash_argon2i_STRBYTES],
|
||||
const char * const passwd,
|
||||
unsigned long long passwdlen,
|
||||
unsigned long long opslimit, size_t memlimit)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_pwhash_argon2i_str_verify(const char str[crypto_pwhash_argon2i_STRBYTES],
|
||||
const char * const passwd,
|
||||
unsigned long long passwdlen)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int _crypto_pwhash_argon2i_pick_best_implementation(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,112 @@
|
||||
#ifndef crypto_pwhash_scryptsalsa208sha256_H
|
||||
#define crypto_pwhash_scryptsalsa208sha256_H
|
||||
|
||||
#include <limits.h>
|
||||
#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_pwhash_scryptsalsa208sha256_BYTES_MIN 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_bytes_min(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_BYTES_MAX SIZE_MAX
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_bytes_max(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_PASSWD_MIN 0U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_passwd_min(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_PASSWD_MAX SIZE_MAX
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_passwd_max(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_SALTBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_saltbytes(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_STRBYTES 102U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_strbytes(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_STRPREFIX "$7$"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_pwhash_scryptsalsa208sha256_strprefix(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN 32768U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_opslimit_min(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX 4294967295U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_opslimit_max(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN 16777216U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_memlimit_min(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX ((SIZE_MAX >= 68719476736U) ? 68719476736U : SIZE_MAX)
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_memlimit_max(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE 524288U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_opslimit_interactive(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE 16777216U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_memlimit_interactive(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE 33554432U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE 1073741824U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_pwhash_scryptsalsa208sha256(unsigned char * const out,
|
||||
unsigned long long outlen,
|
||||
const char * const passwd,
|
||||
unsigned long long passwdlen,
|
||||
const unsigned char * const salt,
|
||||
unsigned long long opslimit,
|
||||
size_t memlimit)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_pwhash_scryptsalsa208sha256_str(char out[crypto_pwhash_scryptsalsa208sha256_STRBYTES],
|
||||
const char * const passwd,
|
||||
unsigned long long passwdlen,
|
||||
unsigned long long opslimit,
|
||||
size_t memlimit)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_pwhash_scryptsalsa208sha256_str_verify(const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES],
|
||||
const char * const passwd,
|
||||
unsigned long long passwdlen)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_pwhash_scryptsalsa208sha256_ll(const uint8_t * passwd, size_t passwdlen,
|
||||
const uint8_t * salt, size_t saltlen,
|
||||
uint64_t N, uint32_t r, uint32_t p,
|
||||
uint8_t * buf, size_t buflen)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
37
tools/sdk/include/libsodium/sodium/crypto_scalarmult.h
Normal file
37
tools/sdk/include/libsodium/sodium/crypto_scalarmult.h
Normal file
@ -0,0 +1,37 @@
|
||||
#ifndef crypto_scalarmult_H
|
||||
#define crypto_scalarmult_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "crypto_scalarmult_curve25519.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_scalarmult_BYTES crypto_scalarmult_curve25519_BYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_scalarmult_bytes(void);
|
||||
|
||||
#define crypto_scalarmult_SCALARBYTES crypto_scalarmult_curve25519_SCALARBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_scalarmult_scalarbytes(void);
|
||||
|
||||
#define crypto_scalarmult_PRIMITIVE "curve25519"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_scalarmult_primitive(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_scalarmult_base(unsigned char *q, const unsigned char *n);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_scalarmult(unsigned char *q, const unsigned char *n,
|
||||
const unsigned char *p)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,36 @@
|
||||
#ifndef crypto_scalarmult_curve25519_H
|
||||
#define crypto_scalarmult_curve25519_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_scalarmult_curve25519_BYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_scalarmult_curve25519_bytes(void);
|
||||
|
||||
#define crypto_scalarmult_curve25519_SCALARBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_scalarmult_curve25519_scalarbytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n,
|
||||
const unsigned char *p)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_scalarmult_curve25519_base(unsigned char *q, const unsigned char *n);
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int _crypto_scalarmult_curve25519_pick_best_implementation(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
87
tools/sdk/include/libsodium/sodium/crypto_secretbox.h
Normal file
87
tools/sdk/include/libsodium/sodium/crypto_secretbox.h
Normal file
@ -0,0 +1,87 @@
|
||||
#ifndef crypto_secretbox_H
|
||||
#define crypto_secretbox_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "crypto_secretbox_xsalsa20poly1305.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_secretbox_KEYBYTES crypto_secretbox_xsalsa20poly1305_KEYBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_keybytes(void);
|
||||
|
||||
#define crypto_secretbox_NONCEBYTES crypto_secretbox_xsalsa20poly1305_NONCEBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_noncebytes(void);
|
||||
|
||||
#define crypto_secretbox_MACBYTES crypto_secretbox_xsalsa20poly1305_MACBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_macbytes(void);
|
||||
|
||||
#define crypto_secretbox_PRIMITIVE "xsalsa20poly1305"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_secretbox_primitive(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_secretbox_easy(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen, const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_secretbox_open_easy(unsigned char *m, const unsigned char *c,
|
||||
unsigned long long clen, const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_secretbox_detached(unsigned char *c, unsigned char *mac,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_secretbox_open_detached(unsigned char *m,
|
||||
const unsigned char *c,
|
||||
const unsigned char *mac,
|
||||
unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_secretbox_keygen(unsigned char k[crypto_secretbox_KEYBYTES]);
|
||||
|
||||
/* -- NaCl compatibility interface ; Requires padding -- */
|
||||
|
||||
#define crypto_secretbox_ZEROBYTES crypto_secretbox_xsalsa20poly1305_ZEROBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_zerobytes(void);
|
||||
|
||||
#define crypto_secretbox_BOXZEROBYTES crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_boxzerobytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_secretbox(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen, const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_secretbox_open(unsigned char *m, const unsigned char *c,
|
||||
unsigned long long clen, const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,62 @@
|
||||
#ifndef crypto_secretbox_xchacha20poly1305_H
|
||||
#define crypto_secretbox_xchacha20poly1305_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_secretbox_xchacha20poly1305_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_xchacha20poly1305_keybytes(void);
|
||||
|
||||
#define crypto_secretbox_xchacha20poly1305_NONCEBYTES 24U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_xchacha20poly1305_noncebytes(void);
|
||||
|
||||
#define crypto_secretbox_xchacha20poly1305_MACBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_xchacha20poly1305_macbytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_secretbox_xchacha20poly1305_easy(unsigned char *c,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_secretbox_xchacha20poly1305_open_easy(unsigned char *m,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_secretbox_xchacha20poly1305_detached(unsigned char *c,
|
||||
unsigned char *mac,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_secretbox_xchacha20poly1305_open_detached(unsigned char *m,
|
||||
const unsigned char *c,
|
||||
const unsigned char *mac,
|
||||
unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,58 @@
|
||||
#ifndef crypto_secretbox_xsalsa20poly1305_H
|
||||
#define crypto_secretbox_xsalsa20poly1305_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_secretbox_xsalsa20poly1305_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_xsalsa20poly1305_keybytes(void);
|
||||
|
||||
#define crypto_secretbox_xsalsa20poly1305_NONCEBYTES 24U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_xsalsa20poly1305_noncebytes(void);
|
||||
|
||||
#define crypto_secretbox_xsalsa20poly1305_MACBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_xsalsa20poly1305_macbytes(void);
|
||||
|
||||
#define crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_xsalsa20poly1305_boxzerobytes(void);
|
||||
|
||||
#define crypto_secretbox_xsalsa20poly1305_ZEROBYTES \
|
||||
(crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES + \
|
||||
crypto_secretbox_xsalsa20poly1305_MACBYTES)
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_xsalsa20poly1305_zerobytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_secretbox_xsalsa20poly1305(unsigned char *c,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_secretbox_xsalsa20poly1305_open(unsigned char *m,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_secretbox_xsalsa20poly1305_keygen(unsigned char k[crypto_secretbox_xsalsa20poly1305_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
39
tools/sdk/include/libsodium/sodium/crypto_shorthash.h
Normal file
39
tools/sdk/include/libsodium/sodium/crypto_shorthash.h
Normal file
@ -0,0 +1,39 @@
|
||||
#ifndef crypto_shorthash_H
|
||||
#define crypto_shorthash_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "crypto_shorthash_siphash24.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_shorthash_BYTES crypto_shorthash_siphash24_BYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_shorthash_bytes(void);
|
||||
|
||||
#define crypto_shorthash_KEYBYTES crypto_shorthash_siphash24_KEYBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_shorthash_keybytes(void);
|
||||
|
||||
#define crypto_shorthash_PRIMITIVE "siphash24"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_shorthash_primitive(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_shorthash(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen, const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_shorthash_keygen(unsigned char k[crypto_shorthash_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,48 @@
|
||||
#ifndef crypto_shorthash_siphash24_H
|
||||
#define crypto_shorthash_siphash24_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* -- 64-bit output -- */
|
||||
|
||||
#define crypto_shorthash_siphash24_BYTES 8U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_shorthash_siphash24_bytes(void);
|
||||
|
||||
#define crypto_shorthash_siphash24_KEYBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_shorthash_siphash24_keybytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_shorthash_siphash24(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen, const unsigned char *k);
|
||||
|
||||
#ifndef SODIUM_LIBRARY_MINIMAL
|
||||
/* -- 128-bit output -- */
|
||||
|
||||
#define crypto_shorthash_siphashx24_BYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_shorthash_siphashx24_bytes(void);
|
||||
|
||||
#define crypto_shorthash_siphashx24_KEYBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_shorthash_siphashx24_keybytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_shorthash_siphashx24(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen, const unsigned char *k);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
99
tools/sdk/include/libsodium/sodium/crypto_sign.h
Normal file
99
tools/sdk/include/libsodium/sodium/crypto_sign.h
Normal file
@ -0,0 +1,99 @@
|
||||
#ifndef crypto_sign_H
|
||||
#define crypto_sign_H
|
||||
|
||||
/*
|
||||
* THREAD SAFETY: crypto_sign_keypair() is thread-safe,
|
||||
* provided that sodium_init() was called before.
|
||||
*
|
||||
* Other functions, including crypto_sign_seed_keypair() are always thread-safe.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "crypto_sign_ed25519.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef crypto_sign_ed25519ph_state crypto_sign_state;
|
||||
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_statebytes(void);
|
||||
|
||||
#define crypto_sign_BYTES crypto_sign_ed25519_BYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_bytes(void);
|
||||
|
||||
#define crypto_sign_SEEDBYTES crypto_sign_ed25519_SEEDBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_seedbytes(void);
|
||||
|
||||
#define crypto_sign_PUBLICKEYBYTES crypto_sign_ed25519_PUBLICKEYBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_publickeybytes(void);
|
||||
|
||||
#define crypto_sign_SECRETKEYBYTES crypto_sign_ed25519_SECRETKEYBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_secretkeybytes(void);
|
||||
|
||||
#define crypto_sign_PRIMITIVE "ed25519"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_sign_primitive(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk,
|
||||
const unsigned char *seed);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_keypair(unsigned char *pk, unsigned char *sk);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign(unsigned char *sm, unsigned long long *smlen_p,
|
||||
const unsigned char *m, unsigned long long mlen,
|
||||
const unsigned char *sk);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_open(unsigned char *m, unsigned long long *mlen_p,
|
||||
const unsigned char *sm, unsigned long long smlen,
|
||||
const unsigned char *pk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_detached(unsigned char *sig, unsigned long long *siglen_p,
|
||||
const unsigned char *m, unsigned long long mlen,
|
||||
const unsigned char *sk);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_verify_detached(const unsigned char *sig,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *pk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_init(crypto_sign_state *state);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_update(crypto_sign_state *state,
|
||||
const unsigned char *m, unsigned long long mlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_final_create(crypto_sign_state *state, unsigned char *sig,
|
||||
unsigned long long *siglen_p,
|
||||
const unsigned char *sk);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_final_verify(crypto_sign_state *state, unsigned char *sig,
|
||||
const unsigned char *pk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
110
tools/sdk/include/libsodium/sodium/crypto_sign_ed25519.h
Normal file
110
tools/sdk/include/libsodium/sodium/crypto_sign_ed25519.h
Normal file
@ -0,0 +1,110 @@
|
||||
#ifndef crypto_sign_ed25519_H
|
||||
#define crypto_sign_ed25519_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "crypto_hash_sha512.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct crypto_sign_ed25519ph_state {
|
||||
crypto_hash_sha512_state hs;
|
||||
} crypto_sign_ed25519ph_state;
|
||||
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_ed25519ph_statebytes(void);
|
||||
|
||||
#define crypto_sign_ed25519_BYTES 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_ed25519_bytes(void);
|
||||
|
||||
#define crypto_sign_ed25519_SEEDBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_ed25519_seedbytes(void);
|
||||
|
||||
#define crypto_sign_ed25519_PUBLICKEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_ed25519_publickeybytes(void);
|
||||
|
||||
#define crypto_sign_ed25519_SECRETKEYBYTES (32U + 32U)
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_ed25519_secretkeybytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_ed25519(unsigned char *sm, unsigned long long *smlen_p,
|
||||
const unsigned char *m, unsigned long long mlen,
|
||||
const unsigned char *sk);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_ed25519_open(unsigned char *m, unsigned long long *mlen_p,
|
||||
const unsigned char *sm, unsigned long long smlen,
|
||||
const unsigned char *pk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_ed25519_detached(unsigned char *sig,
|
||||
unsigned long long *siglen_p,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *sk);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_ed25519_verify_detached(const unsigned char *sig,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *pk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_ed25519_keypair(unsigned char *pk, unsigned char *sk);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_ed25519_seed_keypair(unsigned char *pk, unsigned char *sk,
|
||||
const unsigned char *seed);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_ed25519_pk_to_curve25519(unsigned char *curve25519_pk,
|
||||
const unsigned char *ed25519_pk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_ed25519_sk_to_curve25519(unsigned char *curve25519_sk,
|
||||
const unsigned char *ed25519_sk);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_ed25519_sk_to_seed(unsigned char *seed,
|
||||
const unsigned char *sk);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_ed25519_sk_to_pk(unsigned char *pk, const unsigned char *sk);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_ed25519ph_init(crypto_sign_ed25519ph_state *state);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_ed25519ph_update(crypto_sign_ed25519ph_state *state,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_ed25519ph_final_create(crypto_sign_ed25519ph_state *state,
|
||||
unsigned char *sig,
|
||||
unsigned long long *siglen_p,
|
||||
const unsigned char *sk);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_ed25519ph_final_verify(crypto_sign_ed25519ph_state *state,
|
||||
unsigned char *sig,
|
||||
const unsigned char *pk)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,54 @@
|
||||
#ifndef crypto_sign_edwards25519sha512batch_H
|
||||
#define crypto_sign_edwards25519sha512batch_H
|
||||
|
||||
/*
|
||||
* WARNING: This construction was a prototype, which should not be used
|
||||
* any more in new projects.
|
||||
*
|
||||
* crypto_sign_edwards25519sha512batch is provided for applications
|
||||
* initially built with NaCl, but as recommended by the author of this
|
||||
* construction, new applications should use ed25519 instead.
|
||||
*
|
||||
* In Sodium, you should use the high-level crypto_sign_*() functions instead.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_sign_edwards25519sha512batch_BYTES 64U
|
||||
#define crypto_sign_edwards25519sha512batch_PUBLICKEYBYTES 32U
|
||||
#define crypto_sign_edwards25519sha512batch_SECRETKEYBYTES (32U + 32U)
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_edwards25519sha512batch(unsigned char *sm,
|
||||
unsigned long long *smlen_p,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *sk)
|
||||
__attribute__ ((deprecated));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_edwards25519sha512batch_open(unsigned char *m,
|
||||
unsigned long long *mlen_p,
|
||||
const unsigned char *sm,
|
||||
unsigned long long smlen,
|
||||
const unsigned char *pk)
|
||||
__attribute__ ((deprecated));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_sign_edwards25519sha512batch_keypair(unsigned char *pk,
|
||||
unsigned char *sk)
|
||||
__attribute__ ((deprecated));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
52
tools/sdk/include/libsodium/sodium/crypto_stream.h
Normal file
52
tools/sdk/include/libsodium/sodium/crypto_stream.h
Normal file
@ -0,0 +1,52 @@
|
||||
#ifndef crypto_stream_H
|
||||
#define crypto_stream_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 "crypto_stream_xsalsa20.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_stream_KEYBYTES crypto_stream_xsalsa20_KEYBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_keybytes(void);
|
||||
|
||||
#define crypto_stream_NONCEBYTES crypto_stream_xsalsa20_NONCEBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_noncebytes(void);
|
||||
|
||||
#define crypto_stream_PRIMITIVE "xsalsa20"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_stream_primitive(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream(unsigned char *c, unsigned long long clen,
|
||||
const unsigned char *n, const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_xor(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen, const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_stream_keygen(unsigned char k[crypto_stream_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
65
tools/sdk/include/libsodium/sodium/crypto_stream_aes128ctr.h
Normal file
65
tools/sdk/include/libsodium/sodium/crypto_stream_aes128ctr.h
Normal file
@ -0,0 +1,65 @@
|
||||
#ifndef crypto_stream_aes128ctr_H
|
||||
#define crypto_stream_aes128ctr_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 "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_stream_aes128ctr_KEYBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_aes128ctr_keybytes(void);
|
||||
|
||||
#define crypto_stream_aes128ctr_NONCEBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_aes128ctr_noncebytes(void);
|
||||
|
||||
#define crypto_stream_aes128ctr_BEFORENMBYTES 1408U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_aes128ctr_beforenmbytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_aes128ctr(unsigned char *out, unsigned long long outlen,
|
||||
const unsigned char *n, const unsigned char *k)
|
||||
__attribute__ ((deprecated));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_aes128ctr_xor(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen, const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
__attribute__ ((deprecated));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_aes128ctr_beforenm(unsigned char *c, const unsigned char *k)
|
||||
__attribute__ ((deprecated));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_aes128ctr_afternm(unsigned char *out, unsigned long long len,
|
||||
const unsigned char *nonce, const unsigned char *c)
|
||||
__attribute__ ((deprecated));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_aes128ctr_xor_afternm(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long len,
|
||||
const unsigned char *nonce,
|
||||
const unsigned char *c)
|
||||
__attribute__ ((deprecated));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
92
tools/sdk/include/libsodium/sodium/crypto_stream_chacha20.h
Normal file
92
tools/sdk/include/libsodium/sodium/crypto_stream_chacha20.h
Normal file
@ -0,0 +1,92 @@
|
||||
#ifndef crypto_stream_chacha20_H
|
||||
#define crypto_stream_chacha20_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_chacha20_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_chacha20_keybytes(void);
|
||||
|
||||
#define crypto_stream_chacha20_NONCEBYTES 8U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_chacha20_noncebytes(void);
|
||||
|
||||
/* ChaCha20 with a 64-bit nonce and a 64-bit counter, as originally designed */
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_chacha20(unsigned char *c, unsigned long long clen,
|
||||
const unsigned char *n, const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_chacha20_xor(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen, const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_chacha20_xor_ic(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n, uint64_t ic,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_stream_chacha20_keygen(unsigned char k[crypto_stream_chacha20_KEYBYTES]);
|
||||
|
||||
/* ChaCha20 with a 96-bit nonce and a 32-bit counter (IETF) */
|
||||
|
||||
#define crypto_stream_chacha20_ietf_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_chacha20_ietf_keybytes(void);
|
||||
|
||||
#define crypto_stream_chacha20_ietf_NONCEBYTES 12U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_chacha20_ietf_noncebytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_chacha20_ietf(unsigned char *c, unsigned long long clen,
|
||||
const unsigned char *n, const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_chacha20_ietf_xor(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen, const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_chacha20_ietf_xor_ic(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n, uint32_t ic,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_stream_chacha20_ietf_keygen(unsigned char k[crypto_stream_chacha20_ietf_KEYBYTES]);
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int _crypto_stream_chacha20_pick_best_implementation(void);
|
||||
|
||||
/* Aliases */
|
||||
|
||||
#define crypto_stream_chacha20_IETF_KEYBYTES crypto_stream_chacha20_ietf_KEYBYTES
|
||||
#define crypto_stream_chacha20_IETF_NONCEBYTES crypto_stream_chacha20_ietf_NONCEBYTES
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
57
tools/sdk/include/libsodium/sodium/crypto_stream_salsa20.h
Normal file
57
tools/sdk/include/libsodium/sodium/crypto_stream_salsa20.h
Normal file
@ -0,0 +1,57 @@
|
||||
#ifndef crypto_stream_salsa20_H
|
||||
#define crypto_stream_salsa20_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_salsa20_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_salsa20_keybytes(void);
|
||||
|
||||
#define crypto_stream_salsa20_NONCEBYTES 8U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_salsa20_noncebytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_salsa20(unsigned char *c, unsigned long long clen,
|
||||
const unsigned char *n, const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_salsa20_xor(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen, const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_salsa20_xor_ic(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n, uint64_t ic,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_stream_salsa20_keygen(unsigned char k[crypto_stream_salsa20_KEYBYTES]);
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int _crypto_stream_salsa20_pick_best_implementation(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
46
tools/sdk/include/libsodium/sodium/crypto_stream_salsa2012.h
Normal file
46
tools/sdk/include/libsodium/sodium/crypto_stream_salsa2012.h
Normal file
@ -0,0 +1,46 @@
|
||||
#ifndef crypto_stream_salsa2012_H
|
||||
#define crypto_stream_salsa2012_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 "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_stream_salsa2012_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_salsa2012_keybytes(void);
|
||||
|
||||
#define crypto_stream_salsa2012_NONCEBYTES 8U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_salsa2012_noncebytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_salsa2012(unsigned char *c, unsigned long long clen,
|
||||
const unsigned char *n, const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_salsa2012_xor(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen, const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_stream_salsa2012_keygen(unsigned char k[crypto_stream_salsa2012_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
46
tools/sdk/include/libsodium/sodium/crypto_stream_salsa208.h
Normal file
46
tools/sdk/include/libsodium/sodium/crypto_stream_salsa208.h
Normal file
@ -0,0 +1,46 @@
|
||||
#ifndef crypto_stream_salsa208_H
|
||||
#define crypto_stream_salsa208_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 "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_stream_salsa208_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_salsa208_keybytes(void);
|
||||
|
||||
#define crypto_stream_salsa208_NONCEBYTES 8U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_salsa208_noncebytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_salsa208(unsigned char *c, unsigned long long clen,
|
||||
const unsigned char *n, const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_salsa208_xor(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen, const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_stream_salsa208_keygen(unsigned char k[crypto_stream_salsa208_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
53
tools/sdk/include/libsodium/sodium/crypto_stream_xchacha20.h
Normal file
53
tools/sdk/include/libsodium/sodium/crypto_stream_xchacha20.h
Normal file
@ -0,0 +1,53 @@
|
||||
#ifndef crypto_stream_xchacha20_H
|
||||
#define crypto_stream_xchacha20_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_xchacha20_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_xchacha20_keybytes(void);
|
||||
|
||||
#define crypto_stream_xchacha20_NONCEBYTES 24U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_xchacha20_noncebytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_xchacha20(unsigned char *c, unsigned long long clen,
|
||||
const unsigned char *n, const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_xchacha20_xor(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen, const unsigned char *n,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_xchacha20_xor_ic(unsigned char *c, const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n, uint64_t ic,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_stream_xchacha20_keygen(unsigned char k[crypto_stream_xchacha20_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
53
tools/sdk/include/libsodium/sodium/crypto_stream_xsalsa20.h
Normal file
53
tools/sdk/include/libsodium/sodium/crypto_stream_xsalsa20.h
Normal file
@ -0,0 +1,53 @@
|
||||
#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);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_stream_xsalsa20(unsigned char *c, unsigned long long clen,
|
||||
const unsigned char *n, const unsigned char *k);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_stream_xsalsa20_keygen(unsigned char k[crypto_stream_xsalsa20_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
23
tools/sdk/include/libsodium/sodium/crypto_verify_16.h
Normal file
23
tools/sdk/include/libsodium/sodium/crypto_verify_16.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef crypto_verify_16_H
|
||||
#define crypto_verify_16_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_verify_16_BYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_verify_16_bytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_verify_16(const unsigned char *x, const unsigned char *y)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
23
tools/sdk/include/libsodium/sodium/crypto_verify_32.h
Normal file
23
tools/sdk/include/libsodium/sodium/crypto_verify_32.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef crypto_verify_32_H
|
||||
#define crypto_verify_32_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_verify_32_BYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_verify_32_bytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_verify_32(const unsigned char *x, const unsigned char *y)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
23
tools/sdk/include/libsodium/sodium/crypto_verify_64.h
Normal file
23
tools/sdk/include/libsodium/sodium/crypto_verify_64.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef crypto_verify_64_H
|
||||
#define crypto_verify_64_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_verify_64_BYTES 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_verify_64_bytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_verify_64(const unsigned char *x, const unsigned char *y)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
44
tools/sdk/include/libsodium/sodium/export.h
Normal file
44
tools/sdk/include/libsodium/sodium/export.h
Normal file
@ -0,0 +1,44 @@
|
||||
|
||||
#ifndef sodium_export_H
|
||||
#define sodium_export_H
|
||||
|
||||
#ifndef __GNUC__
|
||||
# ifdef __attribute__
|
||||
# undef __attribute__
|
||||
# endif
|
||||
# define __attribute__(a)
|
||||
#endif
|
||||
|
||||
#ifdef SODIUM_STATIC
|
||||
# define SODIUM_EXPORT
|
||||
#else
|
||||
# if defined(_MSC_VER)
|
||||
# ifdef SODIUM_DLL_EXPORT
|
||||
# define SODIUM_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
# define SODIUM_EXPORT __declspec(dllimport)
|
||||
# endif
|
||||
# else
|
||||
# if defined(__SUNPRO_C)
|
||||
# ifndef __GNU_C__
|
||||
# define SODIUM_EXPORT __attribute__ (visibility(__global))
|
||||
# else
|
||||
# define SODIUM_EXPORT __attribute__ __global
|
||||
# endif
|
||||
# elif defined(_MSG_VER)
|
||||
# define SODIUM_EXPORT extern __declspec(dllexport)
|
||||
# else
|
||||
# define SODIUM_EXPORT __attribute__ ((visibility ("default")))
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CRYPTO_ALIGN
|
||||
# if defined(__INTEL_COMPILER) || defined(_MSC_VER)
|
||||
# define CRYPTO_ALIGN(x) __declspec(align(x))
|
||||
# else
|
||||
# define CRYPTO_ALIGN(x) __attribute__ ((aligned(x)))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
217
tools/sdk/include/libsodium/sodium/private/common.h
Normal file
217
tools/sdk/include/libsodium/sodium/private/common.h
Normal file
@ -0,0 +1,217 @@
|
||||
#ifndef common_H
|
||||
#define common_H 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define COMPILER_ASSERT(X) (void) sizeof(char[(X) ? 1 : -1])
|
||||
|
||||
#define ROTL32(X, B) rotl32((X), (B))
|
||||
static inline uint32_t
|
||||
rotl32(const uint32_t x, const int b)
|
||||
{
|
||||
return (x << b) | (x >> (32 - b));
|
||||
}
|
||||
|
||||
#define ROTL64(X, B) rotl64((X), (B))
|
||||
static inline uint64_t
|
||||
rotl64(const uint64_t x, const int b)
|
||||
{
|
||||
return (x << b) | (x >> (64 - b));
|
||||
}
|
||||
|
||||
#define ROTR32(X, B) rotr32((X), (B))
|
||||
static inline uint32_t
|
||||
rotr32(const uint32_t x, const int b)
|
||||
{
|
||||
return (x >> b) | (x << (32 - b));
|
||||
}
|
||||
|
||||
#define ROTR64(X, B) rotr64((X), (B))
|
||||
static inline uint64_t
|
||||
rotr64(const uint64_t x, const int b)
|
||||
{
|
||||
return (x >> b) | (x << (64 - b));
|
||||
}
|
||||
|
||||
#define LOAD64_LE(SRC) load64_le(SRC)
|
||||
static inline uint64_t
|
||||
load64_le(const uint8_t src[8])
|
||||
{
|
||||
#ifdef NATIVE_LITTLE_ENDIAN
|
||||
uint64_t w;
|
||||
memcpy(&w, src, sizeof w);
|
||||
return w;
|
||||
#else
|
||||
uint64_t w = (uint64_t) src[0];
|
||||
w |= (uint64_t) src[1] << 8;
|
||||
w |= (uint64_t) src[2] << 16;
|
||||
w |= (uint64_t) src[3] << 24;
|
||||
w |= (uint64_t) src[4] << 32;
|
||||
w |= (uint64_t) src[5] << 40;
|
||||
w |= (uint64_t) src[6] << 48;
|
||||
w |= (uint64_t) src[7] << 56;
|
||||
return w;
|
||||
#endif
|
||||
}
|
||||
|
||||
#define STORE64_LE(DST, W) store64_le((DST), (W))
|
||||
static inline void
|
||||
store64_le(uint8_t dst[8], uint64_t w)
|
||||
{
|
||||
#ifdef NATIVE_LITTLE_ENDIAN
|
||||
memcpy(dst, &w, sizeof w);
|
||||
#else
|
||||
dst[0] = (uint8_t) w; w >>= 8;
|
||||
dst[1] = (uint8_t) w; w >>= 8;
|
||||
dst[2] = (uint8_t) w; w >>= 8;
|
||||
dst[3] = (uint8_t) w; w >>= 8;
|
||||
dst[4] = (uint8_t) w; w >>= 8;
|
||||
dst[5] = (uint8_t) w; w >>= 8;
|
||||
dst[6] = (uint8_t) w; w >>= 8;
|
||||
dst[7] = (uint8_t) w;
|
||||
#endif
|
||||
}
|
||||
|
||||
#define LOAD32_LE(SRC) load32_le(SRC)
|
||||
static inline uint32_t
|
||||
load32_le(const uint8_t src[4])
|
||||
{
|
||||
#ifdef NATIVE_LITTLE_ENDIAN
|
||||
uint32_t w;
|
||||
memcpy(&w, src, sizeof w);
|
||||
return w;
|
||||
#else
|
||||
uint32_t w = (uint32_t) src[0];
|
||||
w |= (uint32_t) src[1] << 8;
|
||||
w |= (uint32_t) src[2] << 16;
|
||||
w |= (uint32_t) src[3] << 24;
|
||||
return w;
|
||||
#endif
|
||||
}
|
||||
|
||||
#define STORE32_LE(DST, W) store32_le((DST), (W))
|
||||
static inline void
|
||||
store32_le(uint8_t dst[4], uint32_t w)
|
||||
{
|
||||
#ifdef NATIVE_LITTLE_ENDIAN
|
||||
memcpy(dst, &w, sizeof w);
|
||||
#else
|
||||
dst[0] = (uint8_t) w; w >>= 8;
|
||||
dst[1] = (uint8_t) w; w >>= 8;
|
||||
dst[2] = (uint8_t) w; w >>= 8;
|
||||
dst[3] = (uint8_t) w;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ----- */
|
||||
|
||||
#define LOAD64_BE(SRC) load64_be(SRC)
|
||||
static inline uint64_t
|
||||
load64_be(const uint8_t src[8])
|
||||
{
|
||||
#ifdef NATIVE_BIG_ENDIAN
|
||||
uint64_t w;
|
||||
memcpy(&w, src, sizeof w);
|
||||
return w;
|
||||
#else
|
||||
uint64_t w = (uint64_t) src[7];
|
||||
w |= (uint64_t) src[6] << 8;
|
||||
w |= (uint64_t) src[5] << 16;
|
||||
w |= (uint64_t) src[4] << 24;
|
||||
w |= (uint64_t) src[3] << 32;
|
||||
w |= (uint64_t) src[2] << 40;
|
||||
w |= (uint64_t) src[1] << 48;
|
||||
w |= (uint64_t) src[0] << 56;
|
||||
return w;
|
||||
#endif
|
||||
}
|
||||
|
||||
#define STORE64_BE(DST, W) store64_be((DST), (W))
|
||||
static inline void
|
||||
store64_be(uint8_t dst[8], uint64_t w)
|
||||
{
|
||||
#ifdef NATIVE_BIG_ENDIAN
|
||||
memcpy(dst, &w, sizeof w);
|
||||
#else
|
||||
dst[7] = (uint8_t) w; w >>= 8;
|
||||
dst[6] = (uint8_t) w; w >>= 8;
|
||||
dst[5] = (uint8_t) w; w >>= 8;
|
||||
dst[4] = (uint8_t) w; w >>= 8;
|
||||
dst[3] = (uint8_t) w; w >>= 8;
|
||||
dst[2] = (uint8_t) w; w >>= 8;
|
||||
dst[1] = (uint8_t) w; w >>= 8;
|
||||
dst[0] = (uint8_t) w;
|
||||
#endif
|
||||
}
|
||||
|
||||
#define LOAD32_BE(SRC) load32_be(SRC)
|
||||
static inline uint32_t
|
||||
load32_be(const uint8_t src[4])
|
||||
{
|
||||
#ifdef NATIVE_BIG_ENDIAN
|
||||
uint32_t w;
|
||||
memcpy(&w, src, sizeof w);
|
||||
return w;
|
||||
#else
|
||||
uint32_t w = (uint32_t) src[3];
|
||||
w |= (uint32_t) src[2] << 8;
|
||||
w |= (uint32_t) src[1] << 16;
|
||||
w |= (uint32_t) src[0] << 24;
|
||||
return w;
|
||||
#endif
|
||||
}
|
||||
|
||||
#define STORE32_BE(DST, W) store32_be((DST), (W))
|
||||
static inline void
|
||||
store32_be(uint8_t dst[4], uint32_t w)
|
||||
{
|
||||
#ifdef NATIVE_BIG_ENDIAN
|
||||
memcpy(dst, &w, sizeof w);
|
||||
#else
|
||||
dst[3] = (uint8_t) w; w >>= 8;
|
||||
dst[2] = (uint8_t) w; w >>= 8;
|
||||
dst[1] = (uint8_t) w; w >>= 8;
|
||||
dst[0] = (uint8_t) w;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef __GNUC__
|
||||
# ifdef __attribute__
|
||||
# undef __attribute__
|
||||
# endif
|
||||
# define __attribute__(a)
|
||||
#endif
|
||||
|
||||
#ifndef CRYPTO_ALIGN
|
||||
# if defined(__INTEL_COMPILER) || defined(_MSC_VER)
|
||||
# define CRYPTO_ALIGN(x) __declspec(align(x))
|
||||
# else
|
||||
# define CRYPTO_ALIGN(x) __attribute__ ((aligned(x)))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && \
|
||||
(defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86))
|
||||
|
||||
# include <intrin.h>
|
||||
|
||||
# define HAVE_INTRIN_H 1
|
||||
# define HAVE_MMINTRIN_H 1
|
||||
# define HAVE_EMMINTRIN_H 1
|
||||
# define HAVE_PMMINTRIN_H 1
|
||||
# define HAVE_TMMINTRIN_H 1
|
||||
# define HAVE_SMMINTRIN_H 1
|
||||
# define HAVE_AVXINTRIN_H 1
|
||||
# if _MSC_VER >= 1600
|
||||
# define HAVE_WMMINTRIN_H 1
|
||||
# endif
|
||||
# if _MSC_VER >= 1700 && defined(_M_X64)
|
||||
# define HAVE_AVX2INTRIN_H 1
|
||||
# endif
|
||||
#elif defined(HAVE_INTRIN_H)
|
||||
# include <intrin.h>
|
||||
#endif
|
||||
|
||||
#endif
|
160
tools/sdk/include/libsodium/sodium/private/curve25519_ref10.h
Normal file
160
tools/sdk/include/libsodium/sodium/private/curve25519_ref10.h
Normal file
@ -0,0 +1,160 @@
|
||||
#ifndef curve25519_ref10_H
|
||||
#define curve25519_ref10_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define fe crypto_core_curve25519_ref10_fe
|
||||
typedef int32_t fe[10];
|
||||
|
||||
/*
|
||||
fe means field element.
|
||||
Here the field is \Z/(2^255-19).
|
||||
An element t, entries t[0]...t[9], represents the integer
|
||||
t[0]+2^26 t[1]+2^51 t[2]+2^77 t[3]+2^102 t[4]+...+2^230 t[9].
|
||||
Bounds on each t[i] vary depending on context.
|
||||
*/
|
||||
|
||||
#define fe_frombytes crypto_core_curve25519_ref10_fe_frombytes
|
||||
#define fe_tobytes crypto_core_curve25519_ref10_fe_tobytes
|
||||
#define fe_copy crypto_core_curve25519_ref10_fe_copy
|
||||
#define fe_isnonzero crypto_core_curve25519_ref10_fe_isnonzero
|
||||
#define fe_isnegative crypto_core_curve25519_ref10_fe_isnegative
|
||||
#define fe_0 crypto_core_curve25519_ref10_fe_0
|
||||
#define fe_1 crypto_core_curve25519_ref10_fe_1
|
||||
#define fe_cmov crypto_core_curve25519_ref10_fe_cmov
|
||||
#define fe_add crypto_core_curve25519_ref10_fe_add
|
||||
#define fe_sub crypto_core_curve25519_ref10_fe_sub
|
||||
#define fe_neg crypto_core_curve25519_ref10_fe_neg
|
||||
#define fe_mul crypto_core_curve25519_ref10_fe_mul
|
||||
#define fe_sq crypto_core_curve25519_ref10_fe_sq
|
||||
#define fe_sq2 crypto_core_curve25519_ref10_fe_sq2
|
||||
#define fe_invert crypto_core_curve25519_ref10_fe_invert
|
||||
#define fe_pow22523 crypto_core_curve25519_ref10_fe_pow22523
|
||||
|
||||
extern void fe_frombytes(fe,const unsigned char *);
|
||||
extern void fe_tobytes(unsigned char *,const fe);
|
||||
|
||||
extern void fe_copy(fe,const fe);
|
||||
extern int fe_isnonzero(const fe);
|
||||
extern int fe_isnegative(const fe);
|
||||
extern void fe_0(fe);
|
||||
extern void fe_1(fe);
|
||||
extern void fe_cmov(fe,const fe,unsigned int);
|
||||
extern void fe_add(fe,const fe,const fe);
|
||||
extern void fe_sub(fe,const fe,const fe);
|
||||
extern void fe_neg(fe,const fe);
|
||||
extern void fe_mul(fe,const fe,const fe);
|
||||
extern void fe_sq(fe,const fe);
|
||||
extern void fe_sq2(fe,const fe);
|
||||
extern void fe_invert(fe,const fe);
|
||||
extern void fe_pow22523(fe,const fe);
|
||||
|
||||
/*
|
||||
ge means group element.
|
||||
*
|
||||
Here the group is the set of pairs (x,y) of field elements (see fe.h)
|
||||
satisfying -x^2 + y^2 = 1 + d x^2y^2
|
||||
where d = -121665/121666.
|
||||
*
|
||||
Representations:
|
||||
ge_p2 (projective): (X:Y:Z) satisfying x=X/Z, y=Y/Z
|
||||
ge_p3 (extended): (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT
|
||||
ge_p1p1 (completed): ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T
|
||||
ge_precomp (Duif): (y+x,y-x,2dxy)
|
||||
*/
|
||||
|
||||
#define ge_p2 crypto_core_curve25519_ref10_ge_p2
|
||||
typedef struct {
|
||||
fe X;
|
||||
fe Y;
|
||||
fe Z;
|
||||
} ge_p2;
|
||||
|
||||
#define ge_p3 crypto_core_curve25519_ref10_ge_p3
|
||||
typedef struct {
|
||||
fe X;
|
||||
fe Y;
|
||||
fe Z;
|
||||
fe T;
|
||||
} ge_p3;
|
||||
|
||||
#define ge_p1p1 crypto_core_curve25519_ref10_ge_p1p1
|
||||
typedef struct {
|
||||
fe X;
|
||||
fe Y;
|
||||
fe Z;
|
||||
fe T;
|
||||
} ge_p1p1;
|
||||
|
||||
#define ge_precomp crypto_core_curve25519_ref10_ge_precomp
|
||||
typedef struct {
|
||||
fe yplusx;
|
||||
fe yminusx;
|
||||
fe xy2d;
|
||||
} ge_precomp;
|
||||
|
||||
#define ge_cached crypto_core_curve25519_ref10_ge_cached
|
||||
typedef struct {
|
||||
fe YplusX;
|
||||
fe YminusX;
|
||||
fe Z;
|
||||
fe T2d;
|
||||
} ge_cached;
|
||||
|
||||
#define ge_frombytes_negate_vartime crypto_core_curve25519_ref10_ge_frombytes_negate_vartime
|
||||
#define ge_tobytes crypto_core_curve25519_ref10_ge_tobytes
|
||||
#define ge_p3_tobytes crypto_core_curve25519_ref10_ge_p3_tobytes
|
||||
|
||||
#define ge_p2_0 crypto_core_curve25519_ref10_ge_p2_0
|
||||
#define ge_p3_0 crypto_core_curve25519_ref10_ge_p3_0
|
||||
#define ge_precomp_0 crypto_core_curve25519_ref10_ge_precomp_0
|
||||
#define ge_p3_to_p2 crypto_core_curve25519_ref10_ge_p3_to_p2
|
||||
#define ge_p3_to_cached crypto_core_curve25519_ref10_ge_p3_to_cached
|
||||
#define ge_p1p1_to_p2 crypto_core_curve25519_ref10_ge_p1p1_to_p2
|
||||
#define ge_p1p1_to_p3 crypto_core_curve25519_ref10_ge_p1p1_to_p3
|
||||
#define ge_p2_dbl crypto_core_curve25519_ref10_ge_p2_dbl
|
||||
#define ge_p3_dbl crypto_core_curve25519_ref10_ge_p3_dbl
|
||||
|
||||
#define ge_madd crypto_core_curve25519_ref10_ge_madd
|
||||
#define ge_msub crypto_core_curve25519_ref10_ge_msub
|
||||
#define ge_add crypto_core_curve25519_ref10_ge_add
|
||||
#define ge_sub crypto_core_curve25519_ref10_ge_sub
|
||||
#define ge_scalarmult_base crypto_core_curve25519_ref10_ge_scalarmult_base
|
||||
#define ge_double_scalarmult_vartime crypto_core_curve25519_ref10_ge_double_scalarmult_vartime
|
||||
#define ge_scalarmult_vartime crypto_core_curve25519_ref10_ge_scalarmult_vartime
|
||||
|
||||
extern void ge_tobytes(unsigned char *,const ge_p2 *);
|
||||
extern void ge_p3_tobytes(unsigned char *,const ge_p3 *);
|
||||
extern int ge_frombytes_negate_vartime(ge_p3 *,const unsigned char *);
|
||||
|
||||
extern void ge_p2_0(ge_p2 *);
|
||||
extern void ge_p3_0(ge_p3 *);
|
||||
extern void ge_precomp_0(ge_precomp *);
|
||||
extern void ge_p3_to_p2(ge_p2 *,const ge_p3 *);
|
||||
extern void ge_p3_to_cached(ge_cached *,const ge_p3 *);
|
||||
extern void ge_p1p1_to_p2(ge_p2 *,const ge_p1p1 *);
|
||||
extern void ge_p1p1_to_p3(ge_p3 *,const ge_p1p1 *);
|
||||
extern void ge_p2_dbl(ge_p1p1 *,const ge_p2 *);
|
||||
extern void ge_p3_dbl(ge_p1p1 *,const ge_p3 *);
|
||||
|
||||
extern void ge_madd(ge_p1p1 *,const ge_p3 *,const ge_precomp *);
|
||||
extern void ge_msub(ge_p1p1 *,const ge_p3 *,const ge_precomp *);
|
||||
extern void ge_add(ge_p1p1 *,const ge_p3 *,const ge_cached *);
|
||||
extern void ge_sub(ge_p1p1 *,const ge_p3 *,const ge_cached *);
|
||||
extern void ge_scalarmult_base(ge_p3 *,const unsigned char *);
|
||||
extern void ge_double_scalarmult_vartime(ge_p2 *,const unsigned char *,const ge_p3 *,const unsigned char *);
|
||||
extern void ge_scalarmult_vartime(ge_p3 *,const unsigned char *,const ge_p3 *);
|
||||
|
||||
/*
|
||||
The set of scalars is \Z/l
|
||||
where l = 2^252 + 27742317777372353535851937790883648493.
|
||||
*/
|
||||
|
||||
#define sc_reduce crypto_core_curve25519_ref10_sc_reduce
|
||||
#define sc_muladd crypto_core_curve25519_ref10_sc_muladd
|
||||
|
||||
extern void sc_reduce(unsigned char *);
|
||||
extern void sc_muladd(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *);
|
||||
|
||||
#endif
|
7
tools/sdk/include/libsodium/sodium/private/mutex.h
Normal file
7
tools/sdk/include/libsodium/sodium/private/mutex.h
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef mutex_H
|
||||
#define mutex_H 1
|
||||
|
||||
extern int sodium_crit_enter(void);
|
||||
extern int sodium_crit_leave(void);
|
||||
|
||||
#endif
|
50
tools/sdk/include/libsodium/sodium/private/sse2_64_32.h
Normal file
50
tools/sdk/include/libsodium/sodium/private/sse2_64_32.h
Normal file
@ -0,0 +1,50 @@
|
||||
#ifndef sse2_64_32_H
|
||||
#define sse2_64_32_H 1
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#ifdef HAVE_INTRIN_H
|
||||
# include <intrin.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_EMMINTRIN_H) && \
|
||||
!(defined(__amd64) || defined(__amd64__) || defined(__x86_64__) || \
|
||||
defined(_M_X64) || defined(_M_AMD64))
|
||||
|
||||
# include <emmintrin.h>
|
||||
# include <stdint.h>
|
||||
|
||||
# ifndef _mm_set_epi64x
|
||||
# define _mm_set_epi64x(Q0, Q1) sodium__mm_set_epi64x((Q0), (Q1))
|
||||
static inline __m128i
|
||||
sodium__mm_set_epi64x(int64_t q1, int64_t q0)
|
||||
{
|
||||
union { int64_t as64; int32_t as32[2]; } x0, x1;
|
||||
x0.as64 = q0; x1.as64 = q1;
|
||||
return _mm_set_epi32(x1.as32[1], x1.as32[0], x0.as32[1], x0.as32[0]);
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifndef _mm_set1_epi64x
|
||||
# define _mm_set1_epi64x(Q) sodium__mm_set1_epi64x(Q)
|
||||
static inline __m128i
|
||||
sodium__mm_set1_epi64x(int64_t q)
|
||||
{
|
||||
return _mm_set_epi64x(q, q);
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifndef _mm_cvtsi64_si128
|
||||
# define _mm_cvtsi64_si128(Q) sodium__mm_cvtsi64_si128(Q)
|
||||
static inline __m128i
|
||||
sodium__mm_cvtsi64_si128(int64_t q)
|
||||
{
|
||||
union { int64_t as64; int32_t as32[2]; } x;
|
||||
x.as64 = q;
|
||||
return _mm_setr_epi32(x.as32[0], x.as32[1], 0, 0);
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
66
tools/sdk/include/libsodium/sodium/randombytes.h
Normal file
66
tools/sdk/include/libsodium/sodium/randombytes.h
Normal file
@ -0,0 +1,66 @@
|
||||
|
||||
#ifndef randombytes_H
|
||||
#define randombytes_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct randombytes_implementation {
|
||||
const char *(*implementation_name)(void); /* required */
|
||||
uint32_t (*random)(void); /* required */
|
||||
void (*stir)(void); /* optional */
|
||||
uint32_t (*uniform)(const uint32_t upper_bound); /* optional, a default implementation will be used if NULL */
|
||||
void (*buf)(void * const buf, const size_t size); /* required */
|
||||
int (*close)(void); /* optional */
|
||||
} randombytes_implementation;
|
||||
|
||||
#define randombytes_SEEDBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t randombytes_seedbytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void randombytes_buf(void * const buf, const size_t size);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void randombytes_buf_deterministic(void * const buf, const size_t size,
|
||||
const unsigned char seed[randombytes_SEEDBYTES]);
|
||||
|
||||
SODIUM_EXPORT
|
||||
uint32_t randombytes_random(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
uint32_t randombytes_uniform(const uint32_t upper_bound);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void randombytes_stir(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int randombytes_close(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int randombytes_set_implementation(randombytes_implementation *impl);
|
||||
|
||||
SODIUM_EXPORT
|
||||
const char *randombytes_implementation_name(void);
|
||||
|
||||
/* -- NaCl compatibility interface -- */
|
||||
|
||||
SODIUM_EXPORT
|
||||
void randombytes(unsigned char * const buf, const unsigned long long buf_len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,23 @@
|
||||
|
||||
#ifndef randombytes_nativeclient_H
|
||||
#define randombytes_nativeclient_H
|
||||
|
||||
#ifdef __native_client__
|
||||
|
||||
# include "export.h"
|
||||
# include "randombytes.h"
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
SODIUM_EXPORT
|
||||
extern struct randombytes_implementation randombytes_nativeclient_implementation;
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,19 @@
|
||||
|
||||
#ifndef randombytes_salsa20_random_H
|
||||
#define randombytes_salsa20_random_H
|
||||
|
||||
#include "export.h"
|
||||
#include "randombytes.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SODIUM_EXPORT
|
||||
extern struct randombytes_implementation randombytes_salsa20_implementation;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
19
tools/sdk/include/libsodium/sodium/randombytes_sysrandom.h
Normal file
19
tools/sdk/include/libsodium/sodium/randombytes_sysrandom.h
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
#ifndef randombytes_sysrandom_H
|
||||
#define randombytes_sysrandom_H
|
||||
|
||||
#include "export.h"
|
||||
#include "randombytes.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SODIUM_EXPORT
|
||||
extern struct randombytes_implementation randombytes_sysrandom_implementation;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
46
tools/sdk/include/libsodium/sodium/runtime.h
Normal file
46
tools/sdk/include/libsodium/sodium/runtime.h
Normal file
@ -0,0 +1,46 @@
|
||||
|
||||
#ifndef sodium_runtime_H
|
||||
#define sodium_runtime_H
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_runtime_has_neon(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_runtime_has_sse2(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_runtime_has_sse3(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_runtime_has_ssse3(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_runtime_has_sse41(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_runtime_has_avx(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_runtime_has_avx2(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_runtime_has_pclmul(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_runtime_has_aesni(void);
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int _sodium_runtime_get_cpu_features(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
131
tools/sdk/include/libsodium/sodium/utils.h
Normal file
131
tools/sdk/include/libsodium/sodium/utils.h
Normal file
@ -0,0 +1,131 @@
|
||||
|
||||
#ifndef sodium_utils_H
|
||||
#define sodium_utils_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef SODIUM_C99
|
||||
# if defined(__cplusplus) || !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
|
||||
# define SODIUM_C99(X)
|
||||
# else
|
||||
# define SODIUM_C99(X) X
|
||||
# endif
|
||||
#endif
|
||||
|
||||
SODIUM_EXPORT
|
||||
void sodium_memzero(void * const pnt, const size_t len);
|
||||
|
||||
/*
|
||||
* WARNING: sodium_memcmp() must be used to verify if two secret keys
|
||||
* are equal, in constant time.
|
||||
* It returns 0 if the keys are equal, and -1 if they differ.
|
||||
* This function is not designed for lexicographical comparisons.
|
||||
*/
|
||||
SODIUM_EXPORT
|
||||
int sodium_memcmp(const void * const b1_, const void * const b2_, size_t len)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
/*
|
||||
* sodium_compare() returns -1 if b1_ < b2_, 1 if b1_ > b2_ and 0 if b1_ == b2_
|
||||
* It is suitable for lexicographical comparisons, or to compare nonces
|
||||
* and counters stored in little-endian format.
|
||||
* However, it is slower than sodium_memcmp().
|
||||
*/
|
||||
SODIUM_EXPORT
|
||||
int sodium_compare(const unsigned char *b1_, const unsigned char *b2_,
|
||||
size_t len)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_is_zero(const unsigned char *n, const size_t nlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void sodium_increment(unsigned char *n, const size_t nlen);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void sodium_add(unsigned char *a, const unsigned char *b, const size_t len);
|
||||
|
||||
SODIUM_EXPORT
|
||||
char *sodium_bin2hex(char * const hex, const size_t hex_maxlen,
|
||||
const unsigned char * const bin, const size_t bin_len);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_hex2bin(unsigned char * const bin, const size_t bin_maxlen,
|
||||
const char * const hex, const size_t hex_len,
|
||||
const char * const ignore, size_t * const bin_len,
|
||||
const char ** const hex_end);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_mlock(void * const addr, const size_t len);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_munlock(void * const addr, const size_t len);
|
||||
|
||||
/* WARNING: sodium_malloc() and sodium_allocarray() are not general-purpose
|
||||
* allocation functions.
|
||||
*
|
||||
* They return a pointer to a region filled with 0xd0 bytes, immediately
|
||||
* followed by a guard page.
|
||||
* As a result, accessing a single byte after the requested allocation size
|
||||
* will intentionally trigger a segmentation fault.
|
||||
*
|
||||
* A canary and an additional guard page placed before the beginning of the
|
||||
* region may also kill the process if a buffer underflow is detected.
|
||||
*
|
||||
* The memory layout is:
|
||||
* [unprotected region size (read only)][guard page (no access)][unprotected pages (read/write)][guard page (no access)]
|
||||
* With the layout of the unprotected pages being:
|
||||
* [optional padding][16-bytes canary][user region]
|
||||
*
|
||||
* However:
|
||||
* - These functions are significantly slower than standard functions
|
||||
* - Each allocation requires 3 or 4 additional pages
|
||||
* - The returned address will not be aligned if the allocation size is not
|
||||
* a multiple of the required alignment. For this reason, these functions
|
||||
* are designed to store data, such as secret keys and messages.
|
||||
*
|
||||
* sodium_malloc() can be used to allocate any libsodium data structure.
|
||||
*
|
||||
* The crypto_generichash_state structure is packed and its length is
|
||||
* either 357 or 361 bytes. For this reason, when using sodium_malloc() to
|
||||
* allocate a crypto_generichash_state structure, padding must be added in
|
||||
* order to ensure proper alignment. crypto_generichash_statebytes()
|
||||
* returns the rounded up structure size, and should be prefered to sizeof():
|
||||
* state = sodium_malloc(crypto_generichash_statebytes());
|
||||
*/
|
||||
|
||||
SODIUM_EXPORT
|
||||
void *sodium_malloc(const size_t size)
|
||||
__attribute__ ((malloc));
|
||||
|
||||
SODIUM_EXPORT
|
||||
void *sodium_allocarray(size_t count, size_t size)
|
||||
__attribute__ ((malloc));
|
||||
|
||||
SODIUM_EXPORT
|
||||
void sodium_free(void *ptr);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_mprotect_noaccess(void *ptr);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_mprotect_readonly(void *ptr);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_mprotect_readwrite(void *ptr);
|
||||
|
||||
/* -------- */
|
||||
|
||||
int _sodium_alloc_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
35
tools/sdk/include/libsodium/sodium/version.h
Normal file
35
tools/sdk/include/libsodium/sodium/version.h
Normal file
@ -0,0 +1,35 @@
|
||||
|
||||
#ifndef sodium_version_H
|
||||
#define sodium_version_H
|
||||
|
||||
#include <sodium/export.h>
|
||||
|
||||
/* IMPORTANT: As we don't use autotools, these version are not automatically
|
||||
updated if we change submodules. They need to be changed manually.
|
||||
*/
|
||||
|
||||
#define SODIUM_VERSION_STRING "1.0.12-idf"
|
||||
|
||||
/* Note: these are not the same as the overall version, see
|
||||
configure.ac for the relevant macros */
|
||||
#define SODIUM_LIBRARY_VERSION_MAJOR 9
|
||||
#define SODIUM_LIBRARY_VERSION_MINOR 4
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SODIUM_EXPORT
|
||||
const char *sodium_version_string(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_library_version_major(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int sodium_library_version_minor(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user