44import java .io .DataInputStream ;
55import java .io .IOException ;
66import java .io .InputStream ;
7- import java .util .Arrays ;
87
98import org .bouncycastle .crypto .Digest ;
9+ import org .bouncycastle .util .Arrays ;
1010import org .bouncycastle .util .Encodable ;
11+ import org .bouncycastle .util .Objects ;
1112import org .bouncycastle .util .io .Streams ;
1213
1314import static org .bouncycastle .pqc .crypto .lms .LM_OTS .D_MESG ;
@@ -90,7 +91,6 @@ public byte[] getK()
9091 return K ;
9192 }
9293
93- @ Override
9494 public boolean equals (Object o )
9595 {
9696 if (this == o )
@@ -104,25 +104,15 @@ public boolean equals(Object o)
104104
105105 LMOtsPublicKey that = (LMOtsPublicKey )o ;
106106
107- if (q != that .q )
108- {
109- return false ;
110- }
111- if (parameter != null ? !parameter .equals (that .parameter ) : that .parameter != null )
112- {
113- return false ;
114- }
115- if (!Arrays .equals (I , that .I ))
116- {
117- return false ;
118- }
119- return Arrays .equals (K , that .K );
107+ return q == that .q
108+ && Objects .areEqual (parameter , that .parameter )
109+ && Arrays .areEqual (I , that .I )
110+ && Arrays .areEqual (K , that .K );
120111 }
121112
122- @ Override
123113 public int hashCode ()
124114 {
125- int result = parameter != null ? parameter .hashCode () : 0 ;
115+ int result = Objects .hashCode (parameter ) ;
126116 result = 31 * result + Arrays .hashCode (I );
127117 result = 31 * result + q ;
128118 result = 31 * result + Arrays .hashCode (K );
0 commit comments