From 1221b5e12aa569bd32bbb202e4417f516452b961 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 2 Dec 2018 21:42:31 +0100 Subject: [PATCH 1/4] fix #131 - msvc warning: result of 32-bit shift implicitly converted to 64 bits --- bn_s_mp_exptmod.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bn_s_mp_exptmod.c b/bn_s_mp_exptmod.c index f84da21..52a6422 100644 --- a/bn_s_mp_exptmod.c +++ b/bn_s_mp_exptmod.c @@ -99,19 +99,19 @@ int s_mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y, i /* compute the value at M[1<<(winsize-1)] by squaring * M[1] (winsize-1) times */ - if ((err = mp_copy(&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) { + if ((err = mp_copy(&M[1], &M[(size_t)1 << (winsize - 1)])) != MP_OKAY) { goto LBL_MU; } for (x = 0; x < (winsize - 1); x++) { /* square it */ - if ((err = mp_sqr(&M[1 << (winsize - 1)], - &M[1 << (winsize - 1)])) != MP_OKAY) { + if ((err = mp_sqr(&M[(size_t)1 << (winsize - 1)], + &M[(size_t)1 << (winsize - 1)])) != MP_OKAY) { goto LBL_MU; } /* reduce modulo P */ - if ((err = redux(&M[1 << (winsize - 1)], P, &mu)) != MP_OKAY) { + if ((err = redux(&M[(size_t)1 << (winsize - 1)], P, &mu)) != MP_OKAY) { goto LBL_MU; } } From 6d56e11b1b1968825d3965d32cc9fb65fd1bb94e Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 3 Dec 2018 12:00:09 +0100 Subject: [PATCH 2/4] more visual studio related items in .gitignore --- .gitignore | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.gitignore b/.gitignore index 20e85c3..d5a7b5b 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,25 @@ mtest.exe # ignore user specific settings *.user *.suo +*.userosscache +*.sln.docstates +*.userprefs +# cache/options directory +.vs/ +# Backup & report files from converting an old project file to a newer Visual Studio version +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +# Visual Studio 6 build log + workspace options file +*.plg +*.opt +# visual studio profiler +*.psess +*.vsp +*.vspx +*.sap + # ignore stuff generated by "make manual" and "make poster" *.aux From 9bac5dd95437478c5aa40a960e422873a7b60c72 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 3 Dec 2018 12:13:27 +0100 Subject: [PATCH 3/4] another msvc warnings: 32-bit shift implicitly converted to 64 bits --- bn_mp_exptmod_fast.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 bn_mp_exptmod_fast.c diff --git a/bn_mp_exptmod_fast.c b/bn_mp_exptmod_fast.c old mode 100644 new mode 100755 index 0d01e38..a63ebd5 --- a/bn_mp_exptmod_fast.c +++ b/bn_mp_exptmod_fast.c @@ -165,15 +165,15 @@ int mp_exptmod_fast(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y } /* compute the value at M[1<<(winsize-1)] by squaring M[1] (winsize-1) times */ - if ((err = mp_copy(&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) { + if ((err = mp_copy(&M[1], &M[(size_t)1 << (winsize - 1)])) != MP_OKAY) { goto LBL_RES; } for (x = 0; x < (winsize - 1); x++) { - if ((err = mp_sqr(&M[1 << (winsize - 1)], &M[1 << (winsize - 1)])) != MP_OKAY) { + if ((err = mp_sqr(&M[(size_t)1 << (winsize - 1)], &M[(size_t)1 << (winsize - 1)])) != MP_OKAY) { goto LBL_RES; } - if ((err = redux(&M[1 << (winsize - 1)], P, mp)) != MP_OKAY) { + if ((err = redux(&M[(size_t)1 << (winsize - 1)], P, mp)) != MP_OKAY) { goto LBL_RES; } } From b28608fc939ddad18ba956b0bdd317d87bbcfc8c Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sat, 8 Dec 2018 11:56:08 +0100 Subject: [PATCH 4/4] make libtommath_VS2008 better upgradable to the newer visual studio --- libtommath_VS2008.sln | 5 ++++- libtommath_VS2008.vcproj | 28 ++++++++-------------------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/libtommath_VS2008.sln b/libtommath_VS2008.sln index c592fe0..6bfc159 100644 --- a/libtommath_VS2008.sln +++ b/libtommath_VS2008.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtommath", "libtommath_VS2008.vcproj", "{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tommath", "libtommath_VS2008.vcproj", "{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -23,4 +23,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {83B84178-7B4F-4B78-9C5D-17B8201D5B61} + EndGlobalSection EndGlobal diff --git a/libtommath_VS2008.vcproj b/libtommath_VS2008.vcproj index 98e2be4..26429c9 100644 --- a/libtommath_VS2008.vcproj +++ b/libtommath_VS2008.vcproj @@ -2,9 +2,9 @@ @@ -36,9 +36,6 @@ - @@ -73,7 +70,7 @@ /> - - @@ -236,7 +227,7 @@ -