Pārlūkot izejas kodu

update crypt_build_settings et al.

Steffen Jaeckel 8 gadi atpakaļ
vecāks
revīzija
98b500e873

+ 4 - 0
src/headers/tomcrypt_custom.h

@@ -536,6 +536,10 @@
    #error LTC_BLAKE2BMAC requires LTC_BLAKE2B
 #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
+
 /* THREAD management */
 #ifdef LTC_PTHREAD
 

+ 17 - 12
src/misc/crypt/crypt.c

@@ -332,6 +332,23 @@ const char *crypt_build_settings =
     "   Katja\n"
 #endif
 
+    "\nMPI (Math):\n"
+#if defined(LTC_MPI)
+    "   LTC_MPI\n"
+#endif
+#if defined(LTM_DESC)
+    "   LTM_DESC\n"
+#endif
+#if defined(TFM_DESC)
+    "   TFM_DESC\n"
+#endif
+#if defined(GMP_DESC)
+    "   GMP_DESC\n"
+#endif
+#if defined(LTC_MILLER_RABIN_REPS)
+    "   "NAME_VALUE(LTC_MILLER_RABIN_REPS)"\n"
+#endif
+
     "\nCompiler:\n"
 #if defined(_WIN64)
     "   WIN64 platform detected.\n"
@@ -390,9 +407,6 @@ const char *crypt_build_settings =
 #if defined(LTC_HKDF)
     " HKDF "
 #endif
-#if defined(MPI)
-    " MPI "
-#endif
 #if defined(LTC_DEVRANDOM)
     " LTC_DEVRANDOM "
 #endif
@@ -456,15 +470,6 @@ const char *crypt_build_settings =
 #if defined(LTC_PTHREAD)
     " LTC_PTHREAD "
 #endif
-#if defined(LTM_DESC)
-    " LTM_DESC "
-#endif
-#if defined(TFM_DESC)
-    " TFM_DESC "
-#endif
-#if defined(GMP_DESC)
-    " GMP_DESC "
-#endif
 #if defined(LTC_EASY)
     " LTC_EASY "
 #endif

+ 7 - 0
src/misc/crypt/crypt_constants.c

@@ -80,6 +80,13 @@ static const crypt_constant _crypt_constants[] = {
     {"LTC_MDSA", 0},
 #endif
 
+#ifdef LTC_DER_MAX_PUBKEY_SIZE
+    _C_STRINGIFY(LTC_DER_MAX_PUBKEY_SIZE),
+#endif
+#ifdef LTC_MILLER_RABIN_REPS
+    _C_STRINGIFY(LTC_MILLER_RABIN_REPS),
+#endif
+
 #ifdef LTC_CTR_MODE
     {"LTC_CTR_MODE", 1},
     _C_STRINGIFY(CTR_COUNTER_LITTLE_ENDIAN),