(byte[] secret)
| 177 | * may start with 0, even if it is a positive value. |
| 178 | */ |
| 179 | protected byte[] normalize(byte[] secret) { |
| 180 | if(secret.length > 1 && |
| 181 | secret[0] == 0 && (secret[1]&0x80) == 0) { |
| 182 | byte[] tmp=new byte[secret.length-1]; |
| 183 | System.arraycopy(secret, 1, tmp, 0, tmp.length); |
| 184 | return normalize(tmp); |
| 185 | } |
| 186 | else { |
| 187 | return secret; |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | protected boolean verify(String alg, byte[] K_S, int index, |
| 192 | byte[] sig_of_H) throws Exception { |