Files
Jan2021-Cpp2Il-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Crypto/Agreement/ECMqvWithKdfBasicAgreement.cs
T
2026-04-08 23:40:05 +02:00

93 lines
5.4 KiB
C#

using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Kdf;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement
{
// Token: 0x0200172F RID: 5935
[Token(Token = "0x200172F")]
[StructLayout(3)]
public class ECMqvWithKdfBasicAgreement : ECMqvBasicAgreement
{
// Token: 0x0600A073 RID: 41075 RVA: 0x002546C4 File Offset: 0x002528C4
[Token(Token = "0x600A073")]
[Address(RVA = "0x6596F0", Offset = "0x6580F0", VA = "0x1806596F0")]
public ECMqvWithKdfBasicAgreement(string algorithm, IDerivationFunction kdf)
{
/*
An exception occurred when decompiling this method (0600A073)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.ECMqvWithKdfBasicAgreement::.ctor(System.String,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IDerivationFunction)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_28:
stloc:ArgumentNullException(var_1_32, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("kdf")))
}
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: 0x0600A074 RID: 41076 RVA: 0x00254704 File Offset: 0x00252904
[Token(Token = "0x600A074")]
[Address(RVA = "0x659530", Offset = "0x657F30", VA = "0x180659530", Slot = "9")]
public override BigInteger CalculateAgreement(ICipherParameters pubKey)
{
BigInteger bigInteger = base.CalculateAgreement(pubKey);
int defaultKeySize = GeneratorUtilities.GetDefaultKeySize(this.algorithm);
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(this.algorithm);
MqvPrivateParameters privParams = this.privParams;
string text = privParams.ToString();
ECPrivateKeyParameters staticPrivateKey = privParams.staticPrivateKey;
int num;
byte[] array = X9IntegerConverter.IntegerToBytes(bigInteger, num);
DHKdfParameters dhkdfParameters;
dhkdfParameters.z = array;
int num2 = 0;
dhkdfParameters.extraInfo = num2;
dhkdfParameters.algorithm = derObjectIdentifier;
dhkdfParameters.keySize = defaultKeySize;
IDerivationFunction derivationFunction = this.kdf;
byte[] array2 = new byte[0];
IDerivationFunction derivationFunction2 = this.kdf;
int length = array2.Length;
return new BigInteger(1, array2);
}
// Token: 0x0600A075 RID: 41077 RVA: 0x002547A8 File Offset: 0x002529A8
[Token(Token = "0x600A075")]
[Address(RVA = "0x6594D0", Offset = "0x657ED0", VA = "0x1806594D0")]
private byte[] BigIntToBytes(BigInteger r)
{
MqvPrivateParameters privParams = this.privParams;
string text = privParams.ToString();
ECPrivateKeyParameters staticPrivateKey = privParams.staticPrivateKey;
int num;
return X9IntegerConverter.IntegerToBytes(r, num);
}
// Token: 0x04006986 RID: 27014
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006986")]
private readonly string algorithm;
// Token: 0x04006987 RID: 27015
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006987")]
private readonly IDerivationFunction kdf;
}
}