From 86a4479929bd5f3fa5ce2cabfe6a4ebb53944df4 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Fri, 4 Sep 2020 23:57:27 +0700 Subject: 'safegcd' modular inversion --- crypto/src/math/ec/rfc8032/Ed25519.cs | 2 +- crypto/src/math/ec/rfc8032/Ed448.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crypto/src/math/ec/rfc8032') diff --git a/crypto/src/math/ec/rfc8032/Ed25519.cs b/crypto/src/math/ec/rfc8032/Ed25519.cs index 95ba43472..3a39ae53d 100644 --- a/crypto/src/math/ec/rfc8032/Ed25519.cs +++ b/crypto/src/math/ec/rfc8032/Ed25519.cs @@ -754,7 +754,7 @@ namespace Org.BouncyCastle.Math.EC.Rfc8032 X25519Field.Add(q.z, q.z, x); // TODO[ed25519] Batch inversion - X25519Field.Inv(x, y); + X25519Field.InvVar(x, y); X25519Field.Mul(q.x, y, x); X25519Field.Mul(q.y, y, y); diff --git a/crypto/src/math/ec/rfc8032/Ed448.cs b/crypto/src/math/ec/rfc8032/Ed448.cs index 12f24c1ff..c1202dc02 100644 --- a/crypto/src/math/ec/rfc8032/Ed448.cs +++ b/crypto/src/math/ec/rfc8032/Ed448.cs @@ -702,7 +702,7 @@ namespace Org.BouncyCastle.Math.EC.Rfc8032 { PointExt q = points[i]; // TODO[ed448] Batch inversion - X448Field.Inv(q.z, q.z); + X448Field.InvVar(q.z, q.z); X448Field.Mul(q.x, q.z, q.x); X448Field.Mul(q.y, q.z, q.y); -- cgit 1.5.1