summary refs log tree commit diff
path: root/crypto/src/math/ec/ScaleXNegateYPointMap.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2019-08-02 18:41:24 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2019-08-02 18:41:24 +0700
commitd5b186492a09c1aee253998670fc843e6087fe6e (patch)
tree011ee300b06ce58772a6fe46879c35a0a372d198 /crypto/src/math/ec/ScaleXNegateYPointMap.cs
parentProvide a constant-time zero test (diff)
downloadBouncyCastle.NET-ed25519-d5b186492a09c1aee253998670fc843e6087fe6e.tar.xz
Add experimental support for GLV Type A endomorphisms
Diffstat (limited to 'crypto/src/math/ec/ScaleXNegateYPointMap.cs')
-rw-r--r--crypto/src/math/ec/ScaleXNegateYPointMap.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/crypto/src/math/ec/ScaleXNegateYPointMap.cs b/crypto/src/math/ec/ScaleXNegateYPointMap.cs
new file mode 100644
index 000000000..b0466a633
--- /dev/null
+++ b/crypto/src/math/ec/ScaleXNegateYPointMap.cs
@@ -0,0 +1,20 @@
+using System;
+
+namespace Org.BouncyCastle.Math.EC
+{
+    public class ScaleXNegateYPointMap
+        : ECPointMap
+    {
+        protected readonly ECFieldElement scale;
+
+        public ScaleXNegateYPointMap(ECFieldElement scale)
+        {
+            this.scale = scale;
+        }
+
+        public virtual ECPoint Map(ECPoint p)
+        {
+            return p.ScaleXNegateY(scale);
+        }
+    }
+}