From 83bc4307036193383a96e3002fb9696d66ce0f48 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 4 Oct 2022 19:17:38 +0700 Subject: Avoid some allocations around MPInteger --- crypto/src/openpgp/PgpEncryptedDataGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crypto/src/openpgp') diff --git a/crypto/src/openpgp/PgpEncryptedDataGenerator.cs b/crypto/src/openpgp/PgpEncryptedDataGenerator.cs index f086aaf75..a86dce42d 100644 --- a/crypto/src/openpgp/PgpEncryptedDataGenerator.cs +++ b/crypto/src/openpgp/PgpEncryptedDataGenerator.cs @@ -146,7 +146,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp byte[] paddedSessionData = PgpPad.PadSessionData(sessionInfo, sessionKeyObfuscation); byte[] C = w.Wrap(paddedSessionData, 0, paddedSessionData.Length); - byte[] VB = new MPInteger(new BigInteger(1, ephPub.Q.GetEncoded(false))).GetEncoded(); + byte[] VB = new MPInteger(MPInteger.ToMpiBigInteger(ephPub.Q)).GetEncoded(); byte[] rv = new byte[VB.Length + 1 + C.Length]; -- cgit 1.5.1