Ignore:
Timestamp:
Jan 16, 2009, 11:18:00 AM (13 years ago)
Author:
Gerhard Junker
Message:

Implementing Tiger and Whirlpool as HMAC (was HashAlgorithm)
Added Tiger and Whirlpool to PKCS#5

Location:
trunk/CrypPlugins/PKCS5
Files:
2 edited

Legend:

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

    r155 r198  
    3535
    3636    /// <summary>
    37     /// can only handle one input canal
    38     /// </summary>
    39     private enum dataCanal
    40     {
    41       /// <summary>
    42       /// nothing assigned
    43       /// </summary>
    44       none,
    45       /// <summary>
    46       /// using stream interface
    47       /// </summary>
    48       streamCanal,
    49       /// <summary>
    50       /// using byte array interface
    51       /// </summary>
    52       byteCanal
    53     };
    54 
    55 
    56     /// <summary>
    5737    /// Initializes a new instance of the <see cref="PKCS5"/> class.
    5838    /// </summary>
     
    11191    // Input key
    11292    private byte[] key = { };
    113     private dataCanal keyCanal = dataCanal.none;
    11493
    11594    /// <summary>
     
    140119          return;
    141120
    142         if (keyCanal != dataCanal.none && keyCanal != dataCanal.streamCanal)
    143           GuiLogMessage("Duplicate input key not allowed!", NotificationLevel.Warning);
    144         keyCanal = dataCanal.streamCanal;
    145 
    146121        long len = value.Length;
    147122        key = new byte[len];
     
    168143      set
    169144      {
    170         if (keyCanal != dataCanal.none && keyCanal != dataCanal.byteCanal)
    171           GuiLogMessage("Duplicate key data not allowed!", NotificationLevel.Warning);
    172         keyCanal = dataCanal.byteCanal;
    173 
    174145        long len = value.Length;
    175146        key = new byte[len];
     
    188159    // Salt Data
    189160    private byte[] salt = { };
    190     private dataCanal saltCanal = dataCanal.none;
    191161
    192162    /// <summary>
     
    216186        if (null == value)
    217187          return;
    218 
    219         if (saltCanal != dataCanal.none && saltCanal != dataCanal.streamCanal)
    220           GuiLogMessage("Duplicate salt input not allowed!", NotificationLevel.Warning);
    221         saltCanal = dataCanal.streamCanal;
    222 
    223188        long len = value.Length;
    224189        salt = new byte[len];
     
    246211      set
    247212      {
    248         if (saltCanal != dataCanal.none && saltCanal != dataCanal.byteCanal)
    249           GuiLogMessage("Duplicate salt input not allowed!", NotificationLevel.Warning);
    250         saltCanal = dataCanal.byteCanal;
    251 
    252213        long len = value.Length;
    253214        salt = new byte[len];
     
    316277        return this.outputData;
    317278      }
    318       //set
    319       //{
    320       //    if (outputData != value)
    321       //    {
    322       //        this.outputData = value;
    323       //    }
    324       //    NotifyUpdateOutput();
    325       //}
    326279    }
    327280
  • trunk/CrypPlugins/PKCS5/PKCS5Settings.cs

    r138 r198  
    4444                                        = PKCS5MaskGenerationMethod.ShaFunction.SHA256;
    4545
    46     [ContextMenu("SHA Function",
    47       "Select the hash function (MD5, SHA1 or one out of the SHA2 family)", 0,
     46    [ContextMenu("Hash Function",
     47      "Select the hash function (MD5, one out of the SHA family, TIGER or WHIRLPOOL)", 0,
    4848      DisplayLevel.Beginner, ContextMenuControlType.ComboBox, null,
    49       new string[] { "MD5", "SHA1", "SHA256", "SHA384", "SHA512" })]
     49      new string[] { "MD5", "SHA1", "SHA256", "SHA384", "SHA512", "TIGER", "WHIRLPOOL" })]
    5050    [TaskPane("Select hash function",
    51       "Select the hash function (MD2, SHA1 or one out of the SHA2 family)", "", 0, true,
     51      "Select the hash function (MD5, one out of the SHA family, TIGER or WHIRLPOOL)", "", 0, true,
    5252      DisplayLevel.Beginner, ControlType.ComboBox,
    53       new string[] { "MD5", "SHA1", "SHA256", "SHA384", "SHA512" })]
     53      new string[] { "MD5", "SHA1", "SHA256", "SHA384", "SHA512", "TIGER", "WHIRLPOOL" })]
    5454    public int SHAFunction
    5555    {
     
    6161      {
    6262        this.selectedShaFunction = (PKCS5MaskGenerationMethod.ShaFunction)value;
    63         //CheckLength();
    6463        // set to max hash length
    6564        length = PKCS5MaskGenerationMethod.GetHashLength(selectedShaFunction) * 8;
     
    115114        while ((length & 0x07) != 0) // go to the next multiple of 8
    116115          length++;
    117 
    118         //CheckLength();
    119116
    120117        hasChanges = true;
Note: See TracChangeset for help on using the changeset viewer.