Пример #1
0
			public static Class1.Class14 smethod_11(Class1.Class14 class14_0, int int_0)
			{
				if (int_0 == 0)
				{
					return new Class1.Class14(class14_0);
				}
				int num = int_0 >> 5;
				int num2 = int_0 & 31;
				Class1.Class14 @class = new Class1.Class14((Class1.Class14.Enum2)1, class14_0.uint_0 - (uint)num + 1u);
				uint num3 = (uint)(@class.uint_1.Length - 1);
				if (num2 != 0)
				{
					uint num4 = 0u;
					while (num3-- > 0u)
					{
						uint num5 = class14_0.uint_1[(int)(checked((IntPtr)(unchecked((ulong)num3 + (ulong)((long)num)))))];
						@class.uint_1[(int)((UIntPtr)num3)] = (num5 >> int_0 | num4);
						num4 = num5 << 32 - int_0;
					}
				}
				else
				{
					while (num3-- > 0u)
					{
						@class.uint_1[(int)((UIntPtr)num3)] = class14_0.uint_1[(int)(checked((IntPtr)(unchecked((ulong)num3 + (ulong)((long)num)))))];
					}
				}
				@class.method_5();
				return @class;
			}
Пример #2
0
			public static Class1.Class14 smethod_12(Class1.Class14 class14_0, uint uint_0)
			{
				Class1.Class14 @class = new Class1.Class14((Class1.Class14.Enum2)1, class14_0.uint_0 + 1u);
				uint num = 0u;
				ulong num2 = 0uL;
				do
				{
					num2 += (ulong)class14_0.uint_1[(int)((UIntPtr)num)] * (ulong)uint_0;
					@class.uint_1[(int)((UIntPtr)num)] = (uint)num2;
					num2 >>= 32;
				}
				while ((num += 1u) < class14_0.uint_0);
				@class.uint_1[(int)((UIntPtr)num)] = (uint)num2;
				@class.method_5();
				return @class;
			}
Пример #3
0
			public static Class1.Class14[] smethod_9(Class1.Class14 class14_0, Class1.Class14 class14_1)
			{
				if (Class1.Class14.Class16.smethod_4(class14_0, class14_1) == (Class1.Class14.Enum2)(-1))
				{
					return new Class1.Class14[]
					{
						0,
						new Class1.Class14(class14_0)
					};
				}
				class14_0.method_5();
				class14_1.method_5();
				if (class14_1.uint_0 == 1u)
				{
					return Class1.Class14.Class16.smethod_8(class14_0, class14_1.uint_1[0]);
				}
				uint num = class14_0.uint_0 + 1u;
				int num2 = (int)(class14_1.uint_0 + 1u);
				uint num3 = 2147483648u;
				uint num4 = class14_1.uint_1[(int)((UIntPtr)(class14_1.uint_0 - 1u))];
				int num5 = 0;
				int num6 = (int)(class14_0.uint_0 - class14_1.uint_0);
				while (num3 != 0u && (num4 & num3) == 0u)
				{
					num5++;
					num3 >>= 1;
				}
				Class1.Class14 @class = new Class1.Class14((Class1.Class14.Enum2)1, class14_0.uint_0 - class14_1.uint_0 + 1u);
				Class1.Class14 class2 = class14_0 << num5;
				uint[] uint_ = class2.uint_1;
				class14_1 <<= num5;
				int i = (int)(num - class14_1.uint_0);
				int num7 = (int)(num - 1u);
				uint num8 = class14_1.uint_1[(int)((UIntPtr)(class14_1.uint_0 - 1u))];
				ulong num9 = (ulong)class14_1.uint_1[(int)((UIntPtr)(class14_1.uint_0 - 2u))];
				while (i > 0)
				{
					ulong num10 = ((ulong)uint_[num7] << 32) + (ulong)uint_[num7 - 1];
					ulong num11 = num10 / (ulong)num8;
					ulong num12 = num10 % (ulong)num8;
					do
					{
						if (num11 != 4294967296uL)
						{
							if (num11 * num9 <= (num12 << 32) + (ulong)uint_[num7 - 2])
							{
								break;
							}
						}
						num11 -= 1uL;
						num12 += (ulong)num8;
					}
					while (num12 < 4294967296uL);
					IL_177:
					uint num13 = 0u;
					int num14 = num7 - num2 + 1;
					ulong num15 = 0uL;
					uint num16 = (uint)num11;
					do
					{
						num15 += (ulong)class14_1.uint_1[(int)((UIntPtr)num13)] * (ulong)num16;
						uint num17 = uint_[num14];
						uint_[num14] -= (uint)num15;
						num15 >>= 32;
						if (uint_[num14] > num17)
						{
							num15 += 1uL;
						}
						num13 += 1u;
						num14++;
					}
					while ((ulong)num13 < (ulong)((long)num2));
					num14 = num7 - num2 + 1;
					num13 = 0u;
					if (num15 != 0uL)
					{
						num16 -= 1u;
						ulong num18 = 0uL;
						do
						{
							num18 = (ulong)uint_[num14] + (ulong)class14_1.uint_1[(int)((UIntPtr)num13)] + num18;
							uint_[num14] = (uint)num18;
							num18 >>= 32;
							num13 += 1u;
							num14++;
						}
						while ((ulong)num13 < (ulong)((long)num2));
					}
					@class.uint_1[num6--] = num16;
					num7--;
					i--;
					continue;
					goto IL_177;
				}
				@class.method_5();
				class2.method_5();
				Class1.Class14[] array = new Class1.Class14[]
				{
					@class,
					class2
				};
				if (num5 != 0)
				{
					Class1.Class14[] array2;
					(array2 = array)[1] = array2[1] >> num5;
				}
				return array;
			}
Пример #4
0
			public static Class1.Class14 smethod_10(Class1.Class14 class14_0, int int_0)
			{
				if (int_0 == 0)
				{
					return new Class1.Class14(class14_0, class14_0.uint_0 + 1u);
				}
				int num = int_0 >> 5;
				int_0 &= 31;
				Class1.Class14 @class = new Class1.Class14((Class1.Class14.Enum2)1, class14_0.uint_0 + 1u + (uint)num);
				uint num2 = 0u;
				uint uint_ = class14_0.uint_0;
				if (int_0 != 0)
				{
					uint num3 = 0u;
					while (num2 < uint_)
					{
						uint num4 = class14_0.uint_1[(int)((UIntPtr)num2)];
						@class.uint_1[(int)(checked((IntPtr)(unchecked((ulong)num2 + (ulong)((long)num)))))] = (num4 << int_0 | num3);
						num3 = num4 >> 32 - int_0;
						num2 += 1u;
					}
					@class.uint_1[(int)(checked((IntPtr)(unchecked((ulong)num2 + (ulong)((long)num)))))] = num3;
				}
				else
				{
					while (num2 < uint_)
					{
						@class.uint_1[(int)(checked((IntPtr)(unchecked((ulong)num2 + (ulong)((long)num)))))] = class14_0.uint_1[(int)((UIntPtr)num2)];
						num2 += 1u;
					}
				}
				@class.method_5();
				return @class;
			}
Пример #5
0
			public static Class1.Class14 smethod_1(Class1.Class14 class14_0, Class1.Class14 class14_1)
			{
				Class1.Class14 @class = new Class1.Class14((Class1.Class14.Enum2)1, class14_0.uint_0);
				uint[] uint_ = @class.uint_1;
				uint[] uint_2 = class14_0.uint_1;
				uint[] uint_3 = class14_1.uint_1;
				uint num = 0u;
				uint num2 = 0u;
				do
				{
					uint num3 = uint_3[(int)((UIntPtr)num)];
					if ((num3 += num2) < num2 | (uint_[(int)((UIntPtr)num)] = uint_2[(int)((UIntPtr)num)] - num3) > ~num3)
					{
						num2 = 1u;
					}
					else
					{
						num2 = 0u;
					}
				}
				while ((num += 1u) < class14_1.uint_0);
				if (num != class14_0.uint_0)
				{
					if (num2 == 1u)
					{
						do
						{
							uint_[(int)((UIntPtr)num)] = uint_2[(int)((UIntPtr)num)] - 1u;
						}
						while (uint_2[(int)((UIntPtr)(num++))] == 0u && num < class14_0.uint_0);
						if (num == class14_0.uint_0)
						{
							goto IL_C8;
						}
					}
					do
					{
						uint_[(int)((UIntPtr)num)] = uint_2[(int)((UIntPtr)num)];
					}
					while ((num += 1u) < class14_0.uint_0);
				}
				IL_C8:
				@class.method_5();
				return @class;
			}
Пример #6
0
			public static Class1.Class14[] smethod_8(Class1.Class14 class14_0, uint uint_0)
			{
				Class1.Class14 @class = new Class1.Class14((Class1.Class14.Enum2)1, class14_0.uint_0);
				ulong num = 0uL;
				uint uint_ = class14_0.uint_0;
				while (uint_-- > 0u)
				{
					num <<= 32;
					num |= (ulong)class14_0.uint_1[(int)((UIntPtr)uint_)];
					@class.uint_1[(int)((UIntPtr)uint_)] = (uint)(num / (ulong)uint_0);
					num %= (ulong)uint_0;
				}
				@class.method_5();
				Class1.Class14 class2 = (uint)num;
				return new Class1.Class14[]
				{
					@class,
					class2
				};
			}
Пример #7
0
			public Class1.Class14 method_3(Class1.Class14 class14_2, Class1.Class14 class14_3)
			{
				Class1.Class14 @class = new Class1.Class14(1u);
				if (class14_3 == 0u)
				{
					return @class;
				}
				Class1.Class14 class2 = class14_2;
				if (class14_3.method_1(0))
				{
					@class = class14_2;
				}
				for (int i = 1; i < class14_3.method_0(); i++)
				{
					class2 = this.method_1(class2, class2);
					if (class14_3.method_1(i))
					{
						@class = this.method_1(class2, @class);
					}
				}
				return @class;
			}
Пример #8
0
		public override void ImportParameters(RSAParameters parameters)
		{
			this.class14_0 = new Class1.Class14(parameters.Modulus);
			this.class14_1 = new Class1.Class14(parameters.Exponent);
			this.class14_2 = ((!object.ReferenceEquals(parameters.P, null)) ? new Class1.Class14(parameters.P) : null);
			this.class14_3 = ((!object.ReferenceEquals(parameters.Q, null)) ? new Class1.Class14(parameters.Q) : null);
			this.class14_4 = ((!object.ReferenceEquals(parameters.DP, null)) ? new Class1.Class14(parameters.DP) : null);
			this.class14_5 = ((!object.ReferenceEquals(parameters.DQ, null)) ? new Class1.Class14(parameters.DQ) : null);
			this.class14_6 = ((!object.ReferenceEquals(parameters.InverseQ, null)) ? new Class1.Class14(parameters.InverseQ) : null);
			this.class14_7 = ((!object.ReferenceEquals(parameters.D, null)) ? new Class1.Class14(parameters.D) : null);
		}
Пример #9
0
			public Class15(Class1.Class14 class14_2)
			{
				this.class14_0 = class14_2;
				uint num = this.class14_0.uint_0 << 1;
				this.class14_1 = new Class1.Class14((Class1.Class14.Enum2)1, num + 1u);
				this.class14_1.uint_1[(int)((UIntPtr)num)] = 1u;
				this.class14_1 /= this.class14_0;
			}
Пример #10
0
			public void method_0(Class1.Class14 class14_2)
			{
				Class1.Class14 @class = this.class14_0;
				uint uint_ = @class.uint_0;
				uint num = uint_ + 1u;
				uint num2 = uint_ - 1u;
				if (class14_2.uint_0 < uint_)
				{
					return;
				}
				if ((long)class14_2.uint_1.Length < (long)((ulong)class14_2.uint_0))
				{
					throw new IndexOutOfRangeException("x out of range");
				}
				Class1.Class14 class2 = new Class1.Class14((Class1.Class14.Enum2)1, class14_2.uint_0 - num2 + this.class14_1.uint_0);
				Class1.Class14.Class16.smethod_13(class14_2.uint_1, num2, class14_2.uint_0 - num2, this.class14_1.uint_1, 0u, this.class14_1.uint_0, class2.uint_1, 0u);
				uint uint_2 = (class14_2.uint_0 > num) ? num : class14_2.uint_0;
				class14_2.uint_0 = uint_2;
				class14_2.method_5();
				Class1.Class14 class3 = new Class1.Class14((Class1.Class14.Enum2)1, num);
				Class1.Class14.Class16.smethod_14(class2.uint_1, (int)num, (int)(class2.uint_0 - num), @class.uint_1, 0, (int)@class.uint_0, class3.uint_1, 0, (int)num);
				class3.method_5();
				if (class3 <= class14_2)
				{
					Class1.Class14.Class16.smethod_2(class14_2, class3);
				}
				else
				{
					Class1.Class14 class4 = new Class1.Class14((Class1.Class14.Enum2)1, num + 1u);
					class4.uint_1[(int)((UIntPtr)num)] = 1u;
					Class1.Class14.Class16.smethod_2(class4, class3);
					Class1.Class14.Class16.smethod_3(class14_2, class4);
				}
				while (class14_2 >= @class)
				{
					Class1.Class14.Class16.smethod_2(class14_2, @class);
				}
			}
Пример #11
0
		private bool method_15(XmlReader xmlReader_0, string string_0, string string_1, ref Class1.Class14 class14_8)
		{
			if (string.Compare(string_0, string_1, true) != 0)
			{
				return false;
			}
			string s = xmlReader_0.ReadString();
			byte[] array = Convert.FromBase64String(s);
			Class1.Class14 @class = new Class1.Class14(array);
			class14_8 = @class;
			return true;
		}
Пример #12
0
		protected override void Dispose(bool disposing)
		{
			this.class14_0 = (this.class14_1 = (this.class14_2 = (this.class14_3 = (this.class14_4 = (this.class14_5 = (this.class14_6 = (this.class14_7 = null)))))));
		}
Пример #13
0
		public byte[] method_1(byte[] byte_2)
		{
			if (byte_2.Length != this.int_2)
			{
				throw new ArgumentException("input.Length does not match keylen");
			}
			if (object.ReferenceEquals(this.class14_7, null))
			{
				throw new ArgumentException("no private key set!");
			}
			Class1.Class14 @class = new Class1.Class14(byte_2);
			if (@class >= this.class14_0)
			{
				throw new ArgumentException("input exceeds modulus");
			}
			@class = @class.method_7(this.class14_7, this.class14_0);
			byte[] byte_3 = @class.method_2();
			return this.method_13(byte_3, this.int_2);
		}
Пример #14
0
			public static Class1.Class14 smethod_18(Class1.Class14 class14_0, Class1.Class14 class14_1)
			{
				if (class14_1.uint_0 == 1u)
				{
					return Class1.Class14.Class16.smethod_17(class14_0, class14_1.uint_1[0]);
				}
				Class1.Class14[] array = new Class1.Class14[]
				{
					0,
					1
				};
				Class1.Class14[] array2 = new Class1.Class14[2];
				Class1.Class14[] array3 = new Class1.Class14[]
				{
					0,
					0
				};
				int num = 0;
				Class1.Class14 class14_2 = class14_1;
				Class1.Class14 @class = class14_0;
				Class1.Class14.Class15 class2 = new Class1.Class14.Class15(class14_1);
				while (@class != 0u)
				{
					if (num > 1)
					{
						Class1.Class14 class3 = class2.method_2(array[0], array[1] * array2[0]);
						array[0] = array[1];
						array[1] = class3;
					}
					Class1.Class14[] array4 = Class1.Class14.Class16.smethod_9(class14_2, @class);
					array2[0] = array2[1];
					array2[1] = array4[0];
					array3[0] = array3[1];
					array3[1] = array4[1];
					class14_2 = @class;
					@class = array4[1];
					num++;
				}
				if (array3[0] != 1u)
				{
					throw new ArithmeticException("No inverse!");
				}
				return class2.method_2(array[0], array[1] * array2[0]);
			}
Пример #15
0
			public static Class1.Class14 smethod_0(Class1.Class14 class14_0, Class1.Class14 class14_1)
			{
				uint num = 0u;
				uint[] uint_;
				uint uint_2;
				uint[] uint_3;
				uint uint_4;
				if (class14_0.uint_0 < class14_1.uint_0)
				{
					uint_ = class14_1.uint_1;
					uint_2 = class14_1.uint_0;
					uint_3 = class14_0.uint_1;
					uint_4 = class14_0.uint_0;
				}
				else
				{
					uint_ = class14_0.uint_1;
					uint_2 = class14_0.uint_0;
					uint_3 = class14_1.uint_1;
					uint_4 = class14_1.uint_0;
				}
				Class1.Class14 @class = new Class1.Class14((Class1.Class14.Enum2)1, uint_2 + 1u);
				uint[] uint_5 = @class.uint_1;
				ulong num2 = 0uL;
				do
				{
					num2 = (ulong)uint_[(int)((UIntPtr)num)] + (ulong)uint_3[(int)((UIntPtr)num)] + num2;
					uint_5[(int)((UIntPtr)num)] = (uint)num2;
					num2 >>= 32;
				}
				while ((num += 1u) < uint_4);
				bool flag;
				if (flag = (num2 != 0uL))
				{
					if (num < uint_2)
					{
						do
						{
							flag = ((uint_5[(int)((UIntPtr)num)] = uint_[(int)((UIntPtr)num)] + 1u) == 0u);
						}
						while ((num += 1u) < uint_2 && flag);
					}
					if (flag)
					{
						uint_5[(int)((UIntPtr)num)] = 1u;
						@class.uint_0 = num + 1u;
						return @class;
					}
				}
				if (num < uint_2)
				{
					do
					{
						uint_5[(int)((UIntPtr)num)] = uint_[(int)((UIntPtr)num)];
					}
					while ((num += 1u) < uint_2);
				}
				@class.method_5();
				return @class;
			}
Пример #16
0
		public static Class1.Class14 operator *(Class1.Class14 class14_0, Class1.Class14 class14_1)
		{
			if (class14_0 == 0u || class14_1 == 0u)
			{
				return 0;
			}
			if ((long)class14_0.uint_1.Length < (long)((ulong)class14_0.uint_0))
			{
				throw new IndexOutOfRangeException("bi1 out of range");
			}
			if ((long)class14_1.uint_1.Length < (long)((ulong)class14_1.uint_0))
			{
				throw new IndexOutOfRangeException("bi2 out of range");
			}
			Class1.Class14 @class = new Class1.Class14((Class1.Class14.Enum2)1, class14_0.uint_0 + class14_1.uint_0);
			Class1.Class14.Class16.smethod_13(class14_0.uint_1, 0u, class14_0.uint_0, class14_1.uint_1, 0u, class14_1.uint_0, @class.uint_1, 0u);
			@class.method_5();
			return @class;
		}
Пример #17
0
		public override void FromXmlString(string xmlString)
		{
			StringReader input = new StringReader(xmlString);
			XmlTextReader xmlTextReader = new XmlTextReader(input);
			this.class14_0 = (this.class14_1 = (this.class14_2 = (this.class14_3 = (this.class14_4 = (this.class14_5 = (this.class14_6 = (this.class14_7 = null)))))));
			while (true)
			{
				XmlNodeType xmlNodeType = xmlTextReader.MoveToContent();
				XmlNodeType xmlNodeType2 = xmlNodeType;
				switch (xmlNodeType2)
				{
				case XmlNodeType.None:
					return;
				case XmlNodeType.Element:
				{
					string name = xmlTextReader.Name;
					if (!this.method_15(xmlTextReader, name, "Modulus", ref this.class14_0) && !this.method_15(xmlTextReader, name, "Exponent", ref this.class14_1) && !this.method_15(xmlTextReader, name, "P", ref this.class14_2) && !this.method_15(xmlTextReader, name, "Q", ref this.class14_3) && !this.method_15(xmlTextReader, name, "DP", ref this.class14_4) && !this.method_15(xmlTextReader, name, "DQ", ref this.class14_5) && !this.method_15(xmlTextReader, name, "InverseQ", ref this.class14_6) && !this.method_15(xmlTextReader, name, "D", ref this.class14_7))
					{
						xmlTextReader.ReadString();
					}
					break;
				}
				default:
					if (xmlNodeType2 != XmlNodeType.EndElement)
					{
						goto Block_9;
					}
					xmlTextReader.ReadEndElement();
					break;
				}
			}
			Block_9:
			throw new ArgumentException();
		}