Move crypto to unmanaged implementation

Which is much better if Mono can handle it, should be OK
This commit is contained in:
JustArchi
2016-07-18 06:01:21 +02:00
parent 59c2e10bf1
commit 496d2910e0
2 changed files with 6 additions and 6 deletions

View File

@@ -89,7 +89,7 @@ namespace ArchiSteamFarm {
try {
byte[] key;
using (SHA256Managed sha256 = new SHA256Managed()) {
using (SHA256Cng sha256 = new SHA256Cng()) {
key = sha256.ComputeHash(EncryptionKey);
}
@@ -110,7 +110,7 @@ namespace ArchiSteamFarm {
try {
byte[] key;
using (SHA256Managed sha256 = new SHA256Managed()) {
using (SHA256Cng sha256 = new SHA256Cng()) {
key = sha256.ComputeHash(EncryptionKey);
}

View File

@@ -255,7 +255,7 @@ namespace ArchiSteamFarm {
}
byte[] hashedData;
using (HMACSHA1 hmacGenerator = new HMACSHA1(sharedSecretArray, true)) {
using (HMACSHA1 hmacGenerator = new HMACSHA1(sharedSecretArray)) {
hashedData = hmacGenerator.ComputeHash(timeArray);
}
@@ -279,9 +279,9 @@ namespace ArchiSteamFarm {
byte[] b64Secret = Convert.FromBase64String(IdentitySecret);
int bufferSize = 8;
byte bufferSize = 8;
if (string.IsNullOrEmpty(tag) == false) {
bufferSize += Math.Min(32, tag.Length);
bufferSize += (byte) Math.Min(32, tag.Length);
}
byte[] buffer = new byte[bufferSize];
@@ -297,7 +297,7 @@ namespace ArchiSteamFarm {
}
byte[] hash;
using (HMACSHA1 hmac = new HMACSHA1(b64Secret, true)) {
using (HMACSHA1 hmac = new HMACSHA1(b64Secret)) {
hash = hmac.ComputeHash(buffer);
}