Skip to content

Commit

Permalink
added bounds check on f2m field size.
Browse files Browse the repository at this point in the history
  • Loading branch information
dghgit committed Dec 18, 2023
1 parent 4d1f8aa commit efc498c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/main/java/org/bouncycastle/math/ec/ECCurve.java
Expand Up @@ -998,6 +998,11 @@ protected ECFieldElement solveQuadraticEquation(ECFieldElement beta)

int m = this.getFieldSize();

if (m > Properties.asInteger("org.bouncycastle.ec.max_f2m_field_size", 1142)) // twice 571
{
throw new IllegalStateException("field size out of range: " + m);
}

// For odd m, use the half-trace
if (0 != (m & 1))
{
Expand Down

0 comments on commit efc498c

Please sign in to comment.