From 6d150d98edd0abd4d0c9df966681d2b6a0defe38 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Thu, 23 Jun 2022 22:47:12 +0700 Subject: Replace Assembly.GetExecutingAssembly calls --- crypto/src/AssemblyInfo.cs | 2 +- crypto/src/pqc/crypto/picnic/LowmcConstants.cs | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'crypto/src') 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(); - 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 _matrixToHex; + private static Dictionary _matrixToHex; // Parameters for security level L1 // Block/key size: 128 -- cgit 1.4.1