From 24588c907a994fa67e6e5ed5448d48ea6a028e34 Mon Sep 17 00:00:00 2001 From: iddo Date: Sun, 18 Nov 2018 14:43:11 -0500 Subject: [PATCH] added win vs17 proj --- algebra/FFT/FFT.vcxproj | 124 +++++++++ algebra/FFT/src/Definitions.h | 8 + algebra/FFT/src/Element.cpp | 4 +- algebra/FFT/src/FFT.cpp | 6 +- algebra/algebralib/algebraLib.vcxproj | 197 ++++++++++++++ customCode.sln | 46 ++++ libstark/customSTARK.vcxproj | 240 ++++++++++++++++++ libstark/src/common/Utils/ErrorHandling.cpp | 2 + libstark/src/common/Utils/specsPrint.cpp | 1 + libstark/src/protocols/Ali/prover.cpp | 12 +- libstark/src/protocols/Fri/prover.cpp | 2 +- .../CryptoCommitment/MerkleCommitment.cpp | 8 +- libstark/src/protocols/common/proofs.cpp | 2 +- .../src/reductions/BairToAcsp/BairToAcsp.cpp | 2 +- 14 files changed, 636 insertions(+), 18 deletions(-) create mode 100644 algebra/FFT/FFT.vcxproj create mode 100644 algebra/algebralib/algebraLib.vcxproj create mode 100644 customCode.sln create mode 100644 libstark/customSTARK.vcxproj diff --git a/algebra/FFT/FFT.vcxproj b/algebra/FFT/FFT.vcxproj new file mode 100644 index 0000000..75babb9 --- /dev/null +++ b/algebra/FFT/FFT.vcxproj @@ -0,0 +1,124 @@ + + + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + + + + + + {6437B53C-7A17-472F-99AC-412FFCC147CD} + Win32Proj + FFT + 10.0.17134.0 + + + + StaticLibrary + true + v141 + Unicode + + + StaticLibrary + false + v141 + true + Unicode + + + + + + + + + + + + $(SolutionDir)\algebra\$(ProjectName)\$(Configuration)\$(Platform) + $(SolutionDir)\algebra\$(ProjectName)\$(Configuration)\$(Platform)\build\ + + + $(SolutionDir)\algebra\$(ProjectName)\$(Configuration)\$(Platform) + $(SolutionDir)\algebra\$(ProjectName)\$(Configuration)\$(Platform)\build\ + + + + NotUsing + Level3 + Disabled + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + %(AdditionalIncludeDirectories);$(CudaToolkitIncludeDir) + true + /D SCIPR_NUM_THREADS=1 %(AdditionalOptions) + + + Windows + true + + + MTd + compute_30,sm_30;compute_35,sm_35;compute_37,sm_37;compute_50,sm_50; + 64 + WIN32 + + + MachineX64 + + + + + Level3 + NotUsing + MaxSpeed + true + true + OLD_OPENMP;WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_LIB;SCIPR_NUM_THREADS=16;%(PreprocessorDefinitions) + true + MultiThreaded + %(AdditionalIncludeDirectories);$(CudaToolkitIncludeDir) + true + + + Windows + true + true + true + + + 64 + WIN32 + compute_30,sm_30;compute_35,sm_35;compute_37,sm_37;compute_50,sm_50; + + + + + diff --git a/algebra/FFT/src/Definitions.h b/algebra/FFT/src/Definitions.h index 824f8a1..6d2bb74 100644 --- a/algebra/FFT/src/Definitions.h +++ b/algebra/FFT/src/Definitions.h @@ -12,6 +12,14 @@ //#define __GPU //#define __MEASURE +#ifdef OLD_OPENMP +typedef long long plooplongtype; +typedef int ploopinttype; +#else +typedef unsigned long long plooplongtype; +typedef unsigned int ploopinttype; +#endif + namespace FFF { /**** typedef *****/ diff --git a/algebra/FFT/src/Element.cpp b/algebra/FFT/src/Element.cpp index 1a4b5cb..d1fd190 100644 --- a/algebra/FFT/src/Element.cpp +++ b/algebra/FFT/src/Element.cpp @@ -9,8 +9,8 @@ */ #ifdef WIN32 -//#include -#include +#include +//#include #endif // #ifdef WIN32 #ifdef __GNUC__ #include diff --git a/algebra/FFT/src/FFT.cpp b/algebra/FFT/src/FFT.cpp index b6db49f..c2aac97 100644 --- a/algebra/FFT/src/FFT.cpp +++ b/algebra/FFT/src/FFT.cpp @@ -470,7 +470,7 @@ void FFT::AlgIFFT(Element* P){ const size_t step = 1UL << (size - min_log_general_level); const size_t bound = 1UL< size-1){ #pragma omp parallel for schedule(static,(1UL<<(size-1))/omp_max_threads)//MAX - for (unsigned long long i = 1; i <= (1UL << size); i += 2){ + for (plooplongtype i = 1; i <= (1UL << size); i += 2){ Element::c_mulXor(P[i],lastShift,P[i-1]); Element::c_mul(P[i],lastD,P[i]); Element::c_add(P[i],P[i-1],P[i]); diff --git a/algebra/algebralib/algebraLib.vcxproj b/algebra/algebralib/algebraLib.vcxproj new file mode 100644 index 0000000..9a0075e --- /dev/null +++ b/algebra/algebralib/algebraLib.vcxproj @@ -0,0 +1,197 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {05E67B97-D96F-4015-ACB2-9D0BFF3D6C89} + Win32Proj + algebraLib + 10.0.17134.0 + + + + StaticLibrary + true + v141 + Unicode + + + StaticLibrary + true + v141 + Unicode + + + StaticLibrary + false + v141 + true + Unicode + + + StaticLibrary + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + $(VC_IncludePath)\headers;$(WindowsSDK_IncludePath); + $(VC_SourcePath)\src;$(VC_SourcePath)\tests; + + + $(VC_IncludePath);$(WindowsSDK_IncludePath) + $(VC_SourcePath)\src;$(VC_SourcePath)\tests; + $(SolutionDir)\algebra\$(ProjectName)\$(Configuration)\$(Platform)\ + $(SolutionDir)\algebra\$(ProjectName)\$(Configuration)\$(Platform)\build\ + + + $(SolutionDir)\algebra\$(ProjectName)\$(Configuration)\$(Platform)\ + $(SolutionDir)\algebra\$(ProjectName)\$(Configuration)\$(Platform)\build\ + + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + + + Windows + true + + + + + + + Level3 + Disabled + _MBCS;%(PreprocessorDefinitions);SCIPR_NUM_THREADS=1 + $(SolutionDir)\algebra\FFT\src;$(ProjectDir)\headers;%(AdditionalIncludeDirectories) + true + EnableFastChecks + MultiThreadedDebug + + + Windows + true + + + + + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;SCIPR_NUM_THREADS=16;%(PreprocessorDefinitions) + C:\Program Files (x86)\Visual Leak Detector\include;$(SolutionDir)\algebra\FFT\src;$(ProjectDir)\headers;%(AdditionalIncludeDirectories) + MultiThreaded + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/customCode.sln b/customCode.sln new file mode 100644 index 0000000..5cf510c --- /dev/null +++ b/customCode.sln @@ -0,0 +1,46 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stark", "libstark\customSTARK.vcxproj", "{8EC88E78-D700-4E10-9235-696A6C435DD4}" + ProjectSection(ProjectDependencies) = postProject + {6437B53C-7A17-472F-99AC-412FFCC147CD} = {6437B53C-7A17-472F-99AC-412FFCC147CD} + {05E67B97-D96F-4015-ACB2-9D0BFF3D6C89} = {05E67B97-D96F-4015-ACB2-9D0BFF3D6C89} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "algebraLib", "algebra/algebraLib\algebraLib.vcxproj", "{05E67B97-D96F-4015-ACB2-9D0BFF3D6C89}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FFT", "algebra/FFT\FFT.vcxproj", "{6437B53C-7A17-472F-99AC-412FFCC147CD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8EC88E78-D700-4E10-9235-696A6C435DD4}.Debug|Win32.ActiveCfg = Debug|x64 + {8EC88E78-D700-4E10-9235-696A6C435DD4}.Debug|x64.ActiveCfg = Debug|x64 + {8EC88E78-D700-4E10-9235-696A6C435DD4}.Debug|x64.Build.0 = Debug|x64 + {8EC88E78-D700-4E10-9235-696A6C435DD4}.Release|Win32.ActiveCfg = Release|x64 + {8EC88E78-D700-4E10-9235-696A6C435DD4}.Release|x64.ActiveCfg = Release|x64 + {8EC88E78-D700-4E10-9235-696A6C435DD4}.Release|x64.Build.0 = Release|x64 + {05E67B97-D96F-4015-ACB2-9D0BFF3D6C89}.Debug|Win32.ActiveCfg = Debug|Win32 + {05E67B97-D96F-4015-ACB2-9D0BFF3D6C89}.Debug|x64.ActiveCfg = Debug|x64 + {05E67B97-D96F-4015-ACB2-9D0BFF3D6C89}.Debug|x64.Build.0 = Debug|x64 + {05E67B97-D96F-4015-ACB2-9D0BFF3D6C89}.Release|Win32.ActiveCfg = Release|Win32 + {05E67B97-D96F-4015-ACB2-9D0BFF3D6C89}.Release|x64.ActiveCfg = Release|x64 + {05E67B97-D96F-4015-ACB2-9D0BFF3D6C89}.Release|x64.Build.0 = Release|x64 + {6437B53C-7A17-472F-99AC-412FFCC147CD}.Debug|Win32.ActiveCfg = Debug|x64 + {6437B53C-7A17-472F-99AC-412FFCC147CD}.Debug|x64.ActiveCfg = Debug|x64 + {6437B53C-7A17-472F-99AC-412FFCC147CD}.Debug|x64.Build.0 = Debug|x64 + {6437B53C-7A17-472F-99AC-412FFCC147CD}.Release|Win32.ActiveCfg = Release|x64 + {6437B53C-7A17-472F-99AC-412FFCC147CD}.Release|x64.ActiveCfg = Release|x64 + {6437B53C-7A17-472F-99AC-412FFCC147CD}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libstark/customSTARK.vcxproj b/libstark/customSTARK.vcxproj new file mode 100644 index 0000000..7c54835 --- /dev/null +++ b/libstark/customSTARK.vcxproj @@ -0,0 +1,240 @@ + + + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {8EC88E78-D700-4E10-9235-696A6C435DD4} + stark + stark + 10.0.17134.0 + + + + v141 + + + v141 + + + + + + + $(SolutionDir)\libstark\src;$(IncludePath) + stark + $(SolutionDir)\libstark\$(Configuration)\$(Platform)\ + $(SolutionDir)\libstark\$(Configuration)\$(Platform)\build\ + false + + + $(SolutionDir)\libstark\src;$(IncludePath) + $(SolutionDir)\libstark\$(Configuration)\$(Platform)\ + $(SolutionDir)\libstark\$(Configuration)\$(Platform)\build\ + stark + + + + $(SolutionDir)\algebra\FFT\src;$(SolutionDir)\libstark\src;%(AdditionalIncludeDirectories);$(SolutionDir)\algebra\algebraLib\headers + + + + + Level3 + MaxSpeed + true + true + MultiThreaded + true + OLD_OPENMP;WIN32;_CRT_SECURE_NO_WARNINGS;LEGACY_PRINT_INSTRUCTION_SUPPORT;SCIPR_NUM_THREADS=16;%(PreprocessorDefinitions) + /D _VARIADIC_MAX=10 %(AdditionalOptions) + $(IntDir)/%(RelativeDir)/ + + + $(SolutionDir)\algebra\FFT\$(Configuration)\$(Platform);%(AdditionalLibraryDirectories);$(Configuration)\$(Platform);$(SolutionDir)\algebra\algebraLib\$(Configuration)\$(Platform) + %(AdditionalDependencies);FFT.lib;algebraLib.lib + true + + + true + true + + + + + + + + + + + + + $(SolutionDir)\algebra\FFT\src;$(SolutionDir)\libstark\src;%(AdditionalIncludeDirectories);$(SolutionDir)\algebra\algebraLib\headers + Level3 + true + Disabled + true + MultiThreadedDebug + NotUsing + LEGACY_PRINT_INSTRUCTION_SUPPORT;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + /D _VARIADIC_MAX=10 /D SCIPR_NUM_THREADS=1 %(AdditionalOptions) + false + $(IntDir)/%(RelativeDir)/ + + + $(SolutionDir)\algebra\FFT\$(Configuration)\$(Platform);%(AdditionalLibraryDirectories);$(Configuration)\$(Platform);$(SolutionDir)\algebra\algebraLib\$(Configuration)\$(Platform) + %(AdditionalDependencies);FFT.lib;algebraLib.lib + true + + + + + + + + + + + false + false + + + false + + + + + + diff --git a/libstark/src/common/Utils/ErrorHandling.cpp b/libstark/src/common/Utils/ErrorHandling.cpp index bce77a5..2309e0f 100644 --- a/libstark/src/common/Utils/ErrorHandling.cpp +++ b/libstark/src/common/Utils/ErrorHandling.cpp @@ -9,7 +9,9 @@ */ /************************************************************************************************************/ #include +#ifndef WIN32 #include +#endif #include "ErrorHandling.hpp" using namespace std; diff --git a/libstark/src/common/Utils/specsPrint.cpp b/libstark/src/common/Utils/specsPrint.cpp index d226853..cd39729 100644 --- a/libstark/src/common/Utils/specsPrint.cpp +++ b/libstark/src/common/Utils/specsPrint.cpp @@ -1,6 +1,7 @@ #include "specsPrint.hpp" #include #include +#include namespace libstark{ diff --git a/libstark/src/protocols/Ali/prover.cpp b/libstark/src/protocols/Ali/prover.cpp index dcd5dca..3ad239f 100644 --- a/libstark/src/protocols/Ali/prover.cpp +++ b/libstark/src/protocols/Ali/prover.cpp @@ -55,7 +55,7 @@ namespace{ const size_t witnessPow2Deg = POW2(witnessDegLog); #pragma omp parallel for - for(unsigned int wIndex = 0; wIndex < numOfWitnesses; wIndex++){ + for(ploopinttype wIndex = 0; wIndex < numOfWitnesses; wIndex++){ const Algebra::UnivariatePolynomialInterface& witnessPoly = *(acspWitness.assignmentPolys()[wIndex]); @@ -96,7 +96,7 @@ namespace{ void initWitness_ZkMask_coeffs(FieldElement* res, const size_t numCoeffs){ #pragma omp parallel for - for(unsigned long long i =0; i< numCoeffs; i++){ + for(plooplongtype i =0; i< numCoeffs; i++){ res[i] = Algebra::generateRandom(); } } @@ -254,7 +254,7 @@ namespace{ } else{ #pragma omp parallel for - for(unsigned long long shiftIdx=0; shiftIdx < numCosetsInParallel; shiftIdx++){ + for(plooplongtype shiftIdx=0; shiftIdx < numCosetsInParallel; shiftIdx++){ FieldElement* currCoset = &cosetEval[shiftIdx*cosetSize*width]; //evaluate @@ -459,7 +459,7 @@ namespace{ const size_t blockLen = POW2(logBlockLen); const size_t numBlocks = POW2(cosetBasis.size() - logBlockLen); #pragma omp parallel for - for (unsigned long long blockIdx =0; blockIdx < numBlocks; blockIdx++){ + for (plooplongtype blockIdx =0; blockIdx < numBlocks; blockIdx++){ for (unsigned long long inBlockIdx = 0; inBlockIdx < blockLen; inBlockIdx++){ const size_t xIdx = blockIdx*blockLen + inBlockIdx; @@ -514,7 +514,7 @@ namespace{ vector evaluation = compositionPolysEvaluation(acspInstance,acspWitness, basisPCPP.basis, basisPCPP.shift, *uniEvals.boundaryPolysMatrix, entireWitnessKept, numZkMasks); #pragma omp parallel for - for (unsigned long long xIdx = 0; xIdx < spaceSize; xIdx++){ + for (plooplongtype xIdx = 0; xIdx < spaceSize; xIdx++){ //the ZK mask poly evaluation[xIdx] *= randCoeffs.ZK_mask_composition[rsCombId].coeffUnshifted[0]; @@ -681,7 +681,7 @@ namespace{ } else{ #pragma omp parallel for - for(unsigned long long i=0; ianswerQueries(*currQ.rawQueries); diff --git a/libstark/src/protocols/common/CryptoCommitment/MerkleCommitment.cpp b/libstark/src/protocols/common/CryptoCommitment/MerkleCommitment.cpp index 30266b3..3c22b2e 100644 --- a/libstark/src/protocols/common/CryptoCommitment/MerkleCommitment.cpp +++ b/libstark/src/protocols/common/CryptoCommitment/MerkleCommitment.cpp @@ -172,7 +172,7 @@ hashDigest_t constructMerkleTree(void const* const src, const short src_logLen, hashDigest_t* curr_dst = ((hashDigest_t*)dst) + (1UL< getPathToBlocksInPlace(void * dataInp, const short src_logLen, co //construct next layer #pragma omp parallel for - for(unsigned long long i=0; i compositionAlg(const AcspInstance& instance, const AcspWitn } #pragma omp parallel for schedule(guided) - for(unsigned long long i=0; i< wDegBound; i++){ + for(plooplongtype i=0; i< wDegBound; i++){ const long currLocation = i + (currOffset<