Changeset 1817


Ignore:
Timestamp:
Aug 17, 2010, 12:40:15 AM (11 years ago)
Author:
Sven Rech
Message:

added Msieve class in CrypPluginBase.
This makes it possible for every plugin to use msieve functionality (i.e. fast factorization).
I will need this for the discrete logarithm plugin.

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPluginBase/CrypPluginBase.csproj

    r1666 r1817  
    137137      <SubType>Code</SubType>
    138138    </Compile>
     139    <Compile Include="Miscellaneous\Msieve.cs" />
    139140    <Compile Include="Miscellaneous\SuperTooltip.cs" />
    140141    <Compile Include="Miscellaneous\Tokenizer.cs" />
  • trunk/CrypPlugins/QuadraticSieve/QuadraticSieve.cs

    r1798 r1817  
    860860        private void initMsieveDLL()
    861861        {
    862             //Load msieve.dll (if necessary):
    863             if (msieve == null || msieveDLL == null)
    864             {
    865                 string s = Directory.GetCurrentDirectory();
    866                 string dllname;
    867                 if (IntPtr.Size == 4)
    868                     dllname = "msieve.dll";
    869                 else
    870                     dllname = "msieve64.dll";
    871 
    872                 msieveDLL = Assembly.LoadFile(DirectoryHelper.BaseDirectory + "\\AppReferences\\" + dllname);
    873                 msieve = msieveDLL.GetType("Msieve.msieve");
    874             }
     862            msieveDLL = Msieve.GetMsieveDLL();
     863            msieve = msieveDLL.GetType("Msieve.msieve");
    875864
    876865            //init msieve with callbacks:
  • trunk/CrypPlugins/QuadraticSieve/msieve/common/driver.c

    r1692 r1817  
    177177                add_next_factor(obj, &n, MSIEVE_PRIME);
    178178                obj->flags |= MSIEVE_FLAG_FACTORIZATION_DONE;
     179                put_trivial_factorlist(&factor_list, obj);
    179180                return;
    180181        }
     
    183184
    184185        factor_list_init(&factor_list);
    185         trial_factor(obj, &n, &reduced_n, &factor_list);
     186        trial_factor(obj, &n, &reduced_n, &factor_list);       
    186187        if (mp_is_one(&reduced_n))
     188        {
     189                put_trivial_factorlist(&factor_list, obj);
    187190                goto clean_up;
     191        }
    188192
    189193        /* save the remaining cofactor of n; if composite,
Note: See TracChangeset for help on using the changeset viewer.