diff options
Diffstat (limited to 'crypto/src/math/ec/rfc8032/Ed25519.cs')
-rw-r--r-- | crypto/src/math/ec/rfc8032/Ed25519.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/src/math/ec/rfc8032/Ed25519.cs b/crypto/src/math/ec/rfc8032/Ed25519.cs index 7318a8a7e..1cd9ddd48 100644 --- a/crypto/src/math/ec/rfc8032/Ed25519.cs +++ b/crypto/src/math/ec/rfc8032/Ed25519.cs @@ -751,7 +751,9 @@ namespace Org.BouncyCastle.Math.EC.Rfc8032 uint[] v1 = new uint[4]; #endif - Scalar25519.ReduceBasisVar(nA, v0, v1); + if (!Scalar25519.ReduceBasisVar(nA, v0, v1)) + throw new InvalidOperationException(); + Scalar25519.Multiply128Var(nS, v1, nS); Init(out PointAccum pZ); @@ -852,7 +854,9 @@ namespace Org.BouncyCastle.Math.EC.Rfc8032 uint[] v1 = new uint[4]; #endif - Scalar25519.ReduceBasisVar(nA, v0, v1); + if (!Scalar25519.ReduceBasisVar(nA, v0, v1)) + throw new InvalidOperationException(); + Scalar25519.Multiply128Var(nS, v1, nS); Init(out PointAccum pZ); |