639 lines
24 KiB
C#
639 lines
24 KiB
C#
using System;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Field;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Abc
|
|
{
|
|
// Token: 0x02001BA0 RID: 7072
|
|
[Token(Token = "0x2001BA0")]
|
|
internal class Tnaf
|
|
{
|
|
// Token: 0x0600ADF0 RID: 44528 RVA: 0x0025C294 File Offset: 0x0025A494
|
|
[Token(Token = "0x600ADF0")]
|
|
[Address(RVA = "0x6F8DD0", Offset = "0x6F7DD0", VA = "0x1806F8DD0")]
|
|
public static BigInteger Norm(sbyte mu, ZTauElement lambda)
|
|
{
|
|
BigInteger u = lambda.u;
|
|
BigInteger bigInteger = u.Multiply(u);
|
|
BigInteger u2 = lambda.u;
|
|
BigInteger v = lambda.v;
|
|
BigInteger bigInteger2 = u2.Multiply(v);
|
|
BigInteger v2 = lambda.v;
|
|
BigInteger bigInteger3 = v2.Multiply(v2).ShiftLeft(1);
|
|
BigInteger bigInteger4 = bigInteger.Subtract(bigInteger2);
|
|
return bigInteger.Add(bigInteger2).Add(bigInteger3);
|
|
}
|
|
|
|
// Token: 0x0600ADF1 RID: 44529 RVA: 0x0025C30C File Offset: 0x0025A50C
|
|
[Token(Token = "0x600ADF1")]
|
|
[Address(RVA = "0x6F8C50", Offset = "0x6F7C50", VA = "0x1806F8C50")]
|
|
public static SimpleBigDecimal Norm(sbyte mu, SimpleBigDecimal u, SimpleBigDecimal v)
|
|
{
|
|
SimpleBigDecimal simpleBigDecimal = u.Multiply(u);
|
|
SimpleBigDecimal simpleBigDecimal2 = u.Multiply(v);
|
|
SimpleBigDecimal simpleBigDecimal3 = v.Multiply(v);
|
|
BigInteger bigInteger = simpleBigDecimal3.bigInt.ShiftLeft(1);
|
|
int scale = simpleBigDecimal3.scale;
|
|
SimpleBigDecimal simpleBigDecimal4 = new SimpleBigDecimal(bigInteger, scale);
|
|
SimpleBigDecimal simpleBigDecimal5 = simpleBigDecimal.Subtract(simpleBigDecimal2);
|
|
return simpleBigDecimal.Add(simpleBigDecimal2).Add(simpleBigDecimal4);
|
|
}
|
|
|
|
// Token: 0x0600ADF2 RID: 44530 RVA: 0x0025C37C File Offset: 0x0025A57C
|
|
[Token(Token = "0x600ADF2")]
|
|
[Address(RVA = "0x6F92A0", Offset = "0x6F82A0", VA = "0x1806F92A0")]
|
|
public static ZTauElement Round(SimpleBigDecimal lambda0, SimpleBigDecimal lambda1, sbyte mu)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600ADF2)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Abc.ZTauElement BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Abc.Tnaf::Round(BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Abc.SimpleBigDecimal,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Abc.SimpleBigDecimal,System.SByte)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_1AF:
|
|
stloc:ArgumentException(var_46_1B9, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("lambda0 and lambda1 do not have same scale")))
|
|
}
|
|
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x0600ADF3 RID: 44531 RVA: 0x0025C544 File Offset: 0x0025A744
|
|
[Token(Token = "0x600ADF3")]
|
|
[Address(RVA = "0x6F7610", Offset = "0x6F6610", VA = "0x1806F7610")]
|
|
public static SimpleBigDecimal ApproximateDivisionByN(BigInteger k, BigInteger s, BigInteger vm, sbyte a, int m, int c)
|
|
{
|
|
BigInteger bigInteger2;
|
|
BigInteger bigInteger = s.Multiply(bigInteger2);
|
|
BigInteger bigInteger4;
|
|
BigInteger bigInteger3 = vm.Multiply(bigInteger4);
|
|
BigInteger bigInteger5 = bigInteger.Add(bigInteger3);
|
|
bool flag;
|
|
if (flag)
|
|
{
|
|
BigInteger one = BigInteger.One;
|
|
BigInteger bigInteger7;
|
|
BigInteger bigInteger6 = bigInteger7.Add(one);
|
|
}
|
|
SimpleBigDecimal simpleBigDecimal;
|
|
return simpleBigDecimal;
|
|
}
|
|
|
|
// Token: 0x0600ADF4 RID: 44532 RVA: 0x0025C58C File Offset: 0x0025A78C
|
|
[Token(Token = "0x600ADF4")]
|
|
[Address(RVA = "0x6F97F0", Offset = "0x6F87F0", VA = "0x1806F97F0")]
|
|
public static sbyte[] TauAdicNaf(sbyte mu, ZTauElement lambda)
|
|
{
|
|
sbyte b = mu + 1;
|
|
int bitLength = Tnaf.Norm(mu, lambda).BitLength;
|
|
sbyte[] array = new sbyte[34];
|
|
int num = 0;
|
|
BigInteger u = lambda.u;
|
|
BigInteger v = lambda.v;
|
|
int num2 = 0;
|
|
if (!u.TestBit(num2))
|
|
{
|
|
}
|
|
BigInteger two = BigInteger.Two;
|
|
BigInteger bigInteger = v.ShiftLeft(1);
|
|
BigInteger bigInteger2 = u.Subtract(bigInteger);
|
|
BigInteger four = Tnaf.Four;
|
|
BigInteger bigInteger3 = bigInteger2.Mod(four);
|
|
if (two.Subtract(bigInteger3).IntValue != 1)
|
|
{
|
|
BigInteger one = BigInteger.One;
|
|
BigInteger bigInteger4 = u.Add(one);
|
|
}
|
|
int num3 = 0;
|
|
BigInteger bigInteger5 = u.ClearBit(num3);
|
|
BigInteger bigInteger6 = bigInteger5.ShiftRight(1);
|
|
BigInteger bigInteger7 = v.Subtract(bigInteger6);
|
|
BigInteger bigInteger8 = v.Add(bigInteger6);
|
|
BigInteger bigInteger9 = bigInteger5.ShiftRight(1).Negate();
|
|
num++;
|
|
num++;
|
|
sbyte[] array2 = new sbyte[num];
|
|
int num4 = 0;
|
|
int num5 = 0;
|
|
Array.Copy(array, num5, array2, num4, num);
|
|
return array2;
|
|
}
|
|
|
|
// Token: 0x0600ADF5 RID: 44533 RVA: 0x0025C694 File Offset: 0x0025A894
|
|
[Token(Token = "0x600ADF5")]
|
|
[Address(RVA = "0x6FA090", Offset = "0x6F9090", VA = "0x1806FA090")]
|
|
public static AbstractF2mPoint Tau(AbstractF2mPoint p)
|
|
{
|
|
bool flag = p.SatisfiesCurveEquation();
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600ADF6 RID: 44534 RVA: 0x0025C6B0 File Offset: 0x0025A8B0
|
|
[Token(Token = "0x600ADF6")]
|
|
[Address(RVA = "0x6F79C0", Offset = "0x6F69C0", VA = "0x1806F79C0")]
|
|
public static sbyte GetMu(AbstractF2mCurve curve)
|
|
{
|
|
IFiniteField field = curve.Field;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600ADF7 RID: 44535 RVA: 0x0025C6D4 File Offset: 0x0025A8D4
|
|
[Token(Token = "0x600ADF7")]
|
|
[Address(RVA = "0x6F7AC0", Offset = "0x6F6AC0", VA = "0x1806F7AC0")]
|
|
public static sbyte GetMu(ECFieldElement curveA)
|
|
{
|
|
bool isOne = curveA.IsOne;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600ADF8 RID: 44536 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x600ADF8")]
|
|
[Address(RVA = "0x6F7B00", Offset = "0x6F6B00", VA = "0x1806F7B00")]
|
|
public static sbyte GetMu(int curveA)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x0600ADF9 RID: 44537 RVA: 0x0025C6F0 File Offset: 0x0025A8F0
|
|
[Token(Token = "0x600ADF9")]
|
|
[Address(RVA = "0x6F7790", Offset = "0x6F6790", VA = "0x1806F7790")]
|
|
public static BigInteger[] GetLucas(sbyte mu, int k, bool doV)
|
|
{
|
|
sbyte b = mu + 1;
|
|
if (!doV)
|
|
{
|
|
}
|
|
BigInteger two = BigInteger.Two;
|
|
BigInteger bigInteger2;
|
|
BigInteger bigInteger4;
|
|
if (k > 1)
|
|
{
|
|
BigInteger bigInteger = bigInteger2.Negate();
|
|
BigInteger bigInteger3 = two.ShiftLeft(1);
|
|
bigInteger4 = bigInteger2.Subtract(bigInteger3);
|
|
}
|
|
BigInteger[] array = new BigInteger[2];
|
|
if (bigInteger2 != 0)
|
|
{
|
|
}
|
|
array[0] = bigInteger2;
|
|
if (bigInteger4 != 0)
|
|
{
|
|
}
|
|
array[1] = bigInteger4;
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x0600ADFA RID: 44538 RVA: 0x0025C75C File Offset: 0x0025A95C
|
|
[Token(Token = "0x600ADFA")]
|
|
[Address(RVA = "0x6F8530", Offset = "0x6F7530", VA = "0x1806F8530")]
|
|
public static BigInteger GetTw(sbyte mu, int w)
|
|
{
|
|
if (w != 4)
|
|
{
|
|
int num = 0;
|
|
BigInteger[] lucas = Tnaf.GetLucas(mu, w, num != 0);
|
|
BigInteger bigInteger = BigInteger.Zero.SetBit(w);
|
|
BigInteger bigInteger2 = lucas[1].ModInverse(bigInteger);
|
|
BigInteger two = BigInteger.Two;
|
|
BigInteger bigInteger3 = lucas[0];
|
|
return two.Multiply(bigInteger3).Multiply(bigInteger2).Mod(bigInteger);
|
|
}
|
|
BigInteger bigInteger4;
|
|
return bigInteger4;
|
|
}
|
|
|
|
// Token: 0x0600ADFB RID: 44539 RVA: 0x0025C7C4 File Offset: 0x0025A9C4
|
|
[Token(Token = "0x600ADFB")]
|
|
[Address(RVA = "0x6F7DC0", Offset = "0x6F6DC0", VA = "0x1806F7DC0")]
|
|
public static BigInteger[] GetSi(AbstractF2mCurve curve)
|
|
{
|
|
while (curve.GetSi() == 0)
|
|
{
|
|
}
|
|
string text = curve.ToString();
|
|
IFiniteField field = curve.Field;
|
|
BigInteger order = curve.Order;
|
|
int num = 0;
|
|
int shiftsForCofactor = Tnaf.GetShiftsForCofactor(order);
|
|
int num2;
|
|
text -= num2;
|
|
int num3 = 0;
|
|
uint num4;
|
|
BigInteger[] lucas = Tnaf.GetLucas((sbyte)num4, num, num3 != 0);
|
|
if (num4 == (uint)1)
|
|
{
|
|
BigInteger bigInteger = lucas[0].Negate();
|
|
if (bigInteger != 0)
|
|
{
|
|
}
|
|
lucas[0] = bigInteger;
|
|
BigInteger bigInteger2 = lucas[1].Negate();
|
|
if (bigInteger2 != 0)
|
|
{
|
|
}
|
|
lucas[1] = bigInteger2;
|
|
}
|
|
BigInteger one = BigInteger.One;
|
|
BigInteger bigInteger3 = lucas[1];
|
|
BigInteger bigInteger4 = one.Add(bigInteger3).ShiftRight(shiftsForCofactor);
|
|
BigInteger one2 = BigInteger.One;
|
|
BigInteger bigInteger5 = lucas[0];
|
|
BigInteger bigInteger6 = one2.Add(bigInteger5).ShiftRight(shiftsForCofactor).Negate();
|
|
BigInteger[] array = new BigInteger[2];
|
|
if (bigInteger4 != 0)
|
|
{
|
|
}
|
|
array[0] = bigInteger4;
|
|
if (bigInteger6 != 0)
|
|
{
|
|
}
|
|
array[1] = bigInteger6;
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x0600ADFC RID: 44540 RVA: 0x0025C8CC File Offset: 0x0025AACC
|
|
[Token(Token = "0x600ADFC")]
|
|
[Address(RVA = "0x6F81E0", Offset = "0x6F71E0", VA = "0x1806F81E0")]
|
|
public static BigInteger[] GetSi(int fieldSize, int curveA, BigInteger cofactor)
|
|
{
|
|
int num = 0;
|
|
int shiftsForCofactor = Tnaf.GetShiftsForCofactor(cofactor);
|
|
int num2 = 0;
|
|
uint num3;
|
|
BigInteger[] lucas = Tnaf.GetLucas((sbyte)num3, num, num2 != 0);
|
|
if (curveA != 0)
|
|
{
|
|
BigInteger bigInteger = lucas[0].Negate();
|
|
if (bigInteger != 0)
|
|
{
|
|
}
|
|
lucas[0] = bigInteger;
|
|
BigInteger bigInteger2 = lucas[1].Negate();
|
|
if (bigInteger2 != 0)
|
|
{
|
|
}
|
|
lucas[1] = bigInteger2;
|
|
}
|
|
BigInteger one = BigInteger.One;
|
|
BigInteger bigInteger3 = lucas[1];
|
|
BigInteger bigInteger4 = one.Add(bigInteger3).ShiftRight(shiftsForCofactor);
|
|
BigInteger one2 = BigInteger.One;
|
|
BigInteger bigInteger5 = lucas[0];
|
|
BigInteger bigInteger6 = one2.Add(bigInteger5).ShiftRight(shiftsForCofactor).Negate();
|
|
BigInteger[] array = new BigInteger[2];
|
|
if (bigInteger4 != 0)
|
|
{
|
|
}
|
|
array[0] = bigInteger4;
|
|
if (bigInteger6 != 0)
|
|
{
|
|
}
|
|
array[1] = bigInteger6;
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x0600ADFD RID: 44541 RVA: 0x0025C9A8 File Offset: 0x0025ABA8
|
|
[Token(Token = "0x600ADFD")]
|
|
[Address(RVA = "0x6F7D20", Offset = "0x6F6D20", VA = "0x1806F7D20")]
|
|
protected static int GetShiftsForCofactor(BigInteger h)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600ADFD)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Abc.Tnaf::GetShiftsForCofactor(BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_20:
|
|
stloc:ArgumentException(var_1_2A, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("h (Cofactor) must be 2 or 4")))
|
|
}
|
|
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x0600ADFE RID: 44542 RVA: 0x0025C9E0 File Offset: 0x0025ABE0
|
|
[Token(Token = "0x600ADFE")]
|
|
[Address(RVA = "0x6F8F10", Offset = "0x6F7F10", VA = "0x1806F8F10")]
|
|
public static ZTauElement PartModReduction(BigInteger k, int m, sbyte a, BigInteger[] s, sbyte mu, sbyte c)
|
|
{
|
|
int length = s.Length;
|
|
BigInteger bigInteger = s[0];
|
|
BigInteger bigInteger2 = s[1];
|
|
BigInteger bigInteger3 = bigInteger.Subtract(bigInteger2);
|
|
BigInteger bigInteger4 = s[0];
|
|
BigInteger bigInteger5 = s[1];
|
|
BigInteger bigInteger6 = bigInteger4.Add(bigInteger5);
|
|
ZTauElement ztauElement;
|
|
BigInteger u = ztauElement.u;
|
|
BigInteger bigInteger7 = bigInteger6.Multiply(u);
|
|
BigInteger bigInteger8 = k.Subtract(bigInteger7);
|
|
BigInteger bigInteger9 = s[1];
|
|
BigInteger bigInteger11;
|
|
BigInteger bigInteger10 = bigInteger11.Multiply(bigInteger9);
|
|
BigInteger v = ztauElement.v;
|
|
BigInteger bigInteger12 = bigInteger10.Multiply(v);
|
|
BigInteger bigInteger13 = bigInteger8.Subtract(bigInteger12);
|
|
BigInteger bigInteger14 = s[1];
|
|
BigInteger u2 = ztauElement.u;
|
|
BigInteger bigInteger15 = bigInteger14.Multiply(u2);
|
|
BigInteger bigInteger16 = s[0];
|
|
BigInteger v2 = ztauElement.v;
|
|
BigInteger bigInteger17 = bigInteger16.Multiply(v2);
|
|
BigInteger bigInteger18 = bigInteger15.Subtract(bigInteger17);
|
|
ZTauElement ztauElement2;
|
|
ztauElement2.u = bigInteger13;
|
|
ztauElement2.v = bigInteger18;
|
|
return ztauElement2;
|
|
}
|
|
|
|
// Token: 0x0600ADFF RID: 44543 RVA: 0x0025CADC File Offset: 0x0025ACDC
|
|
[Token(Token = "0x600ADFF")]
|
|
[Address(RVA = "0x6F8940", Offset = "0x6F7940", VA = "0x1806F8940")]
|
|
public static AbstractF2mPoint MultiplyRTnaf(AbstractF2mPoint p, BigInteger k)
|
|
{
|
|
bool flag;
|
|
do
|
|
{
|
|
flag = p.SatisfiesOrder();
|
|
}
|
|
while (!flag);
|
|
string text = flag.ToString();
|
|
bool flag2;
|
|
flag = flag2;
|
|
string text2 = flag.ToString();
|
|
ZTauElement ztauElement;
|
|
return Tnaf.MultiplyTnaf(p, ztauElement);
|
|
}
|
|
|
|
// Token: 0x0600AE00 RID: 44544 RVA: 0x0025CB18 File Offset: 0x0025AD18
|
|
[Token(Token = "0x600AE00")]
|
|
[Address(RVA = "0x6F8AE0", Offset = "0x6F7AE0", VA = "0x1806F8AE0")]
|
|
public static AbstractF2mPoint MultiplyTnaf(AbstractF2mPoint p, ZTauElement lambda)
|
|
{
|
|
bool flag;
|
|
do
|
|
{
|
|
flag = p.SatisfiesOrder();
|
|
}
|
|
while (!flag || !flag);
|
|
sbyte[] array;
|
|
return Tnaf.MultiplyFromTnaf(p, array);
|
|
}
|
|
|
|
// Token: 0x0600AE01 RID: 44545 RVA: 0x0025CB48 File Offset: 0x0025AD48
|
|
[Token(Token = "0x600AE01")]
|
|
[Address(RVA = "0x6F8710", Offset = "0x6F7710", VA = "0x1806F8710")]
|
|
public static AbstractF2mPoint MultiplyFromTnaf(AbstractF2mPoint p, sbyte[] u)
|
|
{
|
|
for (;;)
|
|
{
|
|
bool flag = p.SatisfiesOrder();
|
|
object obj;
|
|
if (obj == 0)
|
|
{
|
|
}
|
|
if (obj != 0)
|
|
{
|
|
ECPoint ecpoint;
|
|
if (ecpoint == 0)
|
|
{
|
|
}
|
|
if (ecpoint != 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
int num = 0;
|
|
int length = u.Length;
|
|
num++;
|
|
if (0 > 0)
|
|
{
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600AE02 RID: 44546 RVA: 0x0025CB8C File Offset: 0x0025AD8C
|
|
[Token(Token = "0x600AE02")]
|
|
[Address(RVA = "0x6F9C10", Offset = "0x6F8C10", VA = "0x1806F9C10")]
|
|
public static sbyte[] TauAdicWNaf(sbyte mu, ZTauElement lambda, sbyte width, BigInteger pow2w, BigInteger tw, ZTauElement[] alpha)
|
|
{
|
|
sbyte b = mu + 1;
|
|
BigInteger bigInteger = Tnaf.Norm(mu, lambda);
|
|
int num = 0;
|
|
int bitLength = bigInteger.BitLength;
|
|
if (bitLength > 30)
|
|
{
|
|
num += 4;
|
|
num += bitLength;
|
|
}
|
|
num += 34;
|
|
sbyte[] array = new sbyte[num];
|
|
BigInteger bigInteger2 = pow2w.ShiftRight(1);
|
|
BigInteger u = lambda.u;
|
|
int num2 = 0;
|
|
BigInteger v = lambda.v;
|
|
int num3 = 0;
|
|
if (!u.TestBit(num3))
|
|
{
|
|
}
|
|
BigInteger bigInteger4;
|
|
BigInteger bigInteger3 = u.Add(bigInteger4).Mod(pow2w);
|
|
int num4 = bigInteger3.CompareTo(bigInteger2);
|
|
int intValue = bigInteger3.IntValue;
|
|
int num5 = 0;
|
|
BigInteger bigInteger5;
|
|
int intValue2 = bigInteger5.IntValue;
|
|
BigInteger bigInteger6 = u.Add(num5);
|
|
BigInteger bigInteger7 = v.Add(num5);
|
|
BigInteger bigInteger8 = bigInteger6.Subtract(num5);
|
|
BigInteger bigInteger9 = v.Subtract(num5);
|
|
BigInteger bigInteger10 = bigInteger8.ShiftRight(1);
|
|
BigInteger bigInteger11 = bigInteger9.Subtract(bigInteger10);
|
|
BigInteger bigInteger12 = bigInteger9.Add(bigInteger11);
|
|
BigInteger bigInteger13 = bigInteger8.ShiftRight(1).Negate();
|
|
num2++;
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x0600AE03 RID: 44547 RVA: 0x0025CC94 File Offset: 0x0025AE94
|
|
[Token(Token = "0x600AE03")]
|
|
[Address(RVA = "0x6F7B20", Offset = "0x6F6B20", VA = "0x1806F7B20")]
|
|
public static AbstractF2mPoint[] GetPreComp(AbstractF2mPoint p, sbyte a)
|
|
{
|
|
sbyte[][] alpha1Tnaf = Tnaf.Alpha1Tnaf;
|
|
int num = alpha1Tnaf.Length;
|
|
num++;
|
|
AbstractF2mPoint[] array = new AbstractF2mPoint[num];
|
|
if (p != 0)
|
|
{
|
|
}
|
|
array[0] = p;
|
|
uint num2;
|
|
if (alpha1Tnaf.Length > (int)num2)
|
|
{
|
|
sbyte[] array2 = alpha1Tnaf[(int)num2];
|
|
AbstractF2mPoint abstractF2mPoint = Tnaf.MultiplyFromTnaf(p, array2);
|
|
throw new ArrayTypeMismatchException();
|
|
}
|
|
bool flag = p.SatisfiesOrder();
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x0600AE04 RID: 44548 RVA: 0x0025CD04 File Offset: 0x0025AF04
|
|
[Token(Token = "0x600AE04")]
|
|
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
|
|
public Tnaf()
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600AE05 RID: 44549 RVA: 0x0025CD18 File Offset: 0x0025AF18
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x600AE05")]
|
|
[Address(RVA = "0x6FA0C0", Offset = "0x6F90C0", VA = "0x1806FA0C0")]
|
|
static Tnaf()
|
|
{
|
|
BigInteger bigInteger;
|
|
Tnaf.Four = bigInteger;
|
|
ZTauElement[] array = new ZTauElement[9];
|
|
BigInteger one = BigInteger.One;
|
|
BigInteger zero = BigInteger.Zero;
|
|
ZTauElement ztauElement;
|
|
ztauElement.u = one;
|
|
ztauElement.v = zero;
|
|
array[1] = ztauElement;
|
|
BigInteger minusThree = Tnaf.MinusThree;
|
|
BigInteger minusOne = Tnaf.MinusOne;
|
|
ZTauElement ztauElement2;
|
|
ztauElement2.u = minusThree;
|
|
ztauElement2.v = minusOne;
|
|
array[3] = ztauElement2;
|
|
BigInteger minusOne2 = Tnaf.MinusOne;
|
|
ZTauElement ztauElement3;
|
|
ztauElement3.u = minusOne2;
|
|
ztauElement3.v = minusOne2;
|
|
array[5] = ztauElement3;
|
|
BigInteger one2 = BigInteger.One;
|
|
BigInteger minusOne3 = Tnaf.MinusOne;
|
|
ZTauElement ztauElement4;
|
|
ztauElement4.u = one2;
|
|
ztauElement4.v = minusOne3;
|
|
array[7] = ztauElement4;
|
|
Tnaf.Alpha0 = array;
|
|
sbyte[][] array2 = new sbyte[8][];
|
|
array2[1] = new sbyte[] { (sbyte)((ulong)1L) };
|
|
sbyte[] array3 = new sbyte[3];
|
|
array3[0] = (sbyte)((ulong)255L);
|
|
array3[0] = (sbyte)((ulong)1L);
|
|
array2[3] = array3;
|
|
sbyte[] array4 = new sbyte[3];
|
|
array4[0] = (sbyte)((ulong)1L);
|
|
array4[0] = (sbyte)((ulong)1L);
|
|
array2[5] = array4;
|
|
sbyte[] array5 = new sbyte[4];
|
|
array5[0] = (sbyte)((ulong)255L);
|
|
array5[0] = (sbyte)((ulong)1L);
|
|
array2[7] = array5;
|
|
Tnaf.Alpha0Tnaf = array2;
|
|
ZTauElement[] array6 = new ZTauElement[9];
|
|
BigInteger one3 = BigInteger.One;
|
|
BigInteger zero2 = BigInteger.Zero;
|
|
ZTauElement ztauElement5;
|
|
ztauElement5.u = one3;
|
|
ztauElement5.v = zero2;
|
|
array6[1] = ztauElement5;
|
|
BigInteger minusThree2 = Tnaf.MinusThree;
|
|
BigInteger one4 = BigInteger.One;
|
|
ZTauElement ztauElement6;
|
|
ztauElement6.u = minusThree2;
|
|
ztauElement6.v = one4;
|
|
array6[3] = ztauElement6;
|
|
BigInteger minusOne4 = Tnaf.MinusOne;
|
|
BigInteger one5 = BigInteger.One;
|
|
ZTauElement ztauElement7;
|
|
ztauElement7.u = minusOne4;
|
|
ztauElement7.v = one5;
|
|
array6[5] = ztauElement7;
|
|
BigInteger one6 = BigInteger.One;
|
|
ZTauElement ztauElement8;
|
|
ztauElement8.u = one6;
|
|
ztauElement8.v = one6;
|
|
array6[7] = ztauElement8;
|
|
Tnaf.Alpha1 = array6;
|
|
sbyte[][] array7 = new sbyte[8][];
|
|
array7[1] = new sbyte[] { (sbyte)((ulong)1L) };
|
|
sbyte[] array8 = new sbyte[3];
|
|
array8[0] = (sbyte)((ulong)255L);
|
|
array8[0] = (sbyte)((ulong)1L);
|
|
array7[3] = array8;
|
|
sbyte[] array9 = new sbyte[3];
|
|
array9[0] = (sbyte)((ulong)1L);
|
|
array9[0] = (sbyte)((ulong)1L);
|
|
array7[5] = array9;
|
|
sbyte[] array10 = new sbyte[4];
|
|
array10[0] = (sbyte)((ulong)255L);
|
|
array10[0] = (sbyte)((ulong)255L);
|
|
array7[7] = array10;
|
|
Tnaf.Alpha1Tnaf = array7;
|
|
}
|
|
|
|
// Token: 0x04006E40 RID: 28224
|
|
[Token(Token = "0x4006E40")]
|
|
private static readonly BigInteger MinusOne = BigInteger.One.Negate();
|
|
|
|
// Token: 0x04006E41 RID: 28225
|
|
[Token(Token = "0x4006E41")]
|
|
private static readonly BigInteger MinusTwo = BigInteger.Two.Negate();
|
|
|
|
// Token: 0x04006E42 RID: 28226
|
|
[Token(Token = "0x4006E42")]
|
|
private static readonly BigInteger MinusThree = BigInteger.Three.Negate();
|
|
|
|
// Token: 0x04006E43 RID: 28227
|
|
[Token(Token = "0x4006E43")]
|
|
private static readonly BigInteger Four;
|
|
|
|
// Token: 0x04006E44 RID: 28228
|
|
[Token(Token = "0x4006E44")]
|
|
public const sbyte Width = 4;
|
|
|
|
// Token: 0x04006E45 RID: 28229
|
|
[Token(Token = "0x4006E45")]
|
|
public const sbyte Pow2Width = 16;
|
|
|
|
// Token: 0x04006E46 RID: 28230
|
|
[Token(Token = "0x4006E46")]
|
|
public static readonly ZTauElement[] Alpha0;
|
|
|
|
// Token: 0x04006E47 RID: 28231
|
|
[Token(Token = "0x4006E47")]
|
|
public static readonly sbyte[][] Alpha0Tnaf;
|
|
|
|
// Token: 0x04006E48 RID: 28232
|
|
[Token(Token = "0x4006E48")]
|
|
public static readonly ZTauElement[] Alpha1;
|
|
|
|
// Token: 0x04006E49 RID: 28233
|
|
[Token(Token = "0x4006E49")]
|
|
public static readonly sbyte[][] Alpha1Tnaf;
|
|
}
|
|
}
|