source: trunk/CrypPlugins/HIGHT/HIGHTSettings.cs @ 2496

Last change on this file since 2496 was 2334, checked in by Matthäus Wander, 11 years ago

removed 1006 occurences of DisplayLevel in 218 files (see #122)

File size: 2.8 KB
Line 
1/*
2   Copyright 2009 Sören Rinne, Ruhr-Universität Bochum, Germany
3
4   Licensed under the Apache License, Version 2.0 (the "License");
5   you may not use this file except in compliance with the License.
6   You may obtain a copy of the License at
7
8       http://www.apache.org/licenses/LICENSE-2.0
9
10   Unless required by applicable law or agreed to in writing, software
11   distributed under the License is distributed on an "AS IS" BASIS,
12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   See the License for the specific language governing permissions and
14   limitations under the License.
15*/
16
17using System;
18using System.Collections.Generic;
19using System.Linq;
20using System.Text;
21
22using System.IO;
23using System.Security.Cryptography;
24using Cryptool.PluginBase;
25using System.ComponentModel;
26using Cryptool.PluginBase.Cryptography;
27using Cryptool.PluginBase.IO;
28using System.Runtime.CompilerServices;
29using Cryptool.PluginBase.Miscellaneous;
30using System.Runtime.Remoting.Contexts;
31
32namespace Cryptool.HIGHT
33{
34    public class HIGHTSettings : ISettings
35    {
36        #region ISettings Members
37
38        private bool hasChanges = false;
39        private int action = 0; //0=encrypt, 1=decrypt
40        private int padding = 0; //0="Zeros"=default, 1="None", 2="PKCS7"
41
42        [ContextMenu("Action","Do you want the input data to be encrypted or decrypted?", 1, ContextMenuControlType.ComboBox, new int[] { 1, 2}, "Encrypt","Decrypt")]
43        [TaskPane("Action", "Do you want the input data to be encrypted or decrypted?", null, 1, false, ControlType.ComboBox, new string[] { "Encrypt", "Decrypt" })]
44        public int Action
45        {
46            get { return this.action; }
47            set
48            {
49                if (((int)value) != padding) hasChanges = true;
50                this.action = (int)value;
51            }
52        }
53
54        [ContextMenu("Padding mode", "Select a mode to fill partial data blocks.", 2, ContextMenuControlType.ComboBox, null, "Zeros", "None", "PKCS7")]
55        [TaskPane("Padding Mode", "Select a mode to fill partial data blocks.", null, 2, false, ControlType.ComboBox, new String[] { "Zeros", "None", "PKCS7" })]
56        public int Padding
57        {
58            get { return this.padding; }
59            set
60            {
61                if (((int)value) != padding) hasChanges = true;
62                this.padding = (int)value;
63            }
64        }
65
66        public bool HasChanges
67        {
68            get { return hasChanges; }
69            set { hasChanges = value; }
70        }
71
72        #endregion
73
74        #region INotifyPropertyChanged Members
75
76        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
77
78        #endregion
79    }
80}
Note: See TracBrowser for help on using the repository browser.