summary refs log tree commit diff
path: root/crypto/src/math
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2018-10-22 12:24:38 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2018-10-22 12:24:38 +0700
commitb75ace683b656dbd5fd390557fb5800846822737 (patch)
tree4fccedc9160d6d64661f9629dd5f2cb55d5048e2 /crypto/src/math
parentDon't try to track unrecognized hash algorithms (diff)
downloadBouncyCastle.NET-ed25519-b75ace683b656dbd5fd390557fb5800846822737.tar.xz
Add GeneratePublicKey method for completeness
Diffstat (limited to 'crypto/src/math')
-rw-r--r--crypto/src/math/ec/rfc7748/X25519.cs5
-rw-r--r--crypto/src/math/ec/rfc7748/X448.cs5
2 files changed, 10 insertions, 0 deletions
diff --git a/crypto/src/math/ec/rfc7748/X25519.cs b/crypto/src/math/ec/rfc7748/X25519.cs
index 8524b9e2c..5c408ae42 100644
--- a/crypto/src/math/ec/rfc7748/X25519.cs
+++ b/crypto/src/math/ec/rfc7748/X25519.cs
@@ -60,6 +60,11 @@ namespace Org.BouncyCastle.Math.EC.Rfc7748
             k[ScalarSize - 1] |= 0x40;
         }
 
+        public static void GeneratePublicKey(byte[] k, int kOff, byte[] r, int rOff)
+        {
+            ScalarMultBase(k, kOff, r, rOff);
+        }
+
         private static void PointDouble(int[] x, int[] z)
         {
             int[] A = X25519Field.Create();
diff --git a/crypto/src/math/ec/rfc7748/X448.cs b/crypto/src/math/ec/rfc7748/X448.cs
index 63e526703..7ee0bdbd4 100644
--- a/crypto/src/math/ec/rfc7748/X448.cs
+++ b/crypto/src/math/ec/rfc7748/X448.cs
@@ -61,6 +61,11 @@ namespace Org.BouncyCastle.Math.EC.Rfc7748
             k[ScalarSize - 1] |= 0x80;
         }
 
+        public static void GeneratePublicKey(byte[] k, int kOff, byte[] r, int rOff)
+        {
+            ScalarMultBase(k, kOff, r, rOff);
+        }
+
         private static void PointDouble(uint[] x, uint[] z)
         {
             uint[] A = X448Field.Create();