diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-09-11 11:54:39 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-09-11 11:54:39 +0700 |
commit | 5e4ffd78e073bf15b255c1465fa211a13105b65c (patch) | |
tree | 7d3d23488573a45cb31dd3477ee9995b49523f2c /crypto/src/math/ec/custom | |
parent | Further Divsteps30 improvement (diff) | |
download | BouncyCastle.NET-ed25519-5e4ffd78e073bf15b255c1465fa211a13105b65c.tar.xz |
Fixed loop count for BigInteger conversion
- remove length-specific variants of FromBigInteger
Diffstat (limited to 'crypto/src/math/ec/custom')
-rw-r--r-- | crypto/src/math/ec/custom/djb/Curve25519Field.cs | 2 | ||||
-rw-r--r-- | crypto/src/math/ec/custom/gm/SM2P256V1Field.cs | 2 | ||||
-rw-r--r-- | crypto/src/math/ec/custom/sec/SecP128R1Field.cs | 2 | ||||
-rw-r--r-- | crypto/src/math/ec/custom/sec/SecP160R1Field.cs | 2 | ||||
-rw-r--r-- | crypto/src/math/ec/custom/sec/SecP160R2Field.cs | 2 | ||||
-rw-r--r-- | crypto/src/math/ec/custom/sec/SecP192K1Field.cs | 2 | ||||
-rw-r--r-- | crypto/src/math/ec/custom/sec/SecP192R1Field.cs | 2 | ||||
-rw-r--r-- | crypto/src/math/ec/custom/sec/SecP224K1Field.cs | 2 | ||||
-rw-r--r-- | crypto/src/math/ec/custom/sec/SecP224R1Field.cs | 2 | ||||
-rw-r--r-- | crypto/src/math/ec/custom/sec/SecP256K1Field.cs | 2 | ||||
-rw-r--r-- | crypto/src/math/ec/custom/sec/SecP256R1Field.cs | 2 |
11 files changed, 11 insertions, 11 deletions
diff --git a/crypto/src/math/ec/custom/djb/Curve25519Field.cs b/crypto/src/math/ec/custom/djb/Curve25519Field.cs index 0006acd94..31416249d 100644 --- a/crypto/src/math/ec/custom/djb/Curve25519Field.cs +++ b/crypto/src/math/ec/custom/djb/Curve25519Field.cs @@ -47,7 +47,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Djb public static uint[] FromBigInteger(BigInteger x) { - uint[] z = Nat256.FromBigInteger(x); + uint[] z = Nat.FromBigInteger(256, x); while (Nat256.Gte(z, P)) { Nat256.SubFrom(P, z); diff --git a/crypto/src/math/ec/custom/gm/SM2P256V1Field.cs b/crypto/src/math/ec/custom/gm/SM2P256V1Field.cs index 38743189a..6fbe849a8 100644 --- a/crypto/src/math/ec/custom/gm/SM2P256V1Field.cs +++ b/crypto/src/math/ec/custom/gm/SM2P256V1Field.cs @@ -47,7 +47,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.GM public static uint[] FromBigInteger(BigInteger x) { - uint[] z = Nat256.FromBigInteger(x); + uint[] z = Nat.FromBigInteger(256, x); if (z[7] >= P7 && Nat256.Gte(z, P)) { Nat256.SubFrom(P, z); diff --git a/crypto/src/math/ec/custom/sec/SecP128R1Field.cs b/crypto/src/math/ec/custom/sec/SecP128R1Field.cs index 03a07f79b..838f4dfec 100644 --- a/crypto/src/math/ec/custom/sec/SecP128R1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP128R1Field.cs @@ -47,7 +47,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public static uint[] FromBigInteger(BigInteger x) { - uint[] z = Nat128.FromBigInteger(x); + uint[] z = Nat.FromBigInteger(128, x); if (z[3] >= P3 && Nat128.Gte(z, P)) { Nat128.SubFrom(P, z); diff --git a/crypto/src/math/ec/custom/sec/SecP160R1Field.cs b/crypto/src/math/ec/custom/sec/SecP160R1Field.cs index 31c957301..f4b1e2a23 100644 --- a/crypto/src/math/ec/custom/sec/SecP160R1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP160R1Field.cs @@ -51,7 +51,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public static uint[] FromBigInteger(BigInteger x) { - uint[] z = Nat160.FromBigInteger(x); + uint[] z = Nat.FromBigInteger(160, x); if (z[4] == P4 && Nat160.Gte(z, P)) { Nat160.SubFrom(P, z); diff --git a/crypto/src/math/ec/custom/sec/SecP160R2Field.cs b/crypto/src/math/ec/custom/sec/SecP160R2Field.cs index 55f02e438..9ad594376 100644 --- a/crypto/src/math/ec/custom/sec/SecP160R2Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP160R2Field.cs @@ -51,7 +51,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public static uint[] FromBigInteger(BigInteger x) { - uint[] z = Nat160.FromBigInteger(x); + uint[] z = Nat.FromBigInteger(160, x); if (z[4] == P4 && Nat160.Gte(z, P)) { Nat160.SubFrom(P, z); diff --git a/crypto/src/math/ec/custom/sec/SecP192K1Field.cs b/crypto/src/math/ec/custom/sec/SecP192K1Field.cs index 23bd732bd..46b7c4ebd 100644 --- a/crypto/src/math/ec/custom/sec/SecP192K1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP192K1Field.cs @@ -52,7 +52,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public static uint[] FromBigInteger(BigInteger x) { - uint[] z = Nat192.FromBigInteger(x); + uint[] z = Nat.FromBigInteger(192, x); if (z[5] == P5 && Nat192.Gte(z, P)) { Nat192.SubFrom(P, z); diff --git a/crypto/src/math/ec/custom/sec/SecP192R1Field.cs b/crypto/src/math/ec/custom/sec/SecP192R1Field.cs index a4fb4bb76..10e204677 100644 --- a/crypto/src/math/ec/custom/sec/SecP192R1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP192R1Field.cs @@ -51,7 +51,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public static uint[] FromBigInteger(BigInteger x) { - uint[] z = Nat192.FromBigInteger(x); + uint[] z = Nat.FromBigInteger(192, x); if (z[5] == P5 && Nat192.Gte(z, P)) { Nat192.SubFrom(P, z); diff --git a/crypto/src/math/ec/custom/sec/SecP224K1Field.cs b/crypto/src/math/ec/custom/sec/SecP224K1Field.cs index 5d4237708..36e5364a4 100644 --- a/crypto/src/math/ec/custom/sec/SecP224K1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP224K1Field.cs @@ -53,7 +53,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public static uint[] FromBigInteger(BigInteger x) { - uint[] z = Nat224.FromBigInteger(x); + uint[] z = Nat.FromBigInteger(224, x); if (z[6] == P6 && Nat224.Gte(z, P)) { Nat224.SubFrom(P, z); diff --git a/crypto/src/math/ec/custom/sec/SecP224R1Field.cs b/crypto/src/math/ec/custom/sec/SecP224R1Field.cs index dde291d5e..242f8f352 100644 --- a/crypto/src/math/ec/custom/sec/SecP224R1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP224R1Field.cs @@ -52,7 +52,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public static uint[] FromBigInteger(BigInteger x) { - uint[] z = Nat224.FromBigInteger(x); + uint[] z = Nat.FromBigInteger(224, x); if (z[6] == P6 && Nat224.Gte(z, P)) { Nat224.SubFrom(P, z); diff --git a/crypto/src/math/ec/custom/sec/SecP256K1Field.cs b/crypto/src/math/ec/custom/sec/SecP256K1Field.cs index acdb1f362..9a8915c01 100644 --- a/crypto/src/math/ec/custom/sec/SecP256K1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP256K1Field.cs @@ -53,7 +53,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public static uint[] FromBigInteger(BigInteger x) { - uint[] z = Nat256.FromBigInteger(x); + uint[] z = Nat.FromBigInteger(256, x); if (z[7] == P7 && Nat256.Gte(z, P)) { Nat256.SubFrom(P, z); diff --git a/crypto/src/math/ec/custom/sec/SecP256R1Field.cs b/crypto/src/math/ec/custom/sec/SecP256R1Field.cs index 668efc895..a1079f39c 100644 --- a/crypto/src/math/ec/custom/sec/SecP256R1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP256R1Field.cs @@ -47,7 +47,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public static uint[] FromBigInteger(BigInteger x) { - uint[] z = Nat256.FromBigInteger(x); + uint[] z = Nat.FromBigInteger(256, x); if (z[7] == P7 && Nat256.Gte(z, P)) { Nat256.SubFrom(P, z); |