File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
main/java/de/rub/nds/tlsattacker/core/crypto/ec
test/java/de/rub/nds/tlsattacker/core/crypto/ec Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,10 @@ public Point createAPointOnCurve(BigInteger x) {
209209 * @return The result z for the quadratic equation or null if non-existent
210210 */
211211 public FieldElementF2m solveQuadraticEquation (FieldElement beta ) {
212+ if (beta .getData ().equals (BigInteger .ZERO )) {
213+ return new FieldElementF2m (BigInteger .ONE , beta .getModulus ());
214+ }
215+
212216 FieldElementF2m gamma ;
213217 FieldElementF2m z ;
214218 Random randNum = new Random (0 );
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ public void compressionFormatTest() {
101101 ArrayConverter .hexStringToByteArray ("0300D9B67D192E0367C803F39E1A7E82CA14A651350AAE617E8F" );
102102 byte [] sect233r1Base =
103103 ArrayConverter .hexStringToByteArray ("0300FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B" );
104- byte [] secp571k1Base = ArrayConverter .hexStringToByteArray (
104+ byte [] sect571k1Base = ArrayConverter .hexStringToByteArray (
105105 "02026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA44370958493B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C8972" );
106106
107107 byte [] compressed = PointFormatter .formatToByteArray (NamedGroup .SECP160R1 ,
@@ -126,6 +126,6 @@ public void compressionFormatTest() {
126126
127127 compressed = PointFormatter .formatToByteArray (NamedGroup .SECT571K1 ,
128128 CurveFactory .getCurve (NamedGroup .SECT571K1 ).getBasePoint (), ECPointFormat .ANSIX962_COMPRESSED_CHAR2 );
129- assertArrayEquals (secp571k1Base , compressed );
129+ assertArrayEquals (sect571k1Base , compressed );
130130 }
131131}
You can’t perform that action at this time.
0 commit comments