summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crypto/src/math/ec/ECFieldElement.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/src/math/ec/ECFieldElement.cs b/crypto/src/math/ec/ECFieldElement.cs
index 5235c6c0e..1205cdbcb 100644
--- a/crypto/src/math/ec/ECFieldElement.cs
+++ b/crypto/src/math/ec/ECFieldElement.cs
@@ -33,7 +33,7 @@ namespace Org.BouncyCastle.Math.EC
 			return Equals(other);
 		}
 
-		protected bool Equals(
+		protected virtual bool Equals(
 			ECFieldElement other)
 		{
 			return ToBigInteger().Equals(other.ToBigInteger());
@@ -48,7 +48,12 @@ namespace Org.BouncyCastle.Math.EC
 		{
 			return this.ToBigInteger().ToString(2);
 		}
-	}
+
+        public virtual byte[] GetEncoded()
+        {
+            return BigIntegers.AsUnsignedByteArray((FieldSize + 7) / 8, ToBigInteger());
+        }
+    }
 
 	public class FpFieldElement
 		: ECFieldElement