Made EdPoint public

This commit is contained in:
Thorsten Sommer 2020-01-06 22:17:40 +01:00
parent 7822a60100
commit 61ef96db99

View File

@ -5,7 +5,7 @@ using System.Text;
namespace Ed25519 namespace Ed25519
{ {
internal struct EdPoint public struct EdPoint
{ {
public BigInteger X { get; set; } public BigInteger X { get; set; }
@ -67,7 +67,7 @@ namespace Ed25519
}; };
} }
var q = this.ScalarMul(e / Constants.TWO); var q = this.ScalarMul(BigInteger.Divide(e / Constants.TWO);
q = q.EdwardsSquare(); q = q.EdwardsSquare();
return e.IsEven ? q : q.Edwards(this); return e.IsEven ? q : q.Edwards(this);
@ -97,5 +97,10 @@ namespace Ed25519
return (yy - xx - dxxyy - 1).Mod(Constants.Q).Equals(BigInteger.Zero); return (yy - xx - dxxyy - 1).Mod(Constants.Q).Equals(BigInteger.Zero);
} }
public override string ToString()
{
return $"Point(x={this.X}; y={this.Y})";
}
} }
} }