Core/Refactor: Part 2

This commit is contained in:
hondacrx
2018-05-07 22:07:35 -04:00
parent 216db1c23a
commit 9b40067017
93 changed files with 321 additions and 388 deletions
+15 -15
View File
@@ -29,13 +29,13 @@ namespace Framework.Cryptography
public void InitializeEncryption<T>(T p, T q, T dp, T dq, T iq, bool isBigEndian = false)
{
this._p = p.ToBigInteger(isBigEndian);
this._q = q.ToBigInteger(isBigEndian);
this._dp = dp.ToBigInteger(isBigEndian);
this._dq = dq.ToBigInteger(isBigEndian);
this._iq = iq.ToBigInteger(isBigEndian);
_p = p.ToBigInteger(isBigEndian);
_q = q.ToBigInteger(isBigEndian);
_dp = dp.ToBigInteger(isBigEndian);
_dq = dq.ToBigInteger(isBigEndian);
_iq = iq.ToBigInteger(isBigEndian);
if (this._p.IsZero && this._q.IsZero)
if (_p.IsZero && _q.IsZero)
throw new InvalidOperationException("'0' isn't allowed for p or q");
else
_isEncryptionInitialized = true;
@@ -43,8 +43,8 @@ namespace Framework.Cryptography
public void InitializeDecryption<T>(T e, T n, bool reverseBytes = false)
{
this._e = e.ToBigInteger(reverseBytes);
this._n = n.ToBigInteger(reverseBytes);
_e = e.ToBigInteger(reverseBytes);
_n = n.ToBigInteger(reverseBytes);
_isDecryptionInitialized = true;
}
@@ -82,13 +82,13 @@ namespace Framework.Cryptography
public void Dispose()
{
this._e = 0;
this._n = 0;
this._p = 0;
this._q = 0;
this._dp = 0;
this._dq = 0;
this._iq = 0;
_e = 0;
_n = 0;
_p = 0;
_q = 0;
_dp = 0;
_dq = 0;
_iq = 0;
_isEncryptionInitialized = false;
_isDecryptionInitialized = false;