public ConfigurateEDSPage()
        {
            this.EDS = new EllipticCurve_EDS();
            this.db  = SupportEDS.GetMainWindow().db;
            SupportEDS.GetMainWindow().frame_left_column.Width = new GridLength(0);
            SupportEDS.GetMainWindow().back_column.Width = new GridLength(56);
            InitializeComponent();
            List <Scheme> nist = this.db.Schemes.Where(sh => sh.Owner == "nist").ToList();

            foreach (Scheme s in nist)
            {
                this.comboBox_nist.Items.Add(s.Name);
            }

            List <Scheme> sec2 = this.db.Schemes.Where(sh => sh.Owner == "sec2").ToList();

            foreach (Scheme s in sec2)
            {
                this.comboBox_sec2.Items.Add(s.Name);
            }

            List <Scheme> user = this.db.Schemes.Where(sh => sh.Owner == "user").ToList();

            foreach (Scheme s in user)
            {
                this.comboBox_custom.Items.Add(s.Name);
            }
            this.textBlock_info.Text = "Параметры схемы электронной цифровой подписи на основе эллиптических кривых над конечным полем Fp:\n\n" +
                                       "   1. Размер конечного поля p, где p > 3 - простое число;\n " +
                                       "   2. Два элемента a и b, которые определяют уравнение эллиптической кривой Е;\n" +
                                       "   3. Два элемента Gx и Gy, которые определяют базисную точку G = (Gx, Gy) простого порядка на E;\n" +
                                       "   4. Порядок n точки G (рекомендовано n > 2^160 и n^2 > 16p);\n" +
                                       "   5. Кофактор h = #E(Fp)/n.";
        }
        public CreateSchemePage()
        {
            this.EDS = new EllipticCurve_EDS();
            this.db  = SupportEDS.GetMainWindow().db;

            InitializeComponent();

            this.gen_textbox_p.GenButtonClick        += Gen_textbox_p_GenButtonClick;
            this.gen_textbox_p.value_textbox.KeyDown += Textbox_KeyDigitDown;
            this.gen_textbox_p.value_textbox.KeyDown += Textbox_P_KeyDown;
            this.gen_textbox_p.down_textbox.KeyDown  += Textbox_KeyDigitDown;
            this.gen_textbox_p.gen_button.Click      += Textbox_P_KeyDown;

            this.gen_textbox_a.GenButtonClick        += Gen_textbox_a_GenButtonClick;
            this.gen_textbox_a.value_textbox.KeyDown += Textbox_KeyDigitAndSubDown;
            this.gen_textbox_p.value_textbox.KeyDown += Textbox_A_KeyDown;
            this.gen_textbox_a.down_textbox.KeyDown  += Textbox_KeyDigitDown;
            this.gen_textbox_a.gen_button.Click      += Textbox_A_KeyDown;
            this.gen_textbox_a.value_textbox.Text     = "-3";

            this.gen_textbox_b.GenButtonClick        += Gen_textbox_b_GenButtonClick;
            this.gen_textbox_b.value_textbox.KeyDown += Textbox_KeyDigitAndSubDown;
            this.gen_textbox_p.value_textbox.KeyDown += Textbox_B_KeyDown;
            this.gen_textbox_b.down_textbox.KeyDown  += Textbox_KeyDigitDown;
            this.gen_textbox_b.gen_button.Click      += Textbox_B_KeyDown;
        }
Exemple #3
0
        public MainWindow()
        {
            string user_folder = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
            var    dir         = new DirectoryInfo(user_folder + "/.edsa.keys");

            if (!dir.Exists)
            {
                dir.Create();
            }
            db           = new SchemeContext();
            selectScheme = null;
            EDS          = new EllipticCurve_EDS();
            InitializeComponent();
            this.Closing += MainWindow_Closing;
        }