/**
* ODD 算法
*
* @param K
* @return
*/
public static byte[] ODD(byte[] K) {
if ((K == null)) {
return null;
}
for (int i = 0; i < K.length; i++) {
int count = 0;
for (int j = 0; j <= 7; j++) {
int result = (byte) (K[i] >> j) & (byte) 0x01;
if (result > 0) {
count = count + 1;
}
}
if (count % 2 == 0) {
K[i] = (byte) (K[i] ^ (byte) 0x01);
}
}
return K;
}