Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public override byte[] GetEncoded(bool compressed)
- {
- if (this.IsInfinity)
- {
- return new byte[1];
- }
- ECPoint normed = Normalize();
- byte[] X = normed.XCoord.GetEncoded();
- if (compressed)
- {
- byte[] PO = new byte[X.Length + 1];
- PO[0] = (byte)(normed.CompressionYTilde ? 0x03 : 0x02);
- Array.Copy(X, 0, PO, 1, X.Length);
- return PO;
- }
- byte[] Y = normed.YCoord.GetEncoded();
- {
- byte[] PO = new byte[X.Length + Y.Length + 1];
- PO[0] = 0x04;
- Array.Copy(X, 0, PO, 1, X.Length);
- Array.Copy(Y, 0, PO, X.Length + 1, Y.Length);
- return PO;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement