diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2019-09-09 15:52:36 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2019-09-09 15:52:36 +0700 |
commit | 71a58e93463e0a7e4f277069f9e133a98a9a8bcb (patch) | |
tree | b14b3c28149ece39a59bf14d6f2d45bed7774dcd /crypto/src/math/ec/custom/djb | |
parent | Add sanity checks on scalar mult. outputs (diff) | |
download | BouncyCastle.NET-ed25519-71a58e93463e0a7e4f277069f9e133a98a9a8bcb.tar.xz |
Port of strict hex decoding from bc-java
Diffstat (limited to 'crypto/src/math/ec/custom/djb')
-rw-r--r-- | crypto/src/math/ec/custom/djb/Curve25519.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/src/math/ec/custom/djb/Curve25519.cs b/crypto/src/math/ec/custom/djb/Curve25519.cs index 190edf6ec..f9a1b450c 100644 --- a/crypto/src/math/ec/custom/djb/Curve25519.cs +++ b/crypto/src/math/ec/custom/djb/Curve25519.cs @@ -10,8 +10,8 @@ namespace Org.BouncyCastle.Math.EC.Custom.Djb { 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")); + private static readonly BigInteger C_a = new BigInteger(1, Hex.DecodeStrict("2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA984914A144")); + private static readonly BigInteger C_b = new BigInteger(1, Hex.DecodeStrict("7B425ED097B425ED097B425ED097B425ED097B425ED097B4260B5E9C7710C864")); private const int CURVE25519_DEFAULT_COORDS = COORD_JACOBIAN_MODIFIED; private const int CURVE25519_FE_INTS = 8; @@ -26,7 +26,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Djb this.m_a = FromBigInteger(C_a); this.m_b = FromBigInteger(C_b); - this.m_order = new BigInteger(1, Hex.Decode("1000000000000000000000000000000014DEF9DEA2F79CD65812631A5CF5D3ED")); + this.m_order = new BigInteger(1, Hex.DecodeStrict("1000000000000000000000000000000014DEF9DEA2F79CD65812631A5CF5D3ED")); this.m_cofactor = BigInteger.ValueOf(8); this.m_coord = CURVE25519_DEFAULT_COORDS; } |