summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-06-23 22:47:12 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-06-23 22:47:12 +0700
commit6d150d98edd0abd4d0c9df966681d2b6a0defe38 (patch)
tree289f6c5a6d09f92867c349a9fbd97a54a4ebdbc5
parentInitial merge of PQC port (diff)
downloadBouncyCastle.NET-ed25519-6d150d98edd0abd4d0c9df966681d2b6a0defe38.tar.xz
Replace Assembly.GetExecutingAssembly calls
-rw-r--r--crypto/src/AssemblyInfo.cs2
-rw-r--r--crypto/src/pqc/crypto/picnic/LowmcConstants.cs13
-rw-r--r--crypto/test/src/util/test/SimpleTest.cs6
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)