Skip to content
Permalink
Browse files

Update bundled libsodium to 1.0.16

  • Loading branch information...
DrLynix committed Sep 29, 2018
1 parent bfcda14 commit e6fe309824e52bd32e2e192e086079a0b72d907f
Showing with 1,501 additions and 258 deletions.
  1. BIN windows/sodium-debug.lib
  2. BIN windows/sodium-release.lib
  3. +18 −5 windows/sodium.h
  4. +9 −0 windows/sodium/core.h
  5. +31 −1 windows/sodium/crypto_aead_aes256gcm.h
  6. +23 −5 windows/sodium/crypto_aead_chacha20poly1305.h
  7. +97 −0 windows/sodium/crypto_aead_xchacha20poly1305.h
  8. +4 −1 windows/sodium/crypto_auth.h
  9. +6 −1 windows/sodium/crypto_auth_hmacsha256.h
  10. +5 −1 windows/sodium/crypto_auth_hmacsha512.h
  11. +5 −1 windows/sodium/crypto_auth_hmacsha512256.h
  12. +7 −3 windows/sodium/crypto_box.h
  13. +159 −0 windows/sodium/crypto_box_curve25519xchacha20poly1305.h
  14. +25 −16 windows/sodium/crypto_box_curve25519xsalsa20poly1305.h
  15. +37 −0 windows/sodium/crypto_core_ed25519.h
  16. +8 −4 windows/sodium/crypto_core_salsa208.h
  17. +5 −1 windows/sodium/crypto_generichash.h
  18. +4 −9 windows/sodium/crypto_generichash_blake2b.h
  19. +1 −1 windows/sodium/crypto_hash.h
  20. +5 −4 windows/sodium/crypto_hash_sha256.h
  21. +5 −4 windows/sodium/crypto_hash_sha512.h
  22. +0 −8 windows/sodium/crypto_int32.h
  23. +0 −8 windows/sodium/crypto_int64.h
  24. +51 −0 windows/sodium/crypto_kdf.h
  25. +42 −0 windows/sodium/crypto_kdf_blake2b.h
  26. +64 −0 windows/sodium/crypto_kx.h
  27. +5 −1 windows/sodium/crypto_onetimeauth.h
  28. +12 −10 windows/sodium/crypto_onetimeauth_poly1305.h
  29. +70 −12 windows/sodium/crypto_pwhash.h
  30. +46 −10 windows/sodium/crypto_pwhash_argon2i.h
  31. +122 −0 windows/sodium/crypto_pwhash_argon2id.h
  32. +46 −5 windows/sodium/crypto_pwhash_scryptsalsa208sha256.h
  33. +8 −0 windows/sodium/crypto_scalarmult.h
  34. +8 −4 windows/sodium/crypto_scalarmult_curve25519.h
  35. +41 −0 windows/sodium/crypto_scalarmult_ed25519.h
  36. +8 −1 windows/sodium/crypto_secretbox.h
  37. +68 −0 windows/sodium/crypto_secretbox_xchacha20poly1305.h
  38. +23 −10 windows/sodium/crypto_secretbox_xsalsa20poly1305.h
  39. +102 −0 windows/sodium/crypto_secretstream_xchacha20poly1305.h
  40. +4 −1 windows/sodium/crypto_shorthash.h
  41. +19 −1 windows/sodium/crypto_shorthash_siphash24.h
  42. +29 −3 windows/sodium/crypto_sign.h
  43. +33 −1 windows/sodium/crypto_sign_ed25519.h
  44. +2 −1 windows/sodium/crypto_sign_edwards25519sha512batch.h
  45. +8 −1 windows/sodium/crypto_stream.h
  46. +0 −60 windows/sodium/crypto_stream_aes128ctr.h
  47. +25 −4 windows/sodium/crypto_stream_chacha20.h
  48. +9 −1 windows/sodium/crypto_stream_salsa20.h
  49. +8 −1 windows/sodium/crypto_stream_salsa2012.h
  50. +18 −5 windows/sodium/crypto_stream_salsa208.h
  51. +57 −0 windows/sodium/crypto_stream_xchacha20.h
  52. +9 −1 windows/sodium/crypto_stream_xsalsa20.h
  53. +0 −8 windows/sodium/crypto_uint16.h
  54. +0 −8 windows/sodium/crypto_uint32.h
  55. +0 −8 windows/sodium/crypto_uint64.h
  56. +0 −8 windows/sodium/crypto_uint8.h
  57. +9 −0 windows/sodium/export.h
  58. +13 −3 windows/sodium/randombytes.h
  59. +23 −0 windows/sodium/randombytes_nativeclient.h
  60. +15 −9 windows/sodium/runtime.h
  61. +43 −5 windows/sodium/utils.h
  62. +7 −3 windows/sodium/version.h
BIN +44 KB (100%) windows/sodium-debug.lib
Binary file not shown.
BIN +2.11 MB (240%) windows/sodium-release.lib
Binary file not shown.
@@ -2,9 +2,12 @@
#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"
@@ -21,25 +24,25 @@
#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_secretstream_xchacha20poly1305.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_aes128ctr.h"
#include "sodium/crypto_stream_chacha20.h"
#include "sodium/crypto_stream_salsa20.h"
#include "sodium/crypto_stream_salsa2012.h"
#include "sodium/crypto_stream_salsa208.h"
#include "sodium/crypto_stream_xsalsa20.h"
#include "sodium/crypto_verify_16.h"
#include "sodium/crypto_verify_32.h"
@@ -52,6 +55,16 @@
#include "sodium/randombytes_sysrandom.h"
#include "sodium/runtime.h"
#include "sodium/utils.h"
#include "sodium/version.h"

#ifndef SODIUM_LIBRARY_MINIMAL
# include "sodium/crypto_box_curve25519xchacha20poly1305.h"
# include "sodium/crypto_core_ed25519.h"
# include "sodium/crypto_scalarmult_ed25519.h"
# include "sodium/crypto_secretbox_xchacha20poly1305.h"
# include "sodium/crypto_pwhash_scryptsalsa208sha256.h"
# include "sodium/crypto_stream_salsa2012.h"
# include "sodium/crypto_stream_salsa208.h"
# include "sodium/crypto_stream_xchacha20.h"
#endif

#endif
@@ -12,6 +12,15 @@ SODIUM_EXPORT
int sodium_init(void)
__attribute__ ((warn_unused_result));

/* ---- */

SODIUM_EXPORT
int sodium_set_misuse_handler(void (*handler)(void));

SODIUM_EXPORT
void sodium_misuse(void)
__attribute__ ((noreturn));

#ifdef __cplusplus
}
#endif
@@ -1,11 +1,31 @@
#ifndef crypto_aead_aes256gcm_H
#define crypto_aead_aes256gcm_H

/*
* WARNING: Despite being the most popular AEAD construction due to its
* use in TLS, safely using AES-GCM in a different context is tricky.
*
* No more than ~ 350 GB of input data should be encrypted with a given key.
* This is for ~ 16 KB messages -- Actual figures vary according to
* message sizes.
*
* In addition, nonces are short and repeated nonces would totally destroy
* the security of this scheme.
*
* Nonces should thus come from atomic counters, which can be difficult to
* set up in a distributed environment.
*
* Unless you absolutely need AES-GCM, use crypto_aead_xchacha20poly1305_ietf_*()
* instead. It doesn't have any of these limitations.
* Or, if you don't need to authenticate additional data, just stick to
* crypto_secretbox().
*/

#include <stddef.h>
#include "export.h"

#ifdef __cplusplus
# if __GNUC__
# ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
@@ -30,7 +50,14 @@ size_t crypto_aead_aes256gcm_npubbytes(void);
SODIUM_EXPORT
size_t crypto_aead_aes256gcm_abytes(void);

#define crypto_aead_aes256gcm_MESSAGEBYTES_MAX \
SODIUM_MIN(SODIUM_SIZE_MAX - crypto_aead_aes256gcm_ABYTES, \
(16ULL * ((1ULL << 32) - 2ULL)) - crypto_aead_aes256gcm_ABYTES)
SODIUM_EXPORT
size_t crypto_aead_aes256gcm_messagebytes_max(void);

typedef CRYPTO_ALIGN(16) unsigned char crypto_aead_aes256gcm_state[512];

SODIUM_EXPORT
size_t crypto_aead_aes256gcm_statebytes(void);

@@ -134,6 +161,9 @@ int crypto_aead_aes256gcm_decrypt_detached_afternm(unsigned char *m,
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
@@ -5,7 +5,7 @@
#include "export.h"

#ifdef __cplusplus
# if __GNUC__
# ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
@@ -30,6 +30,12 @@ size_t crypto_aead_chacha20poly1305_ietf_npubbytes(void);
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_ietf_abytes(void);

#define crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX \
SODIUM_MIN(SODIUM_SIZE_MAX - crypto_aead_chacha20poly1305_ietf_ABYTES, \
(64ULL * (1ULL << 32) - 64ULL) - crypto_aead_chacha20poly1305_ietf_ABYTES)
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_ietf_messagebytes_max(void);

SODIUM_EXPORT
int crypto_aead_chacha20poly1305_ietf_encrypt(unsigned char *c,
unsigned long long *clen_p,
@@ -77,6 +83,9 @@ int crypto_aead_chacha20poly1305_ietf_decrypt_detached(unsigned char *m,
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
@@ -95,6 +104,11 @@ size_t crypto_aead_chacha20poly1305_npubbytes(void);
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_abytes(void);

#define crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX \
(SODIUM_SIZE_MAX - crypto_aead_chacha20poly1305_ABYTES)
SODIUM_EXPORT
size_t crypto_aead_chacha20poly1305_messagebytes_max(void);

SODIUM_EXPORT
int crypto_aead_chacha20poly1305_encrypt(unsigned char *c,
unsigned long long *clen_p,
@@ -142,12 +156,16 @@ int crypto_aead_chacha20poly1305_decrypt_detached(unsigned char *m,
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
#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
#define crypto_aead_chacha20poly1305_IETF_MESSAGEBYTES_MAX crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX

#ifdef __cplusplus
}
@@ -0,0 +1,97 @@
#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);

#define crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX \
(SODIUM_SIZE_MAX - crypto_aead_xchacha20poly1305_ietf_ABYTES)
SODIUM_EXPORT
size_t crypto_aead_xchacha20poly1305_ietf_messagebytes_max(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
#define crypto_aead_xchacha20poly1305_IETF_MESSAGEBYTES_MAX crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX

#ifdef __cplusplus
}
#endif

#endif
@@ -7,7 +7,7 @@
#include "export.h"

#ifdef __cplusplus
# if __GNUC__
# ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
@@ -34,6 +34,9 @@ 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
@@ -6,7 +6,7 @@
#include "export.h"

#ifdef __cplusplus
# if __GNUC__
# ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
@@ -39,6 +39,7 @@ 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);

@@ -56,6 +57,10 @@ 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
@@ -6,7 +6,7 @@
#include "export.h"

#ifdef __cplusplus
# if __GNUC__
# ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
@@ -39,6 +39,7 @@ 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);

@@ -56,6 +57,9 @@ 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
@@ -6,7 +6,7 @@
#include "export.h"

#ifdef __cplusplus
# if __GNUC__
# ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
@@ -34,6 +34,7 @@ int crypto_auth_hmacsha512256_verify(const unsigned char *h,
/* ------------------------------------------------------------------------- */

typedef crypto_auth_hmacsha512_state crypto_auth_hmacsha512256_state;

SODIUM_EXPORT
size_t crypto_auth_hmacsha512256_statebytes(void);

@@ -51,6 +52,9 @@ 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
Oops, something went wrong.

0 comments on commit e6fe309

Please sign in to comment.
You can’t perform that action at this time.