Replace Assembly.GetExecutingAssembly calls
3 files changed, 5 insertions, 16 deletions
diff --git a/crypto/src/AssemblyInfo.cs b/crypto/src/AssemblyInfo.cs
index dda4619e4..568ecf594 100644
--- a/crypto/src/AssemblyInfo.cs
+++ b/crypto/src/AssemblyInfo.cs
@@ -44,7 +44,7 @@ internal class AssemblyInfo
version = v.Version;
}
#else
- version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
+ version = typeof(AssemblyInfo).Assembly.GetName().Version.ToString();
#endif
// if we're still here, then don't try again
diff --git a/crypto/src/pqc/crypto/picnic/LowmcConstants.cs b/crypto/src/pqc/crypto/picnic/LowmcConstants.cs
index e52ed1feb..8e56ee568 100644
--- a/crypto/src/pqc/crypto/picnic/LowmcConstants.cs
+++ b/crypto/src/pqc/crypto/picnic/LowmcConstants.cs
@@ -2,7 +2,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
-using System.Text;
+
using Org.BouncyCastle.Crypto.Utilities;
using Org.BouncyCastle.Pqc.Crypto.Picnic;
using Org.BouncyCastle.Utilities.Encoders;
@@ -18,10 +18,9 @@ public sealed class LowmcConstants
private LowmcConstants()
{
_matrixToHex = new Dictionary<string, string>();
- Stream input = Assembly.GetExecutingAssembly()
+ Stream input = typeof(LowmcConstants).Assembly
.GetManifestResourceStream("Org.BouncyCastle.pqc.crypto.picnic.lowmcconstants.properties");
- // string[] testlist = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames();
using (StreamReader sr = new StreamReader(input))
{
// load a properties file
@@ -42,7 +41,6 @@ public sealed class LowmcConstants
line = sr.ReadLine();
}
-
}
linearMatrices_L1 = ReadFromProperty("linearMatrices_L1", 40960);
@@ -102,13 +100,10 @@ public sealed class LowmcConstants
public static LowmcConstants Instance
{
- get
- {
- return instance;
- }
+ get { return instance; }
}
- private static Dictionary<String, String> _matrixToHex;
+ private static Dictionary<string, string> _matrixToHex;
// Parameters for security level L1
// Block/key size: 128
diff --git a/crypto/test/src/util/test/SimpleTest.cs b/crypto/test/src/util/test/SimpleTest.cs
index 8443cdf0f..fc88be103 100644
--- a/crypto/test/src/util/test/SimpleTest.cs
+++ b/crypto/test/src/util/test/SimpleTest.cs
@@ -163,13 +163,7 @@ namespace Org.BouncyCastle.Utilities.Test
private static Assembly GetAssembly()
{
-#if !PORTABLE
- return Assembly.GetExecutingAssembly();
-#elif NEW_REFLECTION
- return typeof(SimpleTest).GetTypeInfo().Assembly;
-#else
return typeof(SimpleTest).Assembly;
-#endif
}
private static string GetFullName(string name)
|