Changeset 1445


Ignore:
Timestamp:
May 19, 2010, 5:39:02 PM (12 years ago)
Author:
Sven Rech
Message:

converted msieve to VS2010

Location:
trunk/CrypPlugins/QuadraticSieve
Files:
5 added
4 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/QuadraticSieve/QuadraticSieve.cs

    r1021 r1445  
    6161        private static Type msieve;
    6262        private bool userStopped = false;
     63        private IntPtr factorList;
     64        private ArrayList factors;
    6365
    6466        #endregion
     
    166168                FieldInfo showProgressField = msieveDLL.GetType("Msieve.callback_struct").GetField("showProgress");
    167169                FieldInfo prepareSievingField = msieveDLL.GetType("Msieve.callback_struct").GetField("prepareSieving");
     170                FieldInfo getTrivialFactorlistField = msieveDLL.GetType("Msieve.callback_struct").GetField("getTrivialFactorlist");
    168171                Delegate showProgressDel = MulticastDelegate.CreateDelegate(msieveDLL.GetType("Msieve.showProgressDelegate"), this, "showProgress");
    169172                Delegate prepareSievingDel = MulticastDelegate.CreateDelegate(msieveDLL.GetType("Msieve.prepareSievingDelegate"), this, "prepareSieving");
     173                Delegate getTrivialFactorlistDel = MulticastDelegate.CreateDelegate(msieveDLL.GetType("Msieve.getTrivialFactorlistDelegate"), this, "getTrivialFactorlist");
    170174                showProgressField.SetValue(callback_struct, showProgressDel);
    171175                prepareSievingField.SetValue(callback_struct, prepareSievingDel);
     176                getTrivialFactorlistField.SetValue(callback_struct, getTrivialFactorlistDel);
    172177                initMsieve.Invoke(null, new object[1] { callback_struct });
    173178
    174                 //Now factorize:
    175                 ArrayList factors;
     179                //Now factorize:               
    176180                try
    177181                {
     
    179183                    if (settings.DeleteCache && File.Exists(file))
    180184                        File.Delete(file);
    181                     MethodInfo factorize = msieve.GetMethod("factorize");
    182                     factors = (ArrayList)factorize.Invoke(null, new object[] { InputNumber.ToString(), file });                   
     185                    MethodInfo factorize = msieve.GetMethod("start");
     186                    factorize.Invoke(null, new object[] { InputNumber.ToString(), file });
    183187                    obj = IntPtr.Zero;
    184188                }
     
    371375            if (num_relations == -1)    //sieving finished
    372376            {
     377                showFactorList();
    373378                ProgressChanged(0.9, 1.0);
    374379                GuiLogMessage("Sieving finished", NotificationLevel.Info);
     
    403408                if (!sieving_started)
    404409                {
     410                    showFactorList();
     411
     412                    MethodInfo getCurrentFactor = msieve.GetMethod("getCurrentFactor");
     413                    //GuiLogMessage((String)(getCurrentFactor.Invoke(null, new object[] { conf })), NotificationLevel.Debug);
     414
    405415                    start_relations = num_relations;
    406416                    start_sieving_time = DateTime.Now;
     
    416426                }               
    417427            }
     428        }
     429
     430        private void showFactorList()
     431        {
     432            MethodInfo getPrimeFactors = msieve.GetMethod("getPrimeFactors");
     433            ArrayList fl = (ArrayList)(getPrimeFactors.Invoke(null, new object[] { factorList }));
     434            foreach (Object o in fl)
     435                GuiLogMessage("Prim Faktoren: " + (String)o, NotificationLevel.Debug);
     436
     437            MethodInfo getCompositeFactors = msieve.GetMethod("getCompositeFactors");
     438            ArrayList fl2 = (ArrayList)(getCompositeFactors.Invoke(null, new object[] { factorList }));
     439            foreach (Object o in fl2)
     440                GuiLogMessage("Zusammengesetzte Faktoren: " + (String)o, NotificationLevel.Debug);
    418441        }
    419442
     
    457480        }
    458481
     482        private void getTrivialFactorlist(IntPtr list, IntPtr obj)
     483        {
     484            factorList = list;
     485            MethodInfo getPrimeFactors = msieve.GetMethod("getPrimeFactors");
     486            factors = (ArrayList)(getPrimeFactors.Invoke(null, new object[] { factorList }));
     487            GuiLogMessage("TEST", NotificationLevel.Debug);
     488
     489            //showFactorList();
     490        }
     491
    459492        /// <summary>
    460493        /// Helper Thread for msieve, which sieves for relations:
     
    477510                    collectRelations.Invoke(null, new object[] { clone, update, core_sieve_fcn });
    478511                    MethodInfo getYield = msieve.GetMethod("getYield");
    479                     IntPtr yield = (IntPtr)getYield.Invoke(null, new object[] { clone });                   
     512                    IntPtr yield = (IntPtr)getYield.Invoke(null, new object[] { clone });
     513
     514                    //Just for testing the serialize mechanism:
     515                    MethodInfo serializeYield = msieve.GetMethod("serializeYield");
     516                    byte[] serializedYield = (byte[])serializeYield.Invoke(null, new object[] { yield });
     517                    /*MethodInfo deserializeYield = msieve.GetMethod("deserializeYield");
     518                    yield = (IntPtr)deserializeYield.Invoke(null, new object[] { serializedYield });*/
     519
    480520                    yieldqueue.Enqueue(yield);
    481521                }
  • trunk/CrypPlugins/QuadraticSieve/msieve/build.vc9/WrapperTester/WrapperTester.csproj

    r637 r1445  
    11<?xml version="1.0" encoding="utf-8"?>
    2 <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
     2<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    33  <PropertyGroup>
    44    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     
    1111    <RootNamespace>WrapperTester</RootNamespace>
    1212    <AssemblyName>WrapperTester</AssemblyName>
    13     <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
     13    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    1414    <FileAlignment>512</FileAlignment>
     15    <IsWebBootstrapper>false</IsWebBootstrapper>
     16    <FileUpgradeFlags>
     17    </FileUpgradeFlags>
     18    <OldToolsVersion>3.5</OldToolsVersion>
     19    <UpgradeBackupLocation />
    1520    <PublishUrl>publish\</PublishUrl>
    1621    <Install>true</Install>
     
    2530    <ApplicationRevision>0</ApplicationRevision>
    2631    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
    27     <IsWebBootstrapper>false</IsWebBootstrapper>
    2832    <UseApplicationTrust>false</UseApplicationTrust>
    2933    <BootstrapperEnabled>true</BootstrapperEnabled>
     34    <TargetFrameworkProfile />
    3035  </PropertyGroup>
    3136  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
     
    3641    <PlatformTarget>x86</PlatformTarget>
    3742    <ErrorReport>prompt</ErrorReport>
     43    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
    3844  </PropertyGroup>
    3945  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
     
    4450    <PlatformTarget>x86</PlatformTarget>
    4551    <ErrorReport>prompt</ErrorReport>
     52    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
    4653  </PropertyGroup>
    4754  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
     
    5259    <PlatformTarget>x64</PlatformTarget>
    5360    <ErrorReport>prompt</ErrorReport>
     61    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
    5462  </PropertyGroup>
    5563  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
     
    6068    <PlatformTarget>x64</PlatformTarget>
    6169    <ErrorReport>prompt</ErrorReport>
     70    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
    6271  </PropertyGroup>
    6372  <ItemGroup>
     73    <Reference Include="msieve, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86">
     74      <SpecificVersion>False</SpecificVersion>
     75      <HintPath>..\Win32\Release\msieve.dll</HintPath>
     76    </Reference>
    6477    <Reference Include="System" />
    6578    <Reference Include="System.Core">
     
    8093  </ItemGroup>
    8194  <ItemGroup>
     95    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
     96      <Visible>False</Visible>
     97      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
     98      <Install>false</Install>
     99    </BootstrapperPackage>
    82100    <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
    83101      <Visible>False</Visible>
     
    95113      <Install>true</Install>
    96114    </BootstrapperPackage>
     115    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
     116      <Visible>False</Visible>
     117      <ProductName>.NET Framework 3.5 SP1</ProductName>
     118      <Install>false</Install>
     119    </BootstrapperPackage>
    97120    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
    98121      <Visible>False</Visible>
     
    102125  </ItemGroup>
    103126  <ItemGroup>
    104     <ProjectReference Include="..\msieve.dll\msieve.dll.vcproj">
    105       <Project>{F7C0D05F-193F-49AD-B3E2-D8DFAD41805B}</Project>
    106       <Name>msieve.dll</Name>
    107     </ProjectReference>
     127    <None Include="app.config" />
    108128  </ItemGroup>
    109129  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • trunk/CrypPlugins/QuadraticSieve/msieve/build.vc9/msieve.sln

    r637 r1445  
    11
    2 Microsoft Visual Studio Solution File, Format Version 10.00
    3 # Visual Studio 2008
    4 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common.lib", "common.lib\common.lib.vcproj", "{0A0DE0B6-9A9A-4B77-9F83-AEF871CDAE66}"
     2Microsoft Visual Studio Solution File, Format Version 11.00
     3# Visual Studio 2010
     4Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common.lib", "common.lib\common.lib.vcxproj", "{0A0DE0B6-9A9A-4B77-9F83-AEF871CDAE66}"
    55EndProject
    6 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mpqs.lib", "mpqs.lib\mpqs.lib.vcproj", "{6CD73AB4-04F6-49B3-A45F-65D4F7A078F4}"
    7         ProjectSection(ProjectDependencies) = postProject
    8                 {0A0DE0B6-9A9A-4B77-9F83-AEF871CDAE66} = {0A0DE0B6-9A9A-4B77-9F83-AEF871CDAE66}
    9         EndProjectSection
     6Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mpqs.lib", "mpqs.lib\mpqs.lib.vcxproj", "{6CD73AB4-04F6-49B3-A45F-65D4F7A078F4}"
    107EndProject
    11 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msieve", "msieve\msieve.vcproj", "{89995A7B-6709-40C7-ADDC-806680CE8B64}"
    12         ProjectSection(ProjectDependencies) = postProject
    13                 {6CD73AB4-04F6-49B3-A45F-65D4F7A078F4} = {6CD73AB4-04F6-49B3-A45F-65D4F7A078F4}
    14                 {0A0DE0B6-9A9A-4B77-9F83-AEF871CDAE66} = {0A0DE0B6-9A9A-4B77-9F83-AEF871CDAE66}
    15         EndProjectSection
     8Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msieve", "msieve\msieve.vcxproj", "{89995A7B-6709-40C7-ADDC-806680CE8B64}"
    169EndProject
    17 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msieve.dll", "msieve.dll\msieve.dll.vcproj", "{F7C0D05F-193F-49AD-B3E2-D8DFAD41805B}"
    18         ProjectSection(ProjectDependencies) = postProject
    19                 {89995A7B-6709-40C7-ADDC-806680CE8B64} = {89995A7B-6709-40C7-ADDC-806680CE8B64}
    20                 {6CD73AB4-04F6-49B3-A45F-65D4F7A078F4} = {6CD73AB4-04F6-49B3-A45F-65D4F7A078F4}
    21                 {0A0DE0B6-9A9A-4B77-9F83-AEF871CDAE66} = {0A0DE0B6-9A9A-4B77-9F83-AEF871CDAE66}
    22         EndProjectSection
     10Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msieve.dll", "msieve.dll\msieve.dll.vcxproj", "{F7C0D05F-193F-49AD-B3E2-D8DFAD41805B}"
    2311EndProject
    2412Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WrapperTester", "WrapperTester\WrapperTester.csproj", "{B66944FA-D89F-4BE8-B0BB-6E1FB4419183}"
Note: See TracChangeset for help on using the changeset viewer.