summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2018-02-01 15:22:48 -0500
committerJason Carey <jcarey@argv.me>2018-02-08 18:01:41 -0500
commitf639bbb16ace7598865a889211ba89b8c5ccf6fe (patch)
tree390adfed4445486d192b8743f68667729304ae87
parentd9e01f4eb569495b63b459e05e38609d3427976c (diff)
downloadmongo-f639bbb16ace7598865a889211ba89b8c5ccf6fe.tar.gz
SERVER-32779 Upgrade tomcrypt to 1.18.1
(cherry picked from commit 260e724de1e8dd8970099b7c3b8d5e00d3edd9a4)
-rw-r--r--src/third_party/SConscript2
-rw-r--r--src/third_party/scripts/tomcrypt_get_sources.sh2
-rw-r--r--src/third_party/tomcrypt-1.18.1/LICENSE (renamed from src/third_party/tomcrypt-1.18.0-rc2/LICENSE)0
-rw-r--r--src/third_party/tomcrypt-1.18.1/SConscript (renamed from src/third_party/tomcrypt-1.18.0-rc2/SConscript)0
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/hashes/helper/hash_memory.c (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/hashes/helper/hash_memory.c)6
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/hashes/sha1.c (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/hashes/sha1.c)8
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/hashes/sha2/sha256.c (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/hashes/sha2/sha256.c)8
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt.h (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt.h)11
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_argchk.h (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_argchk.h)8
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_cfg.h (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_cfg.h)58
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_cipher.h (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_cipher.h)16
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_custom.h (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_custom.h)43
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_hash.h (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_hash.h)12
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_mac.h (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_mac.h)27
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_macros.h (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_macros.h)6
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_math.h (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_math.h)15
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_misc.h (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_misc.h)8
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_pk.h (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_pk.h)44
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_pkcs.h (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_pkcs.h)12
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_prng.h (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_prng.h)8
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/mac/hmac/hmac_done.c (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/mac/hmac/hmac_done.c)6
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/mac/hmac/hmac_init.c (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/mac/hmac/hmac_init.c)8
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/mac/hmac/hmac_memory.c (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/mac/hmac/hmac_memory.c)6
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/mac/hmac/hmac_process.c (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/mac/hmac/hmac_process.c)6
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/misc/compare_testvector.c (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/misc/compare_testvector.c)6
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/misc/crypt/crypt_argchk.c (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/misc/crypt/crypt_argchk.c)8
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/misc/crypt/crypt_find_hash.c (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/misc/crypt/crypt_find_hash.c)6
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/misc/crypt/crypt_hash_descriptor.c (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/misc/crypt/crypt_hash_descriptor.c)6
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/misc/crypt/crypt_hash_is_valid.c (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/misc/crypt/crypt_hash_is_valid.c)6
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/misc/crypt/crypt_register_hash.c (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/misc/crypt/crypt_register_hash.c)6
-rw-r--r--src/third_party/tomcrypt-1.18.1/src/misc/zeromem.c (renamed from src/third_party/tomcrypt-1.18.0-rc2/src/misc/zeromem.c)6
31 files changed, 177 insertions, 187 deletions
diff --git a/src/third_party/SConscript b/src/third_party/SConscript
index 416ef7a92a8..69c4a02a61b 100644
--- a/src/third_party/SConscript
+++ b/src/third_party/SConscript
@@ -14,7 +14,7 @@ yamlSuffix = '-0.5.3'
icuSuffix = '-57.1'
gperftoolsSuffix = '-2.5'
timelibSuffix = '-2017.05'
-tomcryptSuffix = '-1.18.0-rc2'
+tomcryptSuffix = '-1.18.1'
thirdPartyIncludePathList = [
('s2', '#/src/third_party/s2'),
diff --git a/src/third_party/scripts/tomcrypt_get_sources.sh b/src/third_party/scripts/tomcrypt_get_sources.sh
index 08d8c55b3f9..89d10611c96 100644
--- a/src/third_party/scripts/tomcrypt_get_sources.sh
+++ b/src/third_party/scripts/tomcrypt_get_sources.sh
@@ -13,7 +13,7 @@ fi
# how we got the last tom crypt sources
-VERSION=1.18.0-rc2
+VERSION=1.18.1
cd `git rev-parse --show-toplevel`/src/third_party/tomcrypt-$VERSION
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/LICENSE b/src/third_party/tomcrypt-1.18.1/LICENSE
index 294248fa5d3..294248fa5d3 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/LICENSE
+++ b/src/third_party/tomcrypt-1.18.1/LICENSE
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/SConscript b/src/third_party/tomcrypt-1.18.1/SConscript
index ac040bf3dea..ac040bf3dea 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/SConscript
+++ b/src/third_party/tomcrypt-1.18.1/SConscript
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/hashes/helper/hash_memory.c b/src/third_party/tomcrypt-1.18.1/src/hashes/helper/hash_memory.c
index a7a01eb3262..36a38082d9b 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/hashes/helper/hash_memory.c
+++ b/src/third_party/tomcrypt-1.18.1/src/hashes/helper/hash_memory.c
@@ -64,6 +64,6 @@ LBL_ERR:
}
#endif /* #ifdef LTC_HASH_HELPERS */
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/hashes/sha1.c b/src/third_party/tomcrypt-1.18.1/src/hashes/sha1.c
index 120da72f1fc..7b372a90ccd 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/hashes/sha1.c
+++ b/src/third_party/tomcrypt-1.18.1/src/hashes/sha1.c
@@ -246,7 +246,7 @@ int sha1_test(void)
return CRYPT_NOP;
#else
static const struct {
- char *msg;
+ const char *msg;
unsigned char hash[20];
} tests[] = {
{ "abc",
@@ -281,6 +281,6 @@ int sha1_test(void)
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/hashes/sha2/sha256.c b/src/third_party/tomcrypt-1.18.1/src/hashes/sha2/sha256.c
index 28de8211a07..75da1a2f9bc 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/hashes/sha2/sha256.c
+++ b/src/third_party/tomcrypt-1.18.1/src/hashes/sha2/sha256.c
@@ -292,7 +292,7 @@ int sha256_test(void)
return CRYPT_NOP;
#else
static const struct {
- char *msg;
+ const char *msg;
unsigned char hash[32];
} tests[] = {
{ "abc",
@@ -329,6 +329,6 @@ int sha256_test(void)
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt.h b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt.h
index 9df0afb57e3..83c49d76586 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt.h
+++ b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt.h
@@ -27,7 +27,7 @@ extern "C" {
/* version */
#define CRYPT 0x0118
-#define SCRYPT "1.18.0-rc2"
+#define SCRYPT "1.18.1"
/* max size of either a cipher/hash block or symmetric key [largest of the two] */
#define MAXBLOCKSIZE 128
@@ -68,7 +68,8 @@ enum {
CRYPT_OVERFLOW, /* An overflow of a value was detected/prevented */
CRYPT_UNUSED1, /* UNUSED1 */
- CRYPT_UNUSED2, /* UNUSED2 */
+
+ CRYPT_INPUT_TOO_LONG, /* The input was longer than expected. */
CRYPT_PK_INVALID_SIZE, /* Invalid size input for PK parameters */
@@ -97,6 +98,6 @@ enum {
#endif /* TOMCRYPT_H_ */
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_argchk.h b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_argchk.h
index b0786260a39..6095c280c91 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_argchk.h
+++ b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_argchk.h
@@ -20,7 +20,7 @@
#define NORETURN
#endif
-void crypt_argchk(char *v, char *s, int d) NORETURN;
+void crypt_argchk(const char *v, const char *s, int d) NORETURN;
#define LTC_ARGCHK(x) do { if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); } }while(0)
#define LTC_ARGCHKVD(x) do { if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); } }while(0)
@@ -48,6 +48,6 @@ void crypt_argchk(char *v, char *s, int d) NORETURN;
#endif
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_cfg.h b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_cfg.h
index d283636d301..3bb3f768cd7 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_cfg.h
+++ b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_cfg.h
@@ -64,6 +64,11 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2);
#define ARGTYPE 0
#endif
+#undef LTC_ENCRYPT
+#define LTC_ENCRYPT 0
+#undef LTC_DECRYPT
+#define LTC_DECRYPT 1
+
/* Controls endianess and size of registers. Leave uncommented to get platform neutral [slower] code
*
* Note: in order to use the optimized macros your platform must support unaligned 32 and 64 bit read/writes.
@@ -168,15 +173,17 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2);
/* endianness fallback */
#if !defined(ENDIAN_BIG) && !defined(ENDIAN_LITTLE)
- #if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || \
+ #if defined(_BYTE_ORDER) && _BYTE_ORDER == _BIG_ENDIAN || \
+ defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || \
defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ || \
- defined(__BIG_ENDIAN__) || defined(_BIG_ENDIAN) || \
+ defined(__BIG_ENDIAN__) || \
defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \
defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__)
#define ENDIAN_BIG
- #elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || \
+ #elif defined(_BYTE_ORDER) && _BYTE_ORDER == _LITTLE_ENDIAN || \
+ defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || \
defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ || \
- defined(__LITTLE_ENDIAN__) || defined(_LITTLE_ENDIAN) || \
+ defined(__LITTLE_ENDIAN__) || \
defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || \
defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__)
#define ENDIAN_LITTLE
@@ -212,6 +219,22 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2);
#endif
#endif
+#if defined(ENDIAN_64BITWORD) && !defined(_MSC_VER)
+typedef unsigned long long ltc_mp_digit;
+#else
+typedef unsigned long ltc_mp_digit;
+#endif
+
+/* No asm is a quick way to disable anything "not portable" */
+#ifdef LTC_NO_ASM
+ #define ENDIAN_NEUTRAL
+ #undef ENDIAN_32BITWORD
+ #undef ENDIAN_64BITWORD
+ #undef LTC_FAST
+ #define LTC_NO_ROLC
+ #define LTC_NO_BSWAP
+#endif
+
/* No LTC_FAST if: explicitly disabled OR non-gcc/non-clang compiler OR old gcc OR using -ansi -std=c99 */
#if defined(LTC_NO_FAST) || (__GNUC__ < 4) || defined(__STRICT_ANSI__)
#undef LTC_FAST
@@ -226,25 +249,8 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2);
#endif
#endif
-#ifdef ENDIAN_64BITWORD
-typedef ulong64 ltc_mp_digit;
-#else
-typedef ulong32 ltc_mp_digit;
-#endif
-
-/* No asm is a quick way to disable anything "not portable" */
-#ifdef LTC_NO_ASM
- #define ENDIAN_NEUTRAL
- #undef ENDIAN_32BITWORD
- #undef ENDIAN_64BITWORD
- #undef LTC_FAST
- #undef LTC_FAST_TYPE
- #define LTC_NO_ROLC
- #define LTC_NO_BSWAP
-#endif
-
#if !defined(ENDIAN_NEUTRAL) && (defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE)) && !(defined(ENDIAN_32BITWORD) || defined(ENDIAN_64BITWORD))
- #error You must specify a word size as well as endianess in tomcrypt_cfg.h
+ #error You must specify a word size as well as endianess in tomcrypt_cfg.h
#endif
#if !(defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE))
@@ -252,7 +258,7 @@ typedef ulong32 ltc_mp_digit;
#endif
#if (defined(ENDIAN_32BITWORD) && defined(ENDIAN_64BITWORD))
- #error Cannot be 32 and 64 bit words...
+ #error Cannot be 32 and 64 bit words...
#endif
/* gcc 4.3 and up has a bswap builtin; detect it by gcc version.
@@ -272,6 +278,6 @@ typedef ulong32 ltc_mp_digit;
#endif
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_cipher.h b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_cipher.h
index 0510aedeaaa..ef0b5e5d344 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_cipher.h
+++ b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_cipher.h
@@ -349,7 +349,7 @@ typedef struct {
/** cipher descriptor table, last entry has "name == NULL" to mark the end of table */
extern struct ltc_cipher_descriptor {
/** name of cipher */
- char *name;
+ const char *name;
/** internal ID */
unsigned char ID;
/** min keysize (octets) */
@@ -499,8 +499,8 @@ extern struct ltc_cipher_descriptor {
/** Accelerated GCM packet (one shot)
@param key The secret key
@param keylen The length of the secret key
- @param IV The initial vector
- @param IVlen The length of the initial vector
+ @param IV The initialization vector
+ @param IVlen The length of the initialization vector
@param adata The additional authentication data (header)
@param adatalen The length of the adata
@param pt The plaintext
@@ -875,8 +875,8 @@ int ctr_test(void);
#ifdef LTC_LRW_MODE
-#define LRW_ENCRYPT 0
-#define LRW_DECRYPT 1
+#define LRW_ENCRYPT LTC_ENCRYPT
+#define LRW_DECRYPT LTC_DECRYPT
int lrw_start( int cipher,
const unsigned char *IV,
@@ -1003,6 +1003,6 @@ int sober128_stream_test(void);
#endif /* LTC_SOBER128_STREAM */
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_custom.h b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_custom.h
index 6a990fd4d47..b5cad3efe4e 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_custom.h
+++ b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_custom.h
@@ -62,7 +62,6 @@
/* shortcut to disable automatic inclusion */
#if defined LTC_NOTHING && !defined LTC_EASY
- #define LTC_NO_MATH
#define LTC_NO_CIPHERS
#define LTC_NO_MODES
#define LTC_NO_HASHES
@@ -71,7 +70,6 @@
#define LTC_NO_PK
#define LTC_NO_PKCS
#define LTC_NO_MISC
- #define LTC_NO_FILE
#endif /* LTC_NOTHING */
/* Easy button? */
@@ -426,30 +424,6 @@
#define LTC_ECC_TIMING_RESISTANT
#endif
-/* define these PK sizes out of LTC_NO_PK
- * to have them always defined
- */
-#if defined(LTC_MRSA)
-/* Min and Max RSA key sizes (in bits) */
-#ifndef MIN_RSA_SIZE
-#define MIN_RSA_SIZE 1024
-#endif
-#ifndef MAX_RSA_SIZE
-#define MAX_RSA_SIZE 4096
-#endif
-#endif
-
-/* in cases where you want ASN.1/DER functionality, but no
- * RSA, you can define this externally if 1024 is not enough
- */
-#if defined(LTC_MRSA)
-#define LTC_DER_MAX_PUBKEY_SIZE MAX_RSA_SIZE
-#elif !defined(LTC_DER_MAX_PUBKEY_SIZE)
-/* this includes DSA */
-#define LTC_DER_MAX_PUBKEY_SIZE 1024
-#endif
-
-
/* PKCS #1 (RSA) and #5 (Password Handling) stuff */
#ifndef LTC_NO_PKCS
@@ -501,6 +475,11 @@
#if defined(LTC_MECC) || defined(LTC_MRSA) || defined(LTC_MDSA) || defined(LTC_MKAT)
/* Include the MPI functionality? (required by the PK algorithms) */
#define LTC_MPI
+
+ #ifndef LTC_PK_MAX_RETRIES
+ /* iterations limit for retry-loops */
+ #define LTC_PK_MAX_RETRIES 20
+ #endif
#endif
#ifdef LTC_MRSA
@@ -551,6 +530,10 @@
#error LTC_BLAKE2BMAC requires LTC_BLAKE2B
#endif
+#if defined(LTC_SPRNG) && !defined(LTC_RNG_GET_BYTES)
+ #error LTC_SPRNG requires LTC_RNG_GET_BYTES
+#endif
+
#if defined(LTC_NO_MATH) && (defined(LTM_DESC) || defined(TFM_DESC) || defined(GMP_DESC))
#error LTC_NO_MATH defined, but also a math descriptor
#endif
@@ -566,6 +549,7 @@
#define LTC_MUTEX_INIT(x) LTC_ARGCHK(pthread_mutex_init(x, NULL) == 0);
#define LTC_MUTEX_LOCK(x) LTC_ARGCHK(pthread_mutex_lock(x) == 0);
#define LTC_MUTEX_UNLOCK(x) LTC_ARGCHK(pthread_mutex_unlock(x) == 0);
+#define LTC_MUTEX_DESTROY(x) LTC_ARGCHK(pthread_mutex_destroy(x) == 0);
#else
@@ -576,6 +560,7 @@
#define LTC_MUTEX_INIT(x)
#define LTC_MUTEX_LOCK(x)
#define LTC_MUTEX_UNLOCK(x)
+#define LTC_MUTEX_DESTROY(x)
#endif
@@ -593,6 +578,6 @@
#endif
#endif
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_hash.h b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_hash.h
index 1898717b0be..628c3b6541c 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_hash.h
+++ b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_hash.h
@@ -204,7 +204,7 @@ typedef union Hash_state {
/** hash descriptor */
extern struct ltc_hash_descriptor {
/** name of hash */
- char *name;
+ const char *name;
/** internal ID */
unsigned char ID;
/** Size of digest in octets */
@@ -497,7 +497,7 @@ int func_name (hash_state * md, const unsigned char *in, unsigned long inlen)
if (md-> state_var .curlen > sizeof(md-> state_var .buf)) { \
return CRYPT_INVALID_ARG; \
} \
- if ((md-> state_var .length + inlen) < md-> state_var .length) { \
+ if ((md-> state_var .length + inlen) < md-> state_var .length) { \
return CRYPT_HASH_OVERFLOW; \
} \
while (inlen > 0) { \
@@ -510,7 +510,7 @@ int func_name (hash_state * md, const unsigned char *in, unsigned long inlen)
inlen -= block_size; \
} else { \
n = MIN(inlen, (block_size - md-> state_var .curlen)); \
- XMEMCPY(md-> state_var .buf + md-> state_var.curlen, in, (size_t)n); \
+ XMEMCPY(md-> state_var .buf + md-> state_var.curlen, in, (size_t)n); \
md-> state_var .curlen += n; \
in += n; \
inlen -= n; \
@@ -526,6 +526,6 @@ int func_name (hash_state * md, const unsigned char *in, unsigned long inlen)
return CRYPT_OK; \
}
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_mac.h b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_mac.h
index a64ba2cd080..c5378c736aa 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_mac.h
+++ b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_mac.h
@@ -118,7 +118,6 @@ typedef struct {
int poly1305_init(poly1305_state *st, const unsigned char *key, unsigned long keylen);
int poly1305_process(poly1305_state *st, const unsigned char *in, unsigned long inlen);
int poly1305_done(poly1305_state *st, unsigned char *mac, unsigned long *maclen);
-int poly1305_test(void);
int poly1305_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen);
int poly1305_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...);
int poly1305_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen);
@@ -130,7 +129,6 @@ typedef hash_state blake2smac_state;
int blake2smac_init(blake2smac_state *st, unsigned long outlen, const unsigned char *key, unsigned long keylen);
int blake2smac_process(blake2smac_state *st, const unsigned char *in, unsigned long inlen);
int blake2smac_done(blake2smac_state *st, unsigned char *mac, unsigned long *maclen);
-int blake2smac_test(void);
int blake2smac_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen);
int blake2smac_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...);
int blake2smac_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen);
@@ -142,7 +140,6 @@ typedef hash_state blake2bmac_state;
int blake2bmac_init(blake2bmac_state *st, unsigned long outlen, const unsigned char *key, unsigned long keylen);
int blake2bmac_process(blake2bmac_state *st, const unsigned char *in, unsigned long inlen);
int blake2bmac_done(blake2bmac_state *st, unsigned char *mac, unsigned long *maclen);
-int blake2bmac_test(void);
int blake2bmac_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen);
int blake2bmac_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...);
int blake2bmac_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen);
@@ -266,12 +263,14 @@ typedef struct {
symmetric_key key; /* scheduled key for cipher */
unsigned long block_index; /* index # for current data block */
int cipher, /* cipher idx */
+ tag_len, /* length of tag */
block_len; /* length of block */
} ocb3_state;
int ocb3_init(ocb3_state *ocb, int cipher,
const unsigned char *key, unsigned long keylen,
- const unsigned char *nonce, unsigned long noncelen);
+ const unsigned char *nonce, unsigned long noncelen,
+ unsigned long taglen);
int ocb3_encrypt(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char *ct);
int ocb3_decrypt(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen, unsigned char *pt);
@@ -301,8 +300,6 @@ int ocb3_test(void);
#ifdef LTC_SOURCE
/* internal helper functions */
-int ocb3_int_aad_add_block(ocb3_state *ocb, const unsigned char *aad_block);
-void ocb3_int_calc_offset_zero(ocb3_state *ocb, const unsigned char *nonce, unsigned long noncelen);
int ocb3_int_ntz(unsigned long x);
void ocb3_int_xor_blocks(unsigned char *out, const unsigned char *block_a, const unsigned char *block_b, unsigned long block_len);
#endif /* LTC_SOURCE */
@@ -311,8 +308,8 @@ void ocb3_int_xor_blocks(unsigned char *out, const unsigned char *block_a, const
#ifdef LTC_CCM_MODE
-#define CCM_ENCRYPT 0
-#define CCM_DECRYPT 1
+#define CCM_ENCRYPT LTC_ENCRYPT
+#define CCM_DECRYPT LTC_DECRYPT
typedef struct {
symmetric_key K;
@@ -378,8 +375,8 @@ extern const unsigned char gcm_shift_table[];
#ifdef LTC_GCM_MODE
-#define GCM_ENCRYPT 0
-#define GCM_DECRYPT 1
+#define GCM_ENCRYPT LTC_ENCRYPT
+#define GCM_DECRYPT LTC_DECRYPT
#define LTC_GCM_MODE_IV 0
#define LTC_GCM_MODE_AAD 1
@@ -542,8 +539,8 @@ typedef struct {
int aadflg;
} chacha20poly1305_state;
-#define CHCHA20POLY1305_ENCRYPT 0
-#define CHCHA20POLY1305_DECRYPT 1
+#define CHACHA20POLY1305_ENCRYPT LTC_ENCRYPT
+#define CHACHA20POLY1305_DECRYPT LTC_DECRYPT
int chacha20poly1305_init(chacha20poly1305_state *st, const unsigned char *key, unsigned long keylen);
int chacha20poly1305_setiv(chacha20poly1305_state *st, const unsigned char *iv, unsigned long ivlen);
@@ -563,6 +560,6 @@ int chacha20poly1305_test(void);
#endif /* LTC_CHACHA20POLY1305_MODE */
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_macros.h b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_macros.h
index 240493f3afe..4bd041f1840 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_macros.h
+++ b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_macros.h
@@ -441,6 +441,6 @@ static inline ulong64 ROR64(ulong64 word, int i)
#define snprintf _snprintf
#endif
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_math.h b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_math.h
index fd7534d5de8..a9265965076 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_math.h
+++ b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_math.h
@@ -26,16 +26,17 @@
#ifndef LTC_MILLER_RABIN_REPS
/* Number of rounds of the Miller-Rabin test
- * "Reasonable values of reps are between 15 and 50." c.f. gmp doc of mpz_probab_prime_p() */
- #define LTC_MILLER_RABIN_REPS 35
+ * "Reasonable values of reps are between 15 and 50." c.f. gmp doc of mpz_probab_prime_p()
+ * As of https://security.stackexchange.com/a/4546 we should use 40 rounds */
+ #define LTC_MILLER_RABIN_REPS 40
#endif
-int radix_to_bin(const void *in, int radix, void *out, size_t* len);
+int radix_to_bin(const void *in, int radix, void *out, unsigned long *len);
/** math descriptor */
typedef struct {
/** Name of the math provider */
- char *name;
+ const char *name;
/** Bits per digit, amount of bits must fit in an unsigned long */
int bits_per_digit;
@@ -577,6 +578,6 @@ extern const ltc_math_descriptor gmp_desc;
#endif
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_misc.h b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_misc.h
index cb863289213..9cc45c3d2e2 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_misc.h
+++ b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_misc.h
@@ -78,11 +78,9 @@ void init_LTM(void);
#ifdef TFM_DESC
void init_TFM(void);
#endif
-/* *** use of GMP is untested ***
#ifdef GMP_DESC
void init_GMP(void);
#endif
-*/
#ifdef LTC_ADLER32
typedef struct adler32_state_s
@@ -110,6 +108,6 @@ int crc32_test(void);
int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which);
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_pk.h b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_pk.h
index a9139df4715..e87caab20e5 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_pk.h
+++ b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_pk.h
@@ -17,9 +17,6 @@ enum {
/* Indicates standard output formats that can be read e.g. by OpenSSL or GnuTLS */
#define PK_STD 0x1000
-/* iterations limit for retry-loops */
-#define PK_MAX_RETRIES 20
-
int rand_prime(void *N, long len, prng_state *prng, int wprng);
#ifdef LTC_SOURCE
@@ -34,7 +31,7 @@ enum public_key_algorithms {
typedef struct Oid {
unsigned long OID[16];
- /** Length of DER encoding */
+ /** Number of OID digits in use */
unsigned long OIDlen;
} oid_st;
@@ -199,13 +196,6 @@ int katja_import(const unsigned char *in, unsigned long inlen, katja_key *key);
#ifdef LTC_MDH
typedef struct {
- int size;
- char *name, *base, *prime;
-} ltc_dh_set_type;
-
-extern const ltc_dh_set_type ltc_dh_sets[];
-
-typedef struct {
int type;
void *x;
void *y;
@@ -235,6 +225,13 @@ void dh_free(dh_key *key);
int dh_export_key(void *out, unsigned long *outlen, int type, dh_key *key);
#ifdef LTC_SOURCE
+typedef struct {
+ int size;
+ const char *name, *base, *prime;
+} ltc_dh_set_type;
+
+extern const ltc_dh_set_type ltc_dh_sets[];
+
/* internal helper functions */
int dh_check_pubkey(dh_key *key);
#endif
@@ -257,22 +254,22 @@ typedef struct {
int size;
/** name of curve */
- char *name;
+ const char *name;
/** The prime that defines the field the curve is in (encoded in hex) */
- char *prime;
+ const char *prime;
/** The fields B param (hex) */
- char *B;
+ const char *B;
/** The order of the curve (hex) */
- char *order;
+ const char *order;
/** The x co-ordinate of the base point on the curve (hex) */
- char *Gx;
+ const char *Gx;
/** The y co-ordinate of the base point on the curve (hex) */
- char *Gy;
+ const char *Gy;
} ltc_ecc_set_type;
/** A point on a ECC curve, stored in Jacbobian format such that (x,y,z) => (x/z^2, y/z^3, 1) when interpretted as affine */
@@ -479,7 +476,12 @@ int dsa_decrypt_key(const unsigned char *in, unsigned long inlen,
int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key);
int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key);
int dsa_verify_key(dsa_key *key, int *stat);
-
+#ifdef LTC_SOURCE
+/* internal helper functions */
+int dsa_int_validate_xy(dsa_key *key, int *stat);
+int dsa_int_validate_pqg(dsa_key *key, int *stat);
+int dsa_int_validate_primes(dsa_key *key, int *stat);
+#endif
int dsa_shared_secret(void *private_key, void *base,
dsa_key *public_key,
unsigned char *out, unsigned long *outlen);
@@ -740,6 +742,6 @@ int der_length_generalizedtime(ltc_generalizedtime *gtime, unsigned long *outlen
#endif
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_pkcs.h b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_pkcs.h
index f24cb03e7de..5bbf7195403 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_pkcs.h
+++ b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_pkcs.h
@@ -80,13 +80,13 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen,
/* ===> PKCS #5 -- Password Based Cryptography <=== */
#ifdef LTC_PKCS_5
-/* Algorithm #1 (old) */
+/* Algorithm #1 (PBKDF1) */
int pkcs_5_alg1(const unsigned char *password, unsigned long password_len,
const unsigned char *salt,
int iteration_count, int hash_idx,
unsigned char *out, unsigned long *outlen);
-/* Algorithm #1 - OpenSSL-compatible variant for arbitrarily-long keys.
+/* Algorithm #1 (PBKDF1) - OpenSSL-compatible variant for arbitrarily-long keys.
Compatible with EVP_BytesToKey() */
int pkcs_5_alg1_openssl(const unsigned char *password,
unsigned long password_len,
@@ -94,7 +94,7 @@ int pkcs_5_alg1_openssl(const unsigned char *password,
int iteration_count, int hash_idx,
unsigned char *out, unsigned long *outlen);
-/* Algorithm #2 (new) */
+/* Algorithm #2 (PBKDF2) */
int pkcs_5_alg2(const unsigned char *password, unsigned long password_len,
const unsigned char *salt, unsigned long salt_len,
int iteration_count, int hash_idx,
@@ -103,6 +103,6 @@ int pkcs_5_alg2(const unsigned char *password, unsigned long password_len,
int pkcs_5_test (void);
#endif /* LTC_PKCS_5 */
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_prng.h b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_prng.h
index 737f42461c6..78ce95c08c7 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/headers/tomcrypt_prng.h
+++ b/src/third_party/tomcrypt-1.18.1/src/headers/tomcrypt_prng.h
@@ -81,7 +81,7 @@ typedef struct {
/** PRNG descriptor */
extern struct ltc_prng_descriptor {
/** Name of the PRNG */
- char *name;
+ const char *name;
/** size in bytes of exported state */
int export_size;
/** Start a PRNG state
@@ -227,6 +227,6 @@ extern unsigned long (*ltc_rng)(unsigned char *out, unsigned long outlen,
#endif
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/mac/hmac/hmac_done.c b/src/third_party/tomcrypt-1.18.1/src/mac/hmac/hmac_done.c
index a836b89a893..8249d89d39f 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/mac/hmac/hmac_done.c
+++ b/src/third_party/tomcrypt-1.18.1/src/mac/hmac/hmac_done.c
@@ -102,6 +102,6 @@ LBL_ERR:
#endif
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/mac/hmac/hmac_init.c b/src/third_party/tomcrypt-1.18.1/src/mac/hmac/hmac_init.c
index 699ae18e038..1a414fd8bd3 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/mac/hmac/hmac_init.c
+++ b/src/third_party/tomcrypt-1.18.1/src/mac/hmac/hmac_init.c
@@ -75,7 +75,7 @@ int hmac_init(hmac_state *hmac, int hash, const unsigned char *key, unsigned lon
zeromem((hmac->key) + keylen, (size_t)(LTC_HMAC_BLOCKSIZE - keylen));
}
- /* Create the initial vector for step (3) */
+ /* Create the initialization vector for step (3) */
for(i=0; i < LTC_HMAC_BLOCKSIZE; i++) {
buf[i] = hmac->key[i] ^ 0x36;
}
@@ -103,6 +103,6 @@ done:
#endif
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/mac/hmac/hmac_memory.c b/src/third_party/tomcrypt-1.18.1/src/mac/hmac/hmac_memory.c
index 8b080e18587..b98109cd51a 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/mac/hmac/hmac_memory.c
+++ b/src/third_party/tomcrypt-1.18.1/src/mac/hmac/hmac_memory.c
@@ -81,6 +81,6 @@ LBL_ERR:
#endif
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/mac/hmac/hmac_process.c b/src/third_party/tomcrypt-1.18.1/src/mac/hmac/hmac_process.c
index 0260fd7bf1b..61dc8745ef5 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/mac/hmac/hmac_process.c
+++ b/src/third_party/tomcrypt-1.18.1/src/mac/hmac/hmac_process.c
@@ -36,6 +36,6 @@ int hmac_process(hmac_state *hmac, const unsigned char *in, unsigned long inlen)
#endif
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/misc/compare_testvector.c b/src/third_party/tomcrypt-1.18.1/src/misc/compare_testvector.c
index 112afb29ce0..80d13757868 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/misc/compare_testvector.c
+++ b/src/third_party/tomcrypt-1.18.1/src/misc/compare_testvector.c
@@ -82,6 +82,6 @@ int compare_testvector(const void* is, const unsigned long is_len, const void* s
return res;
}
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/misc/crypt/crypt_argchk.c b/src/third_party/tomcrypt-1.18.1/src/misc/crypt/crypt_argchk.c
index 2a821e468c9..c6a860345db 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/misc/crypt/crypt_argchk.c
+++ b/src/third_party/tomcrypt-1.18.1/src/misc/crypt/crypt_argchk.c
@@ -14,7 +14,7 @@
*/
#if (ARGTYPE == 0)
-void crypt_argchk(char *v, char *s, int d)
+void crypt_argchk(const char *v, const char *s, int d)
{
fprintf(stderr, "LTC_ARGCHK '%s' failure on line %d of file %s\n",
v, d, s);
@@ -22,6 +22,6 @@ void crypt_argchk(char *v, char *s, int d)
}
#endif
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/misc/crypt/crypt_find_hash.c b/src/third_party/tomcrypt-1.18.1/src/misc/crypt/crypt_find_hash.c
index edc22d8779c..2fd30cef229 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/misc/crypt/crypt_find_hash.c
+++ b/src/third_party/tomcrypt-1.18.1/src/misc/crypt/crypt_find_hash.c
@@ -33,6 +33,6 @@ int find_hash(const char *name)
return -1;
}
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/misc/crypt/crypt_hash_descriptor.c b/src/third_party/tomcrypt-1.18.1/src/misc/crypt/crypt_hash_descriptor.c
index ab69e9a6e4b..204ab54612f 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/misc/crypt/crypt_hash_descriptor.c
+++ b/src/third_party/tomcrypt-1.18.1/src/misc/crypt/crypt_hash_descriptor.c
@@ -20,6 +20,6 @@ struct ltc_hash_descriptor hash_descriptor[TAB_SIZE] = {
LTC_MUTEX_GLOBAL(ltc_hash_mutex)
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/misc/crypt/crypt_hash_is_valid.c b/src/third_party/tomcrypt-1.18.1/src/misc/crypt/crypt_hash_is_valid.c
index 1696537e50d..a101b6b4155 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/misc/crypt/crypt_hash_is_valid.c
+++ b/src/third_party/tomcrypt-1.18.1/src/misc/crypt/crypt_hash_is_valid.c
@@ -29,6 +29,6 @@ int hash_is_valid(int idx)
return CRYPT_OK;
}
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/misc/crypt/crypt_register_hash.c b/src/third_party/tomcrypt-1.18.1/src/misc/crypt/crypt_register_hash.c
index 0892a8d892f..100d5227278 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/misc/crypt/crypt_register_hash.c
+++ b/src/third_party/tomcrypt-1.18.1/src/misc/crypt/crypt_register_hash.c
@@ -47,6 +47,6 @@ int register_hash(const struct ltc_hash_descriptor *hash)
return -1;
}
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */
diff --git a/src/third_party/tomcrypt-1.18.0-rc2/src/misc/zeromem.c b/src/third_party/tomcrypt-1.18.1/src/misc/zeromem.c
index a421309d786..cd3ae68db75 100644
--- a/src/third_party/tomcrypt-1.18.0-rc2/src/misc/zeromem.c
+++ b/src/third_party/tomcrypt-1.18.1/src/misc/zeromem.c
@@ -27,6 +27,6 @@ void zeromem(volatile void *out, size_t outlen)
}
}
-/* ref: HEAD -> release/1.18.0, tag: v1.18.0-rc2 */
-/* git commit: aa0f396c0c8828ce39456129507fc72ef0208bd0 */
-/* commit time: 2017-07-13 14:58:01 +0200 */
+/* ref: HEAD -> master, tag: v1.18.1 */
+/* git commit: e08fd8630f9d9771226466877064055ee7e863d0 */
+/* commit time: 2018-01-22 11:02:57 +0100 */