diff --git a/Bifrost.Security/Bifrost.Security.csproj b/Bifrost.Security/Bifrost.Security.csproj index bbd3801..0a95d4f 100644 --- a/Bifrost.Security/Bifrost.Security.csproj +++ b/Bifrost.Security/Bifrost.Security.csproj @@ -1,9 +1,9 @@  - net8.0 - enable - enable + netstandard20 + disable + disable True bifrost-icon.png https://github.com/Bifrost-Technologies/Bifrost.Security diff --git a/Bifrost.Security/CryptoBytes.cs b/Bifrost.Security/CryptoBytes.cs index f875c41..f556707 100644 --- a/Bifrost.Security/CryptoBytes.cs +++ b/Bifrost.Security/CryptoBytes.cs @@ -1,4 +1,5 @@ -using System.Runtime.CompilerServices; +using System; +using System.Runtime.CompilerServices; namespace Bifrost.Security { @@ -126,7 +127,7 @@ internal static void InternalWipe(ref T data) // * I didn't use a second loop variable to index into `c`, since measurement shows that calculating it from `i` is cheaper. // * Using exactly `i < bytes.Length` as upper bound of the loop allows the JITter to eliminate bounds checks on `bytes[i]`, so I chose that variant. // * Making `b` an int avoids unnecessary conversions from and to byte. - public static string? ToHexStringUpper(byte[] data) + public static string ToHexStringUpper(byte[] data) { if (data == null) return null; @@ -144,7 +145,7 @@ internal static void InternalWipe(ref T data) // Explanation is similar to ToHexStringUpper // constant 55 -> 87 and -7 -> -39 to compensate for the offset 32 between lowercase and uppercase letters - public static string? ToHexStringLower(byte[] data) + public static string ToHexStringLower(byte[] data) { if (data == null) return null; @@ -160,7 +161,7 @@ internal static void InternalWipe(ref T data) return new string(c); } - public static byte[]? FromHexString(string hexString) + public static byte[] FromHexString(string hexString) { if (hexString == null) return null; @@ -172,14 +173,14 @@ internal static void InternalWipe(ref T data) return result; } - public static string? ToBase64String(byte[] data) + public static string ToBase64String(byte[] data) { if (data == null) return null; return Convert.ToBase64String(data); } - public static byte[]? FromBase64String(string s) + public static byte[] FromBase64String(string s) { if (s == null) return null; diff --git a/Bifrost.Security/Ed25519.cs b/Bifrost.Security/Ed25519.cs index 07a4968..3aa168b 100644 --- a/Bifrost.Security/Ed25519.cs +++ b/Bifrost.Security/Ed25519.cs @@ -1,5 +1,6 @@ #pragma warning disable CS8604 using Bifrost.Security.Internal.Ed25519Ref10; +using System; namespace Bifrost.Security { @@ -144,4 +145,4 @@ public static void KeyExchange(ArraySegment sharedKey, ArraySegment MontgomeryCurve25519.KeyExchangeOutputHashNaCl(sharedKey.Array, sharedKey.Offset); } } -} \ No newline at end of file +} diff --git a/Bifrost.Security/MontgomeryCurve25519.cs b/Bifrost.Security/MontgomeryCurve25519.cs index 8c80ace..d52d21c 100644 --- a/Bifrost.Security/MontgomeryCurve25519.cs +++ b/Bifrost.Security/MontgomeryCurve25519.cs @@ -1,6 +1,7 @@ using Bifrost.Security.Internal; using Bifrost.Security.Internal.Ed25519Ref10; using Bifrost.Security.Internal.Salsa; +using System; namespace Bifrost.Security { diff --git a/Bifrost.Security/Sha512.cs b/Bifrost.Security/Sha512.cs index c75b8b2..62afa80 100644 --- a/Bifrost.Security/Sha512.cs +++ b/Bifrost.Security/Sha512.cs @@ -1,4 +1,5 @@ using Bifrost.Security.Internal; +using System; namespace Bifrost.Security { diff --git a/Bifrost.Security/XSalsa20Poly1305.cs b/Bifrost.Security/XSalsa20Poly1305.cs index a967d08..c6141be 100644 --- a/Bifrost.Security/XSalsa20Poly1305.cs +++ b/Bifrost.Security/XSalsa20Poly1305.cs @@ -1,6 +1,7 @@ #pragma warning disable CS8604 // Possible null reference argument. using Bifrost.Security.Internal; using Bifrost.Security.Internal.Salsa; +using System; namespace Bifrost.Security { @@ -44,7 +45,7 @@ public static void Encrypt(ArraySegment ciphertext, ArraySegment mes /// Decrypts the ciphertext and verifies its authenticity /// /// Plaintext if MAC validation succeeds, null if the data is invalid. - public static byte[]? TryDecrypt(byte[] ciphertext, byte[] key, byte[] nonce) + public static byte[] TryDecrypt(byte[] ciphertext, byte[] key, byte[] nonce) { if (ciphertext == null) throw new ArgumentNullException("ciphertext");