From 45c6b993945f01076e386cb59988b1836a329999 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 7 May 2024 22:44:37 +0700 Subject: Patch #1 for 2.3 - TLS: fix timing side-channel for RSA key exchange - fix method Write(ReadOnlySpan) in LimitedBuffer - ASN.1: Limit OID contents to 4096 bytes - EdDSA: fix verification infinite loop - EC: restrict m value in F2m curves --- crypto/test/src/math/ec/test/ECPointTest.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'crypto/test/src/math/ec') diff --git a/crypto/test/src/math/ec/test/ECPointTest.cs b/crypto/test/src/math/ec/test/ECPointTest.cs index 7a833a413..a5129f3fb 100644 --- a/crypto/test/src/math/ec/test/ECPointTest.cs +++ b/crypto/test/src/math/ec/test/ECPointTest.cs @@ -179,6 +179,26 @@ namespace Org.BouncyCastle.Math.EC.Tests } } + [Test] + public void TestLargeMInF2m() + { + int m = 2048; + int k1 = 1; + BigInteger aTpb = new BigInteger("1000", 2); + BigInteger bTpb = new BigInteger("1001", 2); + BigInteger n = new BigInteger("23"); + BigInteger h = new BigInteger("1"); + + try + { + F2mCurve curve = new F2mCurve(m, k1, aTpb, bTpb, n, h); + } + catch (ArgumentException e) + { + Assert.AreEqual("F2m m value out of range", e.Message); + } + } + /** * Calls implTestAdd() for Fp and * F2m. -- cgit 1.5.1