412 lines
25 KiB
C#
412 lines
25 KiB
C#
using System;
|
|
using System.Text;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.JPake
|
|
{
|
|
// Token: 0x02001D1F RID: 7455
|
|
[Token(Token = "0x2001D1F")]
|
|
public abstract class JPakeUtilities
|
|
{
|
|
// Token: 0x0600BCC0 RID: 48320 RVA: 0x002AF2A0 File Offset: 0x002AD4A0
|
|
[Token(Token = "0x600BCC0")]
|
|
[Address(RVA = "0x200D890", Offset = "0x200C690", VA = "0x18200D890")]
|
|
public static BigInteger GenerateX1(BigInteger q, SecureRandom random)
|
|
{
|
|
BigInteger zero = JPakeUtilities.Zero;
|
|
BigInteger one = JPakeUtilities.One;
|
|
BigInteger bigInteger = q.Subtract(one);
|
|
return BigIntegers.CreateRandomInRange(zero, bigInteger, random);
|
|
}
|
|
|
|
// Token: 0x0600BCC1 RID: 48321 RVA: 0x002AF2D0 File Offset: 0x002AD4D0
|
|
[Token(Token = "0x600BCC1")]
|
|
[Address(RVA = "0x200D930", Offset = "0x200C730", VA = "0x18200D930")]
|
|
public static BigInteger GenerateX2(BigInteger q, SecureRandom random)
|
|
{
|
|
BigInteger one = JPakeUtilities.One;
|
|
BigInteger bigInteger = q.Subtract(one);
|
|
return BigIntegers.CreateRandomInRange(one, bigInteger, random);
|
|
}
|
|
|
|
// Token: 0x0600BCC2 RID: 48322 RVA: 0x002AF2FC File Offset: 0x002AD4FC
|
|
[Token(Token = "0x600BCC2")]
|
|
[Address(RVA = "0x200D5D0", Offset = "0x200C3D0", VA = "0x18200D5D0")]
|
|
public static BigInteger CalculateS(char[] password)
|
|
{
|
|
Encoding utf = Encoding.UTF8;
|
|
BigInteger bigInteger;
|
|
return bigInteger;
|
|
}
|
|
|
|
// Token: 0x0600BCC3 RID: 48323 RVA: 0x002AF318 File Offset: 0x002AD518
|
|
[Token(Token = "0x600BCC3")]
|
|
[Address(RVA = "0x1A2ACD0", Offset = "0x1A29AD0", VA = "0x181A2ACD0")]
|
|
public static BigInteger CalculateGx(BigInteger p, BigInteger g, BigInteger x)
|
|
{
|
|
return g.ModPow(x, p);
|
|
}
|
|
|
|
// Token: 0x0600BCC4 RID: 48324 RVA: 0x002AF334 File Offset: 0x002AD534
|
|
[Token(Token = "0x600BCC4")]
|
|
[Address(RVA = "0x200CCB0", Offset = "0x200BAB0", VA = "0x18200CCB0")]
|
|
public static BigInteger CalculateGA(BigInteger p, BigInteger gx1, BigInteger gx3, BigInteger gx4)
|
|
{
|
|
return gx1.Multiply(gx3).Multiply(gx4).Mod(p);
|
|
}
|
|
|
|
// Token: 0x0600BCC5 RID: 48325 RVA: 0x002AF35C File Offset: 0x002AD55C
|
|
[Token(Token = "0x600BCC5")]
|
|
[Address(RVA = "0x200D650", Offset = "0x200C450", VA = "0x18200D650")]
|
|
public static BigInteger CalculateX2s(BigInteger q, BigInteger x2, BigInteger s)
|
|
{
|
|
return x2.Multiply(s).Mod(q);
|
|
}
|
|
|
|
// Token: 0x0600BCC6 RID: 48326 RVA: 0x002AF37C File Offset: 0x002AD57C
|
|
[Token(Token = "0x600BCC6")]
|
|
[Address(RVA = "0x200CC80", Offset = "0x200BA80", VA = "0x18200CC80")]
|
|
public static BigInteger CalculateA(BigInteger p, BigInteger q, BigInteger gA, BigInteger x2s)
|
|
{
|
|
return gA.ModPow(x2s, p);
|
|
}
|
|
|
|
// Token: 0x0600BCC7 RID: 48327 RVA: 0x002AF398 File Offset: 0x002AD598
|
|
[Token(Token = "0x600BCC7")]
|
|
[Address(RVA = "0x200D690", Offset = "0x200C490", VA = "0x18200D690")]
|
|
public static BigInteger[] CalculateZeroKnowledgeProof(BigInteger p, BigInteger q, BigInteger g, BigInteger gx, BigInteger x, string participantId, IDigest digest, SecureRandom random)
|
|
{
|
|
BigInteger zero = JPakeUtilities.Zero;
|
|
BigInteger one = JPakeUtilities.One;
|
|
BigInteger bigInteger = q.Subtract(one);
|
|
BigInteger bigInteger3;
|
|
BigInteger bigInteger2 = g.ModPow(bigInteger3, p);
|
|
BigInteger[] array = new BigInteger[2];
|
|
if (bigInteger2 != 0)
|
|
{
|
|
}
|
|
array[0] = bigInteger2;
|
|
BigInteger bigInteger5;
|
|
BigInteger bigInteger4 = bigInteger3.Subtract(bigInteger5).Mod(q);
|
|
if (bigInteger4 != 0)
|
|
{
|
|
}
|
|
array[1] = bigInteger4;
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x0600BCC8 RID: 48328 RVA: 0x002AF404 File Offset: 0x002AD604
|
|
[Token(Token = "0x600BCC8")]
|
|
[Address(RVA = "0x200CD10", Offset = "0x200BB10", VA = "0x18200CD10")]
|
|
private static BigInteger CalculateHashForZeroKnowledgeProof(BigInteger g, BigInteger gr, BigInteger gx, string participantId, IDigest digest)
|
|
{
|
|
byte[] array = BigIntegers.AsUnsignedByteArray(g);
|
|
byte[] array2 = BigIntegers.AsUnsignedByteArray(gr);
|
|
byte[] array3 = BigIntegers.AsUnsignedByteArray(gx);
|
|
Encoding utf = Encoding.UTF8;
|
|
byte[] array4;
|
|
return new BigInteger(array4);
|
|
}
|
|
|
|
// Token: 0x0600BCC9 RID: 48329 RVA: 0x002AF43C File Offset: 0x002AD63C
|
|
[Token(Token = "0x600BCC9")]
|
|
[Address(RVA = "0x200DFC0", Offset = "0x200CDC0", VA = "0x18200DFC0")]
|
|
public static void ValidateGx4(BigInteger gx4)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600BCCA RID: 48330 RVA: 0x002AF454 File Offset: 0x002AD654
|
|
[Token(Token = "0x600BCCA")]
|
|
[Address(RVA = "0x200DF10", Offset = "0x200CD10", VA = "0x18200DF10")]
|
|
public static void ValidateGa(BigInteger ga)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600BCCB RID: 48331 RVA: 0x002AF46C File Offset: 0x002AD66C
|
|
[Token(Token = "0x600BCCB")]
|
|
[Address(RVA = "0x200E420", Offset = "0x200D220", VA = "0x18200E420")]
|
|
public static void ValidateZeroKnowledgeProof(BigInteger p, BigInteger q, BigInteger g, BigInteger gx, BigInteger[] zeroKnowledgeProof, string participantId, IDigest digest)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BCCB)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.JPake.JPakeUtilities::ValidateZeroKnowledgeProof(BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger[],System.String,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IDigest)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_69:
|
|
stloc:CryptoException(var_7_73, newobj:CryptoException(CryptoException::.ctor, ldstr:string("Zero-knowledge proof validation failed")))
|
|
}
|
|
|
|
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 1660
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x0600BCCC RID: 48332 RVA: 0x002AF4F0 File Offset: 0x002AD6F0
|
|
[Token(Token = "0x600BCCC")]
|
|
[Address(RVA = "0x200CF70", Offset = "0x200BD70", VA = "0x18200CF70")]
|
|
public static BigInteger CalculateKeyingMaterial(BigInteger p, BigInteger q, BigInteger gx4, BigInteger x2, BigInteger s, BigInteger B)
|
|
{
|
|
BigInteger bigInteger2;
|
|
BigInteger bigInteger = bigInteger2.Negate().Mod(q);
|
|
BigInteger bigInteger3 = gx4.ModPow(bigInteger, p);
|
|
BigInteger bigInteger4;
|
|
return bigInteger4.ModPow(x2, p);
|
|
}
|
|
|
|
// Token: 0x0600BCCD RID: 48333 RVA: 0x002AF524 File Offset: 0x002AD724
|
|
[Token(Token = "0x600BCCD")]
|
|
[Address(RVA = "0x200E200", Offset = "0x200D000", VA = "0x18200E200")]
|
|
public static void ValidateParticipantIdsDiffer(string participantId1, string participantId2)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BCCD)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.JPake.JPakeUtilities::ValidateParticipantIdsDiffer(System.String,System.String)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_0B:
|
|
stloc:CryptoException(var_0_20, newobj:CryptoException(CryptoException::.ctor, call:string(string::Concat, ldstr:string("Both participants are using the same participantId ("), ldloc:string(participantId1), ldstr:string("). This is not allowed. Each participant must use a unique participantId."))))
|
|
}
|
|
|
|
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 1660
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x0600BCCE RID: 48334 RVA: 0x002AF554 File Offset: 0x002AD754
|
|
[Token(Token = "0x600BCCE")]
|
|
[Address(RVA = "0x200E2A0", Offset = "0x200D0A0", VA = "0x18200E2A0")]
|
|
public static void ValidateParticipantIdsEqual(string expectedParticipantId, string actualParticipantId)
|
|
{
|
|
if (expectedParticipantId.Equals(actualParticipantId))
|
|
{
|
|
return;
|
|
}
|
|
string[] array = new string[5];
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600BCCF RID: 48335 RVA: 0x002AF5E0 File Offset: 0x002AD7E0
|
|
[Token(Token = "0x600BCCF")]
|
|
[Address(RVA = "0x200E190", Offset = "0x200CF90", VA = "0x18200E190")]
|
|
public static void ValidateNotNull(object obj, string description)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BCCF)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.JPake.JPakeUtilities::ValidateNotNull(System.Object,System.String)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_05:
|
|
stloc:ArgumentNullException(var_0_0B, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldloc:string(description)))
|
|
}
|
|
|
|
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 1660
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x0600BCD0 RID: 48336 RVA: 0x002AF5F8 File Offset: 0x002AD7F8
|
|
[Token(Token = "0x600BCD0")]
|
|
[Address(RVA = "0x200D1A0", Offset = "0x200BFA0", VA = "0x18200D1A0")]
|
|
public static BigInteger CalculateMacTag(string participantId, string partnerParticipantId, BigInteger gx1, BigInteger gx2, BigInteger gx3, BigInteger gx4, BigInteger keyingMaterial, IDigest digest)
|
|
{
|
|
Encoding utf = Encoding.UTF8;
|
|
byte[] array;
|
|
KeyParameter keyParameter = new KeyParameter(array);
|
|
HMac hmac;
|
|
IDigest underlyingDigest = hmac.GetUnderlyingDigest();
|
|
int num = 0;
|
|
Arrays.Fill(array, (byte)num);
|
|
JPakeUtilities.UpdateMac(hmac, "KC_1_U");
|
|
JPakeUtilities.UpdateMac(hmac, participantId);
|
|
JPakeUtilities.UpdateMac(hmac, partnerParticipantId);
|
|
byte[] array2 = BigIntegers.AsUnsignedByteArray(gx1);
|
|
JPakeUtilities.UpdateMac(hmac, array2);
|
|
byte[] array3 = BigIntegers.AsUnsignedByteArray(gx2);
|
|
JPakeUtilities.UpdateMac(hmac, array3);
|
|
byte[] array4;
|
|
JPakeUtilities.UpdateMac(hmac, array4);
|
|
byte[] array5;
|
|
JPakeUtilities.UpdateMac(hmac, array5);
|
|
return new BigInteger(MacUtilities.DoFinal(hmac));
|
|
}
|
|
|
|
// Token: 0x0600BCD1 RID: 48337 RVA: 0x002AF690 File Offset: 0x002AD890
|
|
[Token(Token = "0x600BCD1")]
|
|
[Address(RVA = "0x200D030", Offset = "0x200BE30", VA = "0x18200D030")]
|
|
private static byte[] CalculateMacKey(BigInteger keyingMaterial, IDigest digest)
|
|
{
|
|
byte[] array = BigIntegers.AsUnsignedByteArray(keyingMaterial);
|
|
JPakeUtilities.UpdateDigest(digest, array);
|
|
Encoding utf = Encoding.UTF8;
|
|
return DigestUtilities.DoFinal(digest);
|
|
}
|
|
|
|
// Token: 0x0600BCD2 RID: 48338 RVA: 0x002AF6C0 File Offset: 0x002AD8C0
|
|
[Token(Token = "0x600BCD2")]
|
|
[Address(RVA = "0x200E070", Offset = "0x200CE70", VA = "0x18200E070")]
|
|
public static void ValidateMacTag(string participantId, string partnerParticipantId, BigInteger gx1, BigInteger gx2, BigInteger gx3, BigInteger gx4, BigInteger keyingMaterial, IDigest digest, BigInteger partnerMacTag)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BCD2)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.JPake.JPakeUtilities::ValidateMacTag(System.String,System.String,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IDigest,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_05:
|
|
stloc:CryptoException(var_2_0F, newobj:CryptoException(CryptoException::.ctor, ldstr:string("Partner MacTag validation failed. Therefore, the password, MAC, or digest algorithm of each participant does not match.")))
|
|
}
|
|
|
|
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 1660
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x0600BCD3 RID: 48339 RVA: 0x002AF6DC File Offset: 0x002AD8DC
|
|
[Token(Token = "0x600BCD3")]
|
|
[Address(RVA = "0x200DBD0", Offset = "0x200C9D0", VA = "0x18200DBD0")]
|
|
private static void UpdateDigest(IDigest digest, BigInteger bigInteger)
|
|
{
|
|
byte[] array = BigIntegers.AsUnsignedByteArray(bigInteger);
|
|
JPakeUtilities.UpdateDigest(digest, array);
|
|
}
|
|
|
|
// Token: 0x0600BCD4 RID: 48340 RVA: 0x002AF6F8 File Offset: 0x002AD8F8
|
|
[Token(Token = "0x600BCD4")]
|
|
[Address(RVA = "0x200DCE0", Offset = "0x200CAE0", VA = "0x18200DCE0")]
|
|
private static void UpdateDigest(IDigest digest, string str)
|
|
{
|
|
Encoding utf = Encoding.UTF8;
|
|
}
|
|
|
|
// Token: 0x0600BCD5 RID: 48341 RVA: 0x002AF714 File Offset: 0x002AD914
|
|
[Token(Token = "0x600BCD5")]
|
|
[Address(RVA = "0x200DC40", Offset = "0x200CA40", VA = "0x18200DC40")]
|
|
private static void UpdateDigest(IDigest digest, byte[] bytes)
|
|
{
|
|
int length = bytes.Length;
|
|
int num = 0;
|
|
Arrays.Fill(bytes, (byte)num);
|
|
}
|
|
|
|
// Token: 0x0600BCD6 RID: 48342 RVA: 0x002AF738 File Offset: 0x002AD938
|
|
[Token(Token = "0x600BCD6")]
|
|
[Address(RVA = "0x200D9E0", Offset = "0x200C7E0", VA = "0x18200D9E0")]
|
|
private static void UpdateDigestIncludingSize(IDigest digest, BigInteger bigInteger)
|
|
{
|
|
byte[] array = BigIntegers.AsUnsignedByteArray(bigInteger);
|
|
JPakeUtilities.UpdateDigestIncludingSize(digest, array);
|
|
}
|
|
|
|
// Token: 0x0600BCD7 RID: 48343 RVA: 0x002AF754 File Offset: 0x002AD954
|
|
[Token(Token = "0x600BCD7")]
|
|
[Address(RVA = "0x200DB40", Offset = "0x200C940", VA = "0x18200DB40")]
|
|
private static void UpdateDigestIncludingSize(IDigest digest, string str)
|
|
{
|
|
Encoding utf = Encoding.UTF8;
|
|
}
|
|
|
|
// Token: 0x0600BCD8 RID: 48344 RVA: 0x002AF770 File Offset: 0x002AD970
|
|
[Token(Token = "0x600BCD8")]
|
|
[Address(RVA = "0x200DA50", Offset = "0x200C850", VA = "0x18200DA50")]
|
|
private static void UpdateDigestIncludingSize(IDigest digest, byte[] bytes)
|
|
{
|
|
byte[] array = Pack.UInt32_To_BE((uint)bytes.Length);
|
|
int length = bytes.Length;
|
|
int num = 0;
|
|
Arrays.Fill(bytes, (byte)num);
|
|
}
|
|
|
|
// Token: 0x0600BCD9 RID: 48345 RVA: 0x002AF7A4 File Offset: 0x002AD9A4
|
|
[Token(Token = "0x600BCD9")]
|
|
[Address(RVA = "0x200DD70", Offset = "0x200CB70", VA = "0x18200DD70")]
|
|
private static void UpdateMac(IMac mac, BigInteger bigInteger)
|
|
{
|
|
byte[] array = BigIntegers.AsUnsignedByteArray(bigInteger);
|
|
JPakeUtilities.UpdateMac(mac, array);
|
|
}
|
|
|
|
// Token: 0x0600BCDA RID: 48346 RVA: 0x002AF7C0 File Offset: 0x002AD9C0
|
|
[Token(Token = "0x600BCDA")]
|
|
[Address(RVA = "0x200DE80", Offset = "0x200CC80", VA = "0x18200DE80")]
|
|
private static void UpdateMac(IMac mac, string str)
|
|
{
|
|
Encoding utf = Encoding.UTF8;
|
|
}
|
|
|
|
// Token: 0x0600BCDB RID: 48347 RVA: 0x002AF7DC File Offset: 0x002AD9DC
|
|
[Token(Token = "0x600BCDB")]
|
|
[Address(RVA = "0x200DDE0", Offset = "0x200CBE0", VA = "0x18200DDE0")]
|
|
private static void UpdateMac(IMac mac, byte[] bytes)
|
|
{
|
|
int length = bytes.Length;
|
|
int num = 0;
|
|
Arrays.Fill(bytes, (byte)num);
|
|
}
|
|
|
|
// Token: 0x0600BCDC RID: 48348 RVA: 0x002AF800 File Offset: 0x002ADA00
|
|
[Token(Token = "0x600BCDC")]
|
|
[Address(RVA = "0x200D9D0", Offset = "0x200C7D0", VA = "0x18200D9D0")]
|
|
private static byte[] IntToByteArray(int value)
|
|
{
|
|
return Pack.UInt32_To_BE((uint)value);
|
|
}
|
|
|
|
// Token: 0x0600BCDD RID: 48349 RVA: 0x002AF814 File Offset: 0x002ADA14
|
|
[Token(Token = "0x600BCDD")]
|
|
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
|
protected JPakeUtilities()
|
|
{
|
|
}
|
|
|
|
// Token: 0x04007841 RID: 30785
|
|
[Token(Token = "0x4007841")]
|
|
public static readonly BigInteger Zero = BigInteger.Zero;
|
|
|
|
// Token: 0x04007842 RID: 30786
|
|
[Token(Token = "0x4007842")]
|
|
public static readonly BigInteger One = BigInteger.One;
|
|
}
|
|
}
|