diff options
author | David Hook <dgh@cryptoworkshop.com> | 2022-03-23 14:26:36 +1100 |
---|---|---|
committer | David Hook <dgh@cryptoworkshop.com> | 2022-03-23 14:26:36 +1100 |
commit | 377a6f0d2bf1c01cd297c491998245056b8ebff7 (patch) | |
tree | fee0cc5c52b05700fd63bdb6df9ef498ddf0e9a1 /crypto/src/asn1 | |
parent | Merge remote-tracking branch 'refs/remotes/origin/master' (diff) | |
download | BouncyCastle.NET-ed25519-377a6f0d2bf1c01cd297c491998245056b8ebff7.tar.xz |
added RSA/EC checks
Diffstat (limited to '')
-rw-r--r-- | crypto/src/asn1/anssi/ANSSINamedCurves.cs | 2 | ||||
-rw-r--r-- | crypto/src/asn1/cryptopro/ECGOST3410NamedCurves.cs | 16 | ||||
-rw-r--r-- | crypto/src/asn1/gm/GMNamedCurves.cs | 4 | ||||
-rw-r--r-- | crypto/src/asn1/sec/SECNamedCurves.cs | 30 | ||||
-rw-r--r-- | crypto/src/asn1/x9/X962NamedCurves.cs | 14 |
5 files changed, 33 insertions, 33 deletions
diff --git a/crypto/src/asn1/anssi/ANSSINamedCurves.cs b/crypto/src/asn1/anssi/ANSSINamedCurves.cs index 48017fc2a..3a9e4dd03 100644 --- a/crypto/src/asn1/anssi/ANSSINamedCurves.cs +++ b/crypto/src/asn1/anssi/ANSSINamedCurves.cs @@ -48,7 +48,7 @@ namespace Org.BouncyCastle.Asn1.Anssi BigInteger n = FromHex("F1FD178C0B3AD58F10126DE8CE42435B53DC67E140D2BF941FFDD459C6D655E1"); BigInteger h = BigInteger.One; - return ConfigureCurve(new FpCurve(p, a, b, n, h)); + return ConfigureCurve(new FpCurve(p, a, b, n, h, true)); } protected override X9ECParameters CreateParameters() diff --git a/crypto/src/asn1/cryptopro/ECGOST3410NamedCurves.cs b/crypto/src/asn1/cryptopro/ECGOST3410NamedCurves.cs index 121843ada..5ac8cadfe 100644 --- a/crypto/src/asn1/cryptopro/ECGOST3410NamedCurves.cs +++ b/crypto/src/asn1/cryptopro/ECGOST3410NamedCurves.cs @@ -58,7 +58,7 @@ namespace Org.BouncyCastle.Asn1.CryptoPro mod_p, FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD94"), FromHex("A6"), - mod_q, BigInteger.One)); + mod_q, BigInteger.One, true)); } protected override X9ECParameters CreateParameters() @@ -93,7 +93,7 @@ namespace Org.BouncyCastle.Asn1.CryptoPro mod_p, FromHex("8000000000000000000000000000000000000000000000000000000000000C96"), FromHex("3E1AF419A269A5F866A7D3C25C3DF80AE979259373FF2B182F49D4CE7E1BBC8B"), - mod_q, BigInteger.One)); + mod_q, BigInteger.One, true)); } protected override X9ECParameters CreateParameters() @@ -128,7 +128,7 @@ namespace Org.BouncyCastle.Asn1.CryptoPro mod_p, FromHex("9B9F605F5A858107AB1EC85E6B41C8AACF846E86789051D37998F7B9022D7598"), FromHex("805A"), - mod_q, BigInteger.One)); + mod_q, BigInteger.One, true)); } protected override X9ECParameters CreateParameters() @@ -163,7 +163,7 @@ namespace Org.BouncyCastle.Asn1.CryptoPro mod_p, FromHex("9B9F605F5A858107AB1EC85E6B41C8AACF846E86789051D37998F7B9022D7598"), FromHex("805A"), - mod_q, BigInteger.One)); + mod_q, BigInteger.One, true)); } protected override X9ECParameters CreateParameters() @@ -198,7 +198,7 @@ namespace Org.BouncyCastle.Asn1.CryptoPro mod_p, FromHex("C2173F1513981673AF4892C23035A27CE25E2013BF95AA33B22C656F277E7335"), FromHex("295F9BAE7428ED9CCC20E7C359A9D41A22FCCD9108E17BF7BA9337A6F8AE9513"), - mod_q, BigInteger.Four)); + mod_q, BigInteger.Four, true)); } protected override X9ECParameters CreateParameters() @@ -233,7 +233,7 @@ namespace Org.BouncyCastle.Asn1.CryptoPro mod_p, FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC4"), FromHex("E8C2505DEDFC86DDC1BD0B2B6667F1DA34B82574761CB0E879BD081CFD0B6265EE3CB090F30D27614CB4574010DA90DD862EF9D4EBEE4761503190785A71C760"), - mod_q, BigInteger.One)); + mod_q, BigInteger.One, true)); } protected override X9ECParameters CreateParameters() @@ -268,7 +268,7 @@ namespace Org.BouncyCastle.Asn1.CryptoPro mod_p, FromHex("8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006C"), FromHex("687D1B459DC841457E3E06CF6F5E2517B97C7D614AF138BCBF85DC806C4B289F3E965D2DB1416D217F8B276FAD1AB69C50F78BEE1FA3106EFB8CCBC7C5140116"), - mod_q, BigInteger.One)); + mod_q, BigInteger.One, true)); } protected override X9ECParameters CreateParameters() @@ -303,7 +303,7 @@ namespace Org.BouncyCastle.Asn1.CryptoPro mod_p, FromHex("DC9203E514A721875485A529D2C722FB187BC8980EB866644DE41C68E143064546E861C0E2C9EDD92ADE71F46FCF50FF2AD97F951FDA9F2A2EB6546F39689BD3"), FromHex("B4C4EE28CEBC6C2C8AC12952CF37F16AC7EFB6A9F69F4B57FFDA2E4F0DE5ADE038CBC2FFF719D2C18DE0284B8BFEF3B52B8CC7A5F5BF0A3C8D2319A5312557E1"), - mod_q, BigInteger.Four)); + mod_q, BigInteger.Four, true)); } protected override X9ECParameters CreateParameters() diff --git a/crypto/src/asn1/gm/GMNamedCurves.cs b/crypto/src/asn1/gm/GMNamedCurves.cs index 9cb2cef14..f906a2b95 100644 --- a/crypto/src/asn1/gm/GMNamedCurves.cs +++ b/crypto/src/asn1/gm/GMNamedCurves.cs @@ -52,7 +52,7 @@ namespace Org.BouncyCastle.Asn1.GM BigInteger n = FromHex("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123"); BigInteger h = BigInteger.One; - return ConfigureCurve(new FpCurve(p, a, b, n, h)); + return ConfigureCurve(new FpCurve(p, a, b, n, h, true)); } protected override X9ECParameters CreateParameters() @@ -85,7 +85,7 @@ namespace Org.BouncyCastle.Asn1.GM BigInteger n = FromHex("BDB6F4FE3E8B1D9E0DA8C0D40FC962195DFAE76F56564677"); BigInteger h = BigInteger.One; - return ConfigureCurve(new FpCurve(p, a, b, n, h)); + return ConfigureCurve(new FpCurve(p, a, b, n, h, true)); } protected override X9ECParameters CreateParameters() diff --git a/crypto/src/asn1/sec/SECNamedCurves.cs b/crypto/src/asn1/sec/SECNamedCurves.cs index 68e9b7eca..ad2f3e333 100644 --- a/crypto/src/asn1/sec/SECNamedCurves.cs +++ b/crypto/src/asn1/sec/SECNamedCurves.cs @@ -60,7 +60,7 @@ namespace Org.BouncyCastle.Asn1.Sec BigInteger n = FromHex("DB7C2ABF62E35E7628DFAC6561C5"); BigInteger h = BigInteger.One; - return ConfigureCurve(new FpCurve(p, a, b, n, h)); + return ConfigureCurve(new FpCurve(p, a, b, n, h, true)); } protected override X9ECParameters CreateParameters() @@ -94,7 +94,7 @@ namespace Org.BouncyCastle.Asn1.Sec BigInteger n = FromHex("36DF0AAFD8B8D7597CA10520D04B"); BigInteger h = BigInteger.ValueOf(4); - return ConfigureCurve(new FpCurve(p, a, b, n, h)); + return ConfigureCurve(new FpCurve(p, a, b, n, h, true)); } protected override X9ECParameters CreateParameters() @@ -128,7 +128,7 @@ namespace Org.BouncyCastle.Asn1.Sec BigInteger n = FromHex("FFFFFFFE0000000075A30D1B9038A115"); BigInteger h = BigInteger.One; - return ConfigureCurve(new FpCurve(p, a, b, n, h)); + return ConfigureCurve(new FpCurve(p, a, b, n, h, true)); } protected override X9ECParameters CreateParameters() @@ -162,7 +162,7 @@ namespace Org.BouncyCastle.Asn1.Sec BigInteger n = FromHex("3FFFFFFF7FFFFFFFBE0024720613B5A3"); BigInteger h = BigInteger.ValueOf(4); - return ConfigureCurve(new FpCurve(p, a, b, n, h)); + return ConfigureCurve(new FpCurve(p, a, b, n, h, true)); } protected override X9ECParameters CreateParameters() @@ -210,7 +210,7 @@ namespace Org.BouncyCastle.Asn1.Sec new BigInteger("96341f1138933bc2f503fd44", 16), 176)); - return ConfigureCurveGlv(new FpCurve(p, a, b, n, h), glv); + return ConfigureCurveGlv(new FpCurve(p, a, b, n, h, true), glv); } protected override X9ECParameters CreateParameters() @@ -244,7 +244,7 @@ namespace Org.BouncyCastle.Asn1.Sec BigInteger n = FromHex("0100000000000000000001F4C8F927AED3CA752257"); BigInteger h = BigInteger.One; - return ConfigureCurve(new FpCurve(p, a, b, n, h)); + return ConfigureCurve(new FpCurve(p, a, b, n, h, true)); } protected override X9ECParameters CreateParameters() @@ -278,7 +278,7 @@ namespace Org.BouncyCastle.Asn1.Sec BigInteger n = FromHex("0100000000000000000000351EE786A818F3A1A16B"); BigInteger h = BigInteger.One; - return ConfigureCurve(new FpCurve(p, a, b, n, h)); + return ConfigureCurve(new FpCurve(p, a, b, n, h, true)); } protected override X9ECParameters CreateParameters() @@ -326,7 +326,7 @@ namespace Org.BouncyCastle.Asn1.Sec new BigInteger("b3fb3400dec5c4adceb8655d4c94", 16), 208)); - return ConfigureCurveGlv(new FpCurve(p, a, b, n, h), glv); + return ConfigureCurveGlv(new FpCurve(p, a, b, n, h, true), glv); } protected override X9ECParameters CreateParameters() @@ -360,7 +360,7 @@ namespace Org.BouncyCastle.Asn1.Sec BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"); BigInteger h = BigInteger.One; - return ConfigureCurve(new FpCurve(p, a, b, n, h)); + return ConfigureCurve(new FpCurve(p, a, b, n, h, true)); } protected override X9ECParameters CreateParameters() @@ -408,7 +408,7 @@ namespace Org.BouncyCastle.Asn1.Sec new BigInteger("b8adf1378a6eb73409fa6c9c637ba7f5", 16), 240)); - return ConfigureCurveGlv(new FpCurve(p, a, b, n, h), glv); + return ConfigureCurveGlv(new FpCurve(p, a, b, n, h, true), glv); } protected override X9ECParameters CreateParameters() @@ -442,7 +442,7 @@ namespace Org.BouncyCastle.Asn1.Sec BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"); BigInteger h = BigInteger.One; - return ConfigureCurve(new FpCurve(p, a, b, n, h)); + return ConfigureCurve(new FpCurve(p, a, b, n, h, true)); } protected override X9ECParameters CreateParameters() @@ -490,7 +490,7 @@ namespace Org.BouncyCastle.Asn1.Sec new BigInteger("e4437ed6010e88286f547fa90abfe4c42212", 16), 272)); - return ConfigureCurveGlv(new FpCurve(p, a, b, n, h), glv); + return ConfigureCurveGlv(new FpCurve(p, a, b, n, h, true), glv); } protected override X9ECParameters CreateParameters() @@ -524,7 +524,7 @@ namespace Org.BouncyCastle.Asn1.Sec BigInteger n = FromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"); BigInteger h = BigInteger.One; - return ConfigureCurve(new FpCurve(p, a, b, n, h)); + return ConfigureCurve(new FpCurve(p, a, b, n, h, true)); } protected override X9ECParameters CreateParameters() @@ -558,7 +558,7 @@ namespace Org.BouncyCastle.Asn1.Sec BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973"); BigInteger h = BigInteger.One; - return ConfigureCurve(new FpCurve(p, a, b, n, h)); + return ConfigureCurve(new FpCurve(p, a, b, n, h, true)); } protected override X9ECParameters CreateParameters() @@ -593,7 +593,7 @@ namespace Org.BouncyCastle.Asn1.Sec BigInteger n = FromHex("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409"); BigInteger h = BigInteger.One; - return ConfigureCurve(new FpCurve(p, a, b, n, h)); + return ConfigureCurve(new FpCurve(p, a, b, n, h, true)); } protected override X9ECParameters CreateParameters() diff --git a/crypto/src/asn1/x9/X962NamedCurves.cs b/crypto/src/asn1/x9/X962NamedCurves.cs index 04f3d335a..4fd3c8d1e 100644 --- a/crypto/src/asn1/x9/X962NamedCurves.cs +++ b/crypto/src/asn1/x9/X962NamedCurves.cs @@ -52,7 +52,7 @@ namespace Org.BouncyCastle.Asn1.X9 FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"), FromHex("fffffffffffffffffffffffffffffffefffffffffffffffc"), FromHex("64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1"), - n, h)); + n, h, true)); } protected override X9ECParameters CreateParameters() @@ -83,7 +83,7 @@ namespace Org.BouncyCastle.Asn1.X9 FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"), FromHex("fffffffffffffffffffffffffffffffefffffffffffffffc"), FromHex("cc22d6dfb95c6b25e49c0d6364a4e5980c393aa21668d953"), - n, h)); + n, h, true)); } protected override X9ECParameters CreateParameters() @@ -114,7 +114,7 @@ namespace Org.BouncyCastle.Asn1.X9 FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"), FromHex("fffffffffffffffffffffffffffffffefffffffffffffffc"), FromHex("22123dc2395a05caa7423daeccc94760a7d462256bd56916"), - n, h)); + n, h, true)); } protected override X9ECParameters CreateParameters() @@ -145,7 +145,7 @@ namespace Org.BouncyCastle.Asn1.X9 new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"), FromHex("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc"), FromHex("6b016c3bdcf18941d0d654921475ca71a9db2fb27d1d37796185c2942c0a"), - n, h)); + n, h, true)); } protected override X9ECParameters CreateParameters() @@ -176,7 +176,7 @@ namespace Org.BouncyCastle.Asn1.X9 new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"), FromHex("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc"), FromHex("617fab6832576cbbfed50d99f0249c3fee58b94ba0038c7ae84c8c832f2c"), - n, h)); + n, h, true)); } protected override X9ECParameters CreateParameters() @@ -207,7 +207,7 @@ namespace Org.BouncyCastle.Asn1.X9 new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"), FromHex("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc"), FromHex("255705fa2a306654b1f4cb03d6a750a30c250102d4988717d9ba15ab6d3e"), - n, h)); + n, h, true)); } protected override X9ECParameters CreateParameters() @@ -238,7 +238,7 @@ namespace Org.BouncyCastle.Asn1.X9 new BigInteger("115792089210356248762697446949407573530086143415290314195533631308867097853951"), FromHex("ffffffff00000001000000000000000000000000fffffffffffffffffffffffc"), FromHex("5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"), - n, h)); + n, h, true)); } protected override X9ECParameters CreateParameters() |