Changeset 599


Ignore:
Timestamp:
Sep 28, 2009, 9:11:43 PM (12 years ago)
Author:
Sören Rinne
Message:
  • added picture in TEA Description.xaml
  • some fine tuning regarding the dynamic inputs
Location:
trunk/CrypPlugins
Files:
3 edited

Legend:

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

    r585 r599  
    4040        private bool output;
    4141        private bool lastInputWasFunction = false;
    42         private int inputs = 0;
     42        private int inputs = 1;
    4343        private string fillValue;
    4444        private bool canSendPropertiesChangedEvent = true;
     
    100100        }
    101101
    102         [PropertyInfo(Direction.InputData, "Function Variable One (i_1.j)", "Input a boolean value to be processed by the function", "", false, true, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
     102        /*[PropertyInfo(Direction.InputData, "Function Variable One (i_1.j)", "Input a boolean value to be processed by the function", "", false, true, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
    103103        public bool[] InputOne
    104104        {
     
    158158                inputThreeFlag = 1;
    159159            }
    160         }
     160        }*/
    161161
    162162        [PropertyInfo(Direction.OutputData, "Function output", "Output after procesing the given function.", "", false, false, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
     
    300300            {
    301301                DicDynamicProperties.Clear();
     302                inputs = 0;
    302303                for (int i = 0; i < settings.CountOfInputs; i++)
    303304                {
    304                     AddInput("Input " + i, "Test Input " + i);                   
     305                    AddInput("Input " + i, "Boolean[] Input " + i);                   
    305306                }
    306307                // Event should be fired even if no additional inputs are set, because when
     
    376377
    377378            // replace variables with value and get numeric values from boolean inputs (if there are any)
    378             if (inputOneFlag == 1 && inputVariableOne != null)
     379            /*if (inputOneFlag == 1 && inputVariableOne != null)
    379380            {
    380381                char[] strInputVariableOne = new char[inputVariableOne.Length];
     
    408409                    string replacement = "i_3." + i;
    409410                    strExpression = strExpression.Replace(replacement, strInputVariableThree[i].ToString());
     411                }
     412            }*/
     413            // replace additional inputs data (if there are any)
     414            for (int i = 0; i < inputs; i++)
     415            {
     416                if (getCurrentValue("Input " + i) != null)
     417                {
     418                    bool[] additionalTempValueBool = (bool[])getCurrentValue("Input " + i);
     419                    char[] strInputVariableAditionalTemp = new char[additionalTempValueBool.Length];
     420                    for (int j = additionalTempValueBool.Length - 1; j >= 0; j--)
     421                    {
     422                        // get numeric values from bool inputs
     423                        strInputVariableAditionalTemp[j] = additionalTempValueBool[j] ? '1' : '0';
     424                        string replacement = "i_" + (i+4) + "." + j;
     425                        strExpression = strExpression.Replace(replacement, strInputVariableAditionalTemp[j].ToString());
     426                    }
    410427                }
    411428            }
     
    642659                new PropertyInfoAttribute(Direction.InputData, name, toolTip, "", false, true, DisplayLevel.Beginner, QuickWatchFormat.None, null))
    643660            );
     661            //DicDynamicProperties[name].Value = null;
    644662        }
    645663
  • trunk/CrypPlugins/BooleanFunctionParser/BooleanFunctionParserSettings.cs

    r490 r599  
    7373        #region ISettings Members
    7474
    75         private int countOfInputs = 0;
    76         [TaskPane("Additional inputs", "How many additional inputs do you need?", null, 0, false, DisplayLevel.Beginner, ControlType.NumericUpDown, ValidationType.RangeInteger, 0, int.MaxValue)]
     75        private int countOfInputs = 1;
     76        [TaskPane("Number of inputs", "How many inputs do you need?", null, 0, false, DisplayLevel.Beginner, ControlType.NumericUpDown, ValidationType.RangeInteger, 0, int.MaxValue)]
    7777        public int CountOfInputs
    7878        {
  • trunk/CrypPlugins/TEA/DetailedDescription/Description.xaml

    r335 r599  
    1515  <Paragraph>
    1616      <Run FontSize="14.6666666666667" xml:lang="de-de">TEA operates on 64-bit blocks and uses a 128-bit key. It has a Feistel structure with a suggested 64 rounds, typically implemented in pairs termed cycles. It has an extremely simple key schedule, mixing all of the key material in exactly the same way for each cycle. Different multiples of a magic constant are used to prevent simple attacks based on the symmetry of the rounds. The magic constant, 2654435769 (Decimal) or 9E3779B9 (Hex) is chosen to be (2^32 / phi) where phi is the golden ratio.</Run>
     17  </Paragraph>
     18  <Paragraph>
     19    <Image Source="/TEA;component/DetailedDescription/Images/TEA.png" Stretch="None"/>
    1720  </Paragraph>
    1821 
Note: See TracChangeset for help on using the changeset viewer.