Changeset 288 for trunk/CrypPlugins/CLK


Ignore:
Timestamp:
Apr 15, 2009, 8:41:06 PM (13 years ago)
Author:
Sören Rinne
Message:
  • modified CLK so that it starts right at the beginning
  • LFSR now reads polynomials and binary sequences as TapSequence input
  • LFSR runs only one round if binary clock is used
  • cleaned code of XORBinary
Location:
trunk/CrypPlugins/CLK
Files:
2 edited

Legend:

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

    r286 r288  
    107107
    108108    public void Execute()
    109     {       
    110         process(settings.CLKTimeout);
    111         //change picture
    112         if (settings.SetClockToTrue) StatusChanged((int)CLKImage.True);
    113         else StatusChanged((int)CLKImage.False);
     109    {
     110        if (settings.CLKTimeout <= 499)
     111        {
     112            GuiLogMessage("Are you trying to generate bulk output? Please do not use CLK plugin for this purpose. Try setting the number of rounds in the corresponding plugin settings.", NotificationLevel.Warning);
     113        }
     114        else
     115        {
     116            process(settings.CLKTimeout);
     117            //change picture
     118            if (settings.SetClockToTrue) StatusChanged((int)CLKImage.True);
     119            else StatusChanged((int)CLKImage.False);
     120        }
    114121       
    115122    }
     
    117124    private void process(int timeout)
    118125    {
    119        
    120         // Normally, the timer is declared at the class level, so
    121         // that it doesn't go out of scope when the method ends.
    122         // In this example, the timer is needed only while Main
    123         // is executing. However, KeepAlive must be used at the
    124         // end of Main, to prevent the JIT compiler from allowing
    125         // aggressive garbage collection to occur before Main
    126         // ends.
     126        // first fire up an event, then get the timer to handle that for us
     127        OnPropertyChanged("Output");
     128        myRounds--;
    127129
    128130        // Hook up the Elapsed event for the timer.
  • trunk/CrypPlugins/CLK/CLKSettings.cs

    r286 r288  
    1212  {
    1313    # region private variables
    14     private bool hasChanges;
    15     private bool setClockToTrue;
     14    private bool hasChanges = false;
     15    private bool setClockToTrue = true;
    1616    private int clkTimeout = 2000;
    1717    # endregion private variables
     
    3434            this.setClockToTrue = value;
    3535            OnPropertyChanged("SetClockToTrue");
     36            HasChanges = true;
    3637        }
    3738     
     
    6364            this.clkTimeout = value;
    6465            OnPropertyChanged("CLKTimeout");
     66            HasChanges = true;
    6567        }
    6668
     
    7678        set
    7779        {
    78             this.rounds = value;
     80            if (value <= 0) this.rounds = 1;
     81            else this.rounds = value;
    7982            OnPropertyChanged("Rounds");
    8083            HasChanges = true;
Note: See TracChangeset for help on using the changeset viewer.