diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2019-08-10 00:18:41 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2019-08-10 00:18:41 +0700 |
commit | 36cf0ee10f38735f771d477368e384eae607f6d0 (patch) | |
tree | c04aed6ce1497acc8366a564f62a6d01de8510d4 /crypto/src/math/ec/custom/djb | |
parent | Add and use IntValueExact properties (diff) | |
download | BouncyCastle.NET-ed25519-36cf0ee10f38735f771d477368e384eae607f6d0.tar.xz |
Fix circular dependence of statics
Diffstat (limited to 'crypto/src/math/ec/custom/djb')
-rw-r--r-- | crypto/src/math/ec/custom/djb/Curve25519.cs | 2 | ||||
-rw-r--r-- | crypto/src/math/ec/custom/djb/Curve25519FieldElement.cs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/crypto/src/math/ec/custom/djb/Curve25519.cs b/crypto/src/math/ec/custom/djb/Curve25519.cs index f64eed244..190edf6ec 100644 --- a/crypto/src/math/ec/custom/djb/Curve25519.cs +++ b/crypto/src/math/ec/custom/djb/Curve25519.cs @@ -8,7 +8,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Djb internal class Curve25519 : AbstractFpCurve { - public static readonly BigInteger q = Nat256.ToBigInteger(Curve25519Field.P); + public static readonly BigInteger q = Curve25519FieldElement.Q; private static readonly BigInteger C_a = new BigInteger(1, Hex.Decode("2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA984914A144")); private static readonly BigInteger C_b = new BigInteger(1, Hex.Decode("7B425ED097B425ED097B425ED097B425ED097B425ED097B4260B5E9C7710C864")); diff --git a/crypto/src/math/ec/custom/djb/Curve25519FieldElement.cs b/crypto/src/math/ec/custom/djb/Curve25519FieldElement.cs index 37256a550..5d82df547 100644 --- a/crypto/src/math/ec/custom/djb/Curve25519FieldElement.cs +++ b/crypto/src/math/ec/custom/djb/Curve25519FieldElement.cs @@ -8,7 +8,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Djb internal class Curve25519FieldElement : AbstractFpFieldElement { - public static readonly BigInteger Q = Curve25519.q; + public static readonly BigInteger Q = Nat256.ToBigInteger(Curve25519Field.P); // Calculated as ECConstants.TWO.modPow(Q.shiftRight(2), Q) private static readonly uint[] PRECOMP_POW2 = new uint[]{ 0x4a0ea0b0, 0xc4ee1b27, 0xad2fe478, 0x2f431806, |