rsaenh: Make some data const and static
Dmitry Timoshkov
dmitry at codeweavers.com
Thu Dec 14 08:47:41 CST 2006
Hello,
Changelog:
rsaenh: Make some data const and static.
---
dlls/rsaenh/mpi.c | 19 ++++++++-----------
dlls/rsaenh/rsaenh.c | 4 ++--
dlls/rsaenh/tomcrypt.h | 4 ----
3 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/dlls/rsaenh/mpi.c b/dlls/rsaenh/mpi.c
index b20f0dc..cd7e2f8 100644
--- a/dlls/rsaenh/mpi.c
+++ b/dlls/rsaenh/mpi.c
@@ -31,6 +31,14 @@
#include <stdarg.h>
#include "tomcrypt.h"
+/* Known optimal configurations
+ CPU /Compiler /MUL CUTOFF/SQR CUTOFF
+-------------------------------------------------------------
+ Intel P4 Northwood /GCC v3.4.1 / 88/ 128/LTM 0.32 ;-)
+*/
+static const int KARATSUBA_MUL_CUTOFF = 88, /* Min. number of digits before Karatsuba multiplication is used. */
+ KARATSUBA_SQR_CUTOFF = 128; /* Min. number of digits before Karatsuba squaring is used. */
+
/* computes the modular inverse via binary extended euclidean algorithm,
* that is c = 1/a mod b
*
@@ -4409,14 +4417,3 @@ s_mp_sub (mp_int * a, mp_int * b, mp_int * c)
mp_clamp (c);
return MP_OKAY;
}
-
-/* Known optimal configurations
-
- CPU /Compiler /MUL CUTOFF/SQR CUTOFF
--------------------------------------------------------------
- Intel P4 Northwood /GCC v3.4.1 / 88/ 128/LTM 0.32 ;-)
-
-*/
-
-int KARATSUBA_MUL_CUTOFF = 88, /* Min. number of digits before Karatsuba multiplication is used. */
- KARATSUBA_SQR_CUTOFF = 128; /* Min. number of digits before Karatsuba squaring is used. */
diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c
index a87cb83..b78adc8 100644
--- a/dlls/rsaenh/rsaenh.c
+++ b/dlls/rsaenh/rsaenh.c
@@ -156,7 +156,7 @@ typedef struct tagKEYCONTAINER
*/
#define RSAENH_MAX_ENUMALGS 20
#define RSAENH_PCT1_SSL2_SSL3_TLS1 (CRYPT_FLAG_PCT1|CRYPT_FLAG_SSL2|CRYPT_FLAG_SSL3|CRYPT_FLAG_TLS1)
-PROV_ENUMALGS_EX aProvEnumAlgsEx[4][RSAENH_MAX_ENUMALGS+1] =
+static const PROV_ENUMALGS_EX aProvEnumAlgsEx[4][RSAENH_MAX_ENUMALGS+1] =
{
{
{CALG_RC2, 40, 40, 56,0, 4,"RC2", 24,"RSA Data Security's RC2"},
@@ -395,7 +395,7 @@ static inline BOOL copy_param(
* Failure: NULL (algid not supported)
*/
static inline const PROV_ENUMALGS_EX* get_algid_info(HCRYPTPROV hProv, ALG_ID algid) {
- PROV_ENUMALGS_EX *iterator;
+ const PROV_ENUMALGS_EX *iterator;
KEYCONTAINER *pKeyContainer;
if (!lookup_handle(&handle_table, hProv, RSAENH_MAGIC_CONTAINER, (OBJECTHDR**)&pKeyContainer)) {
diff --git a/dlls/rsaenh/tomcrypt.h b/dlls/rsaenh/tomcrypt.h
index efddd90..b2a2067 100644
--- a/dlls/rsaenh/tomcrypt.h
+++ b/dlls/rsaenh/tomcrypt.h
@@ -204,10 +204,6 @@ typedef ulong64 mp_word;
typedef int mp_err;
-/* you'll have to tune these... */
-extern int KARATSUBA_MUL_CUTOFF,
- KARATSUBA_SQR_CUTOFF;
-
/* define this to use lower memory usage routines (exptmods mostly) */
/* #define MP_LOW_MEM */
--
1.4.4.2
More information about the wine-patches
mailing list