-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
89 lines (77 loc) · 2.62 KB
/
Program.cs
File metadata and controls
89 lines (77 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
using System;
using System.Text;
namespace SimpleRSA
{
internal class Program
{
static void Main(string[] args)
{
int choice = Convert.ToInt32(Console.ReadLine());
switch (choice)
{
case 1:
DemoOne();
break;
case 2:
DemoTwo();
break;
case 3:
DemoThree();
break;
case 4:
DemoFour();
break;
case 5:
RunAllDemos();
break;
}
}
private static void DemoOne()
{
Console.WriteLine("Demo One.");
Console.WriteLine("MulMod(). 3 - 4 digits. Use Integers (Int32).");
Console.WriteLine();
Test1.TestOne(43, 47, Test1.GetString(1));
Test1.TestOne(173, 199, Test1.GetString(2));
Test1.TestOne(2609, 2777, Test1.GetString(3));
Console.WriteLine("\n");
}
private static void DemoTwo()
{
Console.WriteLine("Demo Two.");
Console.WriteLine("ModularPow(). 4-5 digits. Use Long (Int64).");
Console.WriteLine();
Test1.TestTwo(4217, 4363, Test1.GetString(4));
Test1.TestTwo(39971, 40163, Test1.GetString(1));
Test1.TestTwo(54311, 54503, Test1.GetString(2));
Console.WriteLine("\n");
}
private static void DemoThree()
{
Console.WriteLine("Demo Three.");
Console.WriteLine("BigInteger. 5-6 digits. Not packed.");
Console.WriteLine();
Test1.TestThree(54401, 67943, Test1.GetString(3));
Test1.TestThree(93971, 94063, Test1.GetString(4));
Test1.TestThree(502237, 502543, Test1.GetString(1));
Console.WriteLine("\n");
}
private static void DemoFour()
{
Console.WriteLine("Demo Four.");
Console.WriteLine("BigIntegers. Pack characters: 5-6 digits.");
Console.WriteLine();
Test1.TestFour(54401, 67943, Test1.GetString(2));
Test1.TestFour(93971, 94063, Test1.GetString(3));
Test1.TestFour(502237, 502543, Test1.GetString(4));
Console.WriteLine("\n");
}
private static void RunAllDemos()
{
DemoOne();
DemoTwo();
DemoThree();
DemoFour();
}
}
}