summary refs log tree commit diff
path: root/crypto/src/math/ec/rfc7748
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2019-08-29 20:00:22 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2019-08-29 20:00:22 +0700
commit13af6106b7d495c775ee69ef495b64318318d87f (patch)
treec5afdc1f7780b2b6ae9b08ac15f238df3011a688 /crypto/src/math/ec/rfc7748
parentAdd new X448 test cases from bc-java (diff)
downloadBouncyCastle.NET-ed25519-13af6106b7d495c775ee69ef495b64318318d87f.tar.xz
Add sanity checks on scalar mult. outputs
Diffstat (limited to 'crypto/src/math/ec/rfc7748')
-rw-r--r--crypto/src/math/ec/rfc7748/X448Field.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/src/math/ec/rfc7748/X448Field.cs b/crypto/src/math/ec/rfc7748/X448Field.cs
index f1e89e520..14c9b4879 100644
--- a/crypto/src/math/ec/rfc7748/X448Field.cs
+++ b/crypto/src/math/ec/rfc7748/X448Field.cs
@@ -1009,6 +1009,14 @@ namespace Org.BouncyCastle.Math.EC.Rfc7748
             z[15] = z15;
         }
 
+        public static void SubOne(uint[] z)
+        {
+            uint[] one = Create();
+            one[0] = 1U;
+
+            Sub(z, one, z);
+        }
+
         public static void Zero(uint[] z)
         {
             for (int i = 0; i < Size; ++i)